Commit Graph

41 Commits

Author SHA1 Message Date
Hal Canary
209e4b1b70 Revert "Revert "SkTypeface::getAdvancedMetrics(): cleanup""
This reverts commit 59ad782b2b.

   - SkAdvancedTypefaceMetrics is a struct not a class
   - SkTypeface::PerGlyphInfo is gone
   - s/getAdvancedTypefaceMetrics/getAdvancedMetrics/g
   - s/onGetAdvancedTypefaceMetrics/onGetAdvancedMetrics/g
   - [on]getAdvancedMetrics now return unique_ptr rather than bare ptr.
   - [on]getAdvancedMetrics no longer has parameters. (Only caller always
     used same arguments.)
   - SkAdvancedTypefaceMetrics uses C++11 in-class member initializers.
   - SkAdvancedTypefaceMetrics no longer inherits from SkRefCnt

Change-Id: I91b56e60f7d9de7d46c426c6bd34ce124e0cf00e
Reviewed-on: https://skia-review.googlesource.com/15360
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-05-05 13:53:40 +00:00
Hal Canary
59ad782b2b Revert "SkTypeface::getAdvancedMetrics(): cleanup"
This reverts commit cef018896e.

Reason for revert: broke chromium roll (windows).

Original change's description:
> SkTypeface::getAdvancedMetrics(): cleanup
> 
>   - SkAdvancedTypefaceMetrics is a struct not a class
>   - SkTypeface::PerGlyphInfo is gone
>   - s/getAdvancedTypefaceMetrics/getAdvancedMetrics/g
>   - s/onGetAdvancedTypefaceMetrics/onGetAdvancedMetrics/g
>   - [on]getAdvancedMetrics now return unique_ptr rather than bare ptr.
>   - [on]getAdvancedMetrics no longer has parameters. (Only caller always
>     used same arguments.)
>   - SkAdvancedTypefaceMetrics uses C++11 in-class member initializers.
>   - SkAdvancedTypefaceMetrics no longer inherits from SkRefCnt
> 
> Change-Id: I37571ebcc383ba9eb21bc20c60c734e3ca317582
> Reviewed-on: https://skia-review.googlesource.com/15311
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>
> 

TBR=halcanary@google.com,bungeman@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I84c7d53df566aaf83427e3368edaa02b7b5a9cb8
Reviewed-on: https://skia-review.googlesource.com/15319
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-05-04 18:20:45 +00:00
Hal Canary
cef018896e SkTypeface::getAdvancedMetrics(): cleanup
- SkAdvancedTypefaceMetrics is a struct not a class
  - SkTypeface::PerGlyphInfo is gone
  - s/getAdvancedTypefaceMetrics/getAdvancedMetrics/g
  - s/onGetAdvancedTypefaceMetrics/onGetAdvancedMetrics/g
  - [on]getAdvancedMetrics now return unique_ptr rather than bare ptr.
  - [on]getAdvancedMetrics no longer has parameters. (Only caller always
    used same arguments.)
  - SkAdvancedTypefaceMetrics uses C++11 in-class member initializers.
  - SkAdvancedTypefaceMetrics no longer inherits from SkRefCnt

Change-Id: I37571ebcc383ba9eb21bc20c60c734e3ca317582
Reviewed-on: https://skia-review.googlesource.com/15311
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-05-04 16:57:43 +00:00
bungeman
7575bb1c38 SkFontMgr::matchFamily should not crash on nullptr.
While all systems can resolve a font from just a style request
(without a name) almost no systems specify a default font family.

BUG=skia:6574

Change-Id: If7c81808b62cd5d8212bce2eb4d9c476c45af80a
Reviewed-on: https://skia-review.googlesource.com/14902
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-05-01 18:13:02 +00:00
Ben Wagner
fc497343cb Add SkTypeface::getVariationDesignPosition.
Allow users to query a typeface's position in variation design space.

Change-Id: Id7cae439e795b8c9586394f11359fb7fe55e1c0b
Reviewed-on: https://skia-review.googlesource.com/8861
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-02-24 16:59:05 +00:00
Ben Wagner
97043299cb Revert "Add SkTypeface::getVariationDesignPosition."
This reverts commit 0f3d0c37db.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Add SkTypeface::getVariationDesignPosition.
> 
> Allow users to query a typeface's position in variation design space.
> 
> Change-Id: I173ee9eefdddee6b2613435ebcc6b08c25b382ed
> Reviewed-on: https://skia-review.googlesource.com/8684
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> 

TBR=bungeman@google.com,reed@google.com,reviews@skia.org,drott@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I484fe52c1f89e7b6d0024dcabf7c59d0e8b5b5e7
Reviewed-on: https://skia-review.googlesource.com/8929
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-02-23 20:48:53 +00:00
bungeman
0f3d0c37db Add SkTypeface::getVariationDesignPosition.
Allow users to query a typeface's position in variation design space.

Change-Id: I173ee9eefdddee6b2613435ebcc6b08c25b382ed
Reviewed-on: https://skia-review.googlesource.com/8684
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-02-23 18:41:57 +00:00
Ben Wagner
7d07d46638 Revert "Add SkTypeface::getVariationDesignPosition."
This reverts commit 87e7f820f7.

Reason for revert: Failed a test on Mac

Original change's description:
> Add SkTypeface::getVariationDesignPosition.
> 
> Allow users to query a typeface's position in variation design space.
> 
> Change-Id: I5d80c8ff658708a5d1aa386ec5b7396dcb621198
> Reviewed-on: https://skia-review.googlesource.com/7130
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> 

TBR=bungeman@google.com,reed@google.com,reviews@skia.org,drott@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ia65792083642dbe9333a62eb75d162931b57cffd
Reviewed-on: https://skia-review.googlesource.com/8670
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-02-17 18:39:09 +00:00
Ben Wagner
87e7f820f7 Add SkTypeface::getVariationDesignPosition.
Allow users to query a typeface's position in variation design space.

Change-Id: I5d80c8ff658708a5d1aa386ec5b7396dcb621198
Reviewed-on: https://skia-review.googlesource.com/7130
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-02-17 18:05:47 +00:00
Hal Canary
342b7acc46 tests: s/SkAutoTUnref/sk_sp/
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4394

Change-Id: I088b3c6e2adff07abed1e8a50091cc0ec4a4109c
Reviewed-on: https://skia-review.googlesource.com/4394
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2016-11-04 16:55:38 +00:00
Mike Klein
6ad9909fb7 Turn on -Wrange-loop-analysis.
-Wrange-loop-analysis triggers when we use a new-style for loop in a way that appears to unintentionally call a copy constructor on each non-trivial loop element instead of operating on them by reference.


BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4000

Change-Id: If9e1b7fcc1f2789ae03c41c17abb17e60d564a8b
Reviewed-on: https://skia-review.googlesource.com/4000
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-10-26 15:57:09 +00:00
Mike Klein
fc6c37b981 Remove stray semicolons.
Turns out function declarations don't end in semicolons...

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2720

No public API changes.
TBR=reed@google.com

Change-Id: I72b56d52e1ff7fa6e89c295b0de8c46599791ebb
Reviewed-on: https://skia-review.googlesource.com/2720
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-09-27 14:04:26 +00:00
bungeman
e3aea10428 Remove user specified typeface id.
Now that there may be multiple font managers in a process the typeface
ids must be unique across all typefaces, not just unique within a font
manager. If two typefaces have the same id there will be issues in the
glyph cache. All existing font managers were already doing this by
calling SkFontCache::NewFontID, so centralize this in SkTypeface.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2147733002

Review-Url: https://codereview.chromium.org/2147733002
2016-07-13 05:16:58 -07:00
mboc
ee6a9919a3 SkTypeface::MakeFromName to take SkFontStyle.
SkTypeface::MakeFromName currently takes SkTypeface::Style,
which is quite limited. This starts the transition to this
function taking SkFontStyle instead.

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1818043002

TBR=reed
He said it sounded like a good idea.

Review-Url: https://codereview.chromium.org/1818043002
2016-05-31 11:42:37 -07:00
bungeman
13b9c95295 Move SkTypeface to sk_sp.
Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1933393002

Review-Url: https://codereview.chromium.org/1933393002
2016-05-12 10:09:31 -07:00
scroggo
9a9a7b29e5 Revert of Move SkTypeface to sk_sp. (patchset #5 id:80001 of https://codereview.chromium.org/1933393002/ )
Reason for revert:
fontmgr_iterAndroid failing to draw emoji. E.g. https://gold.skia.org/search2?blame=6296da736fbf40aae881650c239420f64e576c3f&unt=true&head=true&query=source_type%3Dgm

Original issue's description:
> Move SkTypeface to sk_sp.
>
> Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f

TBR=reed@google.com,fmalita@chromium.org,tomhudson@google.com,bungeman@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1974783002
2016-05-12 06:22:30 -07:00
bungeman
6296da736f Move SkTypeface to sk_sp.
Review-Url: https://codereview.chromium.org/1933393002
2016-05-11 12:38:18 -07:00
bungeman
b4bb7d8255 Add oblique as a slant.
Some fonts have italic and oblique in the same family, see

http://lucidafonts.com/fonts/family/lucida-sans
http://www.gust.org.pl/projects/e-foundry/latin-modern

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1921903002

Chromium side change at https://crrev.com/1921503006/ .

Review-Url: https://codereview.chromium.org/1921903002
2016-04-27 10:21:05 -07:00
reed
a9322c2d86 Revert "Revert of Pass effects directly to fontcache (patchset #8 id:140001 of https://codereview.chromium.org/1863013003/ )"
add SK_SUPPORT_NEW_ONCREATESCALERCONTEXT for chrome

this has now landed https://codereview.chromium.org/1878913002/
TBR=

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1880873002

Review URL: https://codereview.chromium.org/1880873002
2016-04-12 06:47:05 -07:00
borenet
25e0a0416e Revert of Pass effects directly to fontcache (patchset #8 id:140001 of https://codereview.chromium.org/1863013003/ )
Reason for revert:
Seems to have broken the DEPS roll.

Original issue's description:
> Pass effects directly to fontcache
>
> BUG=skia:5176
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1863013003
>
> Committed: https://skia.googlesource.com/skia/+/c79172857c3f69cc46837e1beeae0c1ead377bb2

TBR=djsollen@google.com,bungeman@google.com,mtklein@google.com,fmalita@chromium.org,msarett@google.com,reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:5176

Review URL: https://codereview.chromium.org/1872253004
2016-04-11 10:25:28 -07:00
reed
c79172857c Pass effects directly to fontcache
BUG=skia:5176
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1863013003

Review URL: https://codereview.chromium.org/1863013003
2016-04-11 07:51:07 -07:00
bungeman
147ea2fb7a Factor CSS3 matching rules.
This factors out the CSS3 matching rules, creates tests for it,
and uses it with the GDI font manager.

BUG=chromium:554238,skia:4037

TBR=reed@google.com
No public API changes.

Review URL: https://codereview.chromium.org/1438113002
2015-11-12 09:50:08 -08:00
halcanary
96fcdcc219 Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
2015-08-27 07:41:16 -07:00
bsalomon
49f085dddf "NULL !=" = NULL
R=reed@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/544233002
2014-09-05 13:34:00 -07:00
skia.committer@gmail.com
e1d9443758 Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@14102 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-09 03:04:11 +00:00
reed@google.com
43c27586e8 WIP -- SkFont
BUG=skia:
R=bungeman@google.com, fmalita@chromium.org

Review URL: https://codereview.chromium.org/185293018

git-svn-id: http://skia.googlecode.com/svn/trunk@14090 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-08 15:04:29 +00:00
commit-bot@chromium.org
0b98f67b90 Fix FontMgrTest to allow for unnamed fonts.
Motivation: we are testing on a system without fonts and are falling
back on SkTypeface_Empty.

R=bungeman@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/187933002

git-svn-id: http://skia.googlecode.com/svn/trunk@13675 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-05 19:41:10 +00:00
tfarina@chromium.org
8f6884aab8 Cleanup: Sanitize the order of includes under tests/
Initially this was to make sure Test.h appeared after the Sk*.h includes.

Patch generated by the following command line:

$ ~/chromium/src/tools/sort-headers.py tests/*.cpp

BUG=None
TEST=tests
R=robertphillips@google.com

Review URL: https://codereview.chromium.org/145313004

git-svn-id: http://skia.googlecode.com/svn/trunk@13177 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-01-24 20:56:26 +00:00
commit-bot@chromium.org
e2eac8b2fd Move macros from TestClassDef.h to Test.h
Motivation: those macros don't make any sense without the definitions
in Test.h.

BUG=
R=mtklein@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/138563004

git-svn-id: http://skia.googlecode.com/svn/trunk@13074 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-01-14 21:04:37 +00:00
tfarina@chromium.org
e4fafb146e Use DEFINE_TESTCLASS_SHORT macro in tests.
The three version of DEFINE_TESTCLASS macro is deprecated and thus just
use the simple, short one.

BUG=None
TEST=out/Debug/tests
R=mtklein@google.com, bsalomon@google.com, robertphillips@google.com

Review URL: https://codereview.chromium.org/100113004

git-svn-id: http://skia.googlecode.com/svn/trunk@12653 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-12-12 21:11:12 +00:00
skia.committer@gmail.com
f91e3d4f54 Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@11411 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-20 07:01:33 +00:00
reed@google.com
c1a81ebec5 expand alias fontname test
BUG=
R=bungeman@google.com

Review URL: https://codereview.chromium.org/24198004

git-svn-id: http://skia.googlecode.com/svn/trunk@11393 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-19 18:06:03 +00:00
djsollen@google.com
e2fd2d2651 fix build warning for unused function
R=robertphillips@google.com

Review URL: https://codereview.chromium.org/24240008

git-svn-id: http://skia.googlecode.com/svn/trunk@11382 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-19 14:40:42 +00:00
djsollen@google.com
2397c06ffb Disable broken test on Android
R=caryclark@google.com

Review URL: https://codereview.chromium.org/23484057

git-svn-id: http://skia.googlecode.com/svn/trunk@11380 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-19 12:55:26 +00:00
skia.committer@gmail.com
2262c58802 Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@11375 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-19 07:25:55 +00:00
reed@google.com
d44d988127 fix fontconfig backend to only cache new fonts if their outName was unique
BUG=
R=bungeman@google.com

Review URL: https://codereview.chromium.org/23710072

git-svn-id: http://skia.googlecode.com/svn/trunk@11364 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-18 20:32:25 +00:00
bungeman@google.com
7103344b64 Add FontMgr to DirectWrite.
https://codereview.chromium.org/14314008/


git-svn-id: http://skia.googlecode.com/svn/trunk@8934 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-05-01 14:21:20 +00:00
reed@google.com
eb02957a5f disable checking the style name from fontmgr (not impl on some backends,
and likely will be remvoed in future api)



git-svn-id: http://skia.googlecode.com/svn/trunk@8858 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-25 14:59:32 +00:00
reed@google.com
c1ccda3af8 return empty fontstyleset instead of null
git-svn-id: http://skia.googlecode.com/svn/trunk@8767 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-19 14:28:54 +00:00
reed@google.com
66c9f9995e short names should be ... short, in commandlineflags
git-svn-id: http://skia.googlecode.com/svn/trunk@8629 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-11 19:04:34 +00:00
reed@google.com
83165a5f71 add fontmgr tests, and optional --verboseFontMgr flag (or -vfm) for more output
git-svn-id: http://skia.googlecode.com/svn/trunk@8626 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-11 18:31:25 +00:00