Commit Graph

5135 Commits

Author SHA1 Message Date
Mike Reed
dca2e91afa add fontmetrics to SkFont
Bug: skia:2664
Change-Id: I49030b6010e08814ec50c75dd26b44a5265d74bd
Reviewed-on: https://skia-review.googlesource.com/c/167461
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-10 13:28:04 +00:00
Mike Reed
d7a4bea20a Revert "rm legacy flags for hinting enum"
This reverts commit 5cd242b4fc.

Reason for revert: breaking google3

Original change's description:
> rm legacy flags for hinting enum
> 
> Bug: skia:
> Change-Id: I56ad33fa30aa8cec8a60cd70d4e4767defb923ca
> Reviewed-on: https://skia-review.googlesource.com/c/170105
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: Iffa9b20d77455b4554aae132268af8a0cf252496
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/170270
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-09 21:59:17 +00:00
Cary Clark
777eede780 fix bookmaker
Remove references to old SkPaint::Hinting.

Also fix bug recently introduced that made
unlinkable words use the last link found.

TBR=reed@google.com

Docs-Preview: https://skia.org/?cl=170266
Bug: skia:
Change-Id: I8b83bcb479bd3f79699a1c74818a817190fd42a5
Reviewed-on: https://skia-review.googlesource.com/c/170266
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-11-09 21:33:54 +00:00
Mike Reed
5cd242b4fc rm legacy flags for hinting enum
Bug: skia:
Change-Id: I56ad33fa30aa8cec8a60cd70d4e4767defb923ca
Reviewed-on: https://skia-review.googlesource.com/c/170105
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-09 20:11:37 +00:00
Nathan Rogers
c03ad1714b Fix another typo in SkSize comments
Didn't notice that this was on both SkISize and SkSize the first time
around.

Change-Id: I20d7da0f653aeb4810ab67c9991646b16670497a
Reviewed-on: https://skia-review.googlesource.com/c/169889
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-09 14:49:34 +00:00
Cary Clark
885f10787b fix bookmaker
more strict bookmaker rules are now in effect;
all methods require documentation, and all documentation
is checked for accuracy.

In this case, the multiple temporary copies of SkPaint::getHinting
and SkPaint::setHinting are checked.

In an upcoming change, bookmaker will ignore symbols marked
as deprecated, experimental, or private; making this bookmaker's
strictness a little more palatable.

TBR=reed@google.com

Docs-Preview: https://skia.org/?cl=169822
Bug: skia:
Change-Id: If1bc079a13828a5ca435911338b9c75acbe8ad6f
Reviewed-on: https://skia-review.googlesource.com/c/169822
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-11-08 19:02:39 +00:00
Mike Reed
9edbf42e75 Revert[4] "hide nested hinting enum"
This reverts commit 8e12cc6dfe.

Bug: skia:
Change-Id: Ice5e3480adad75ab77d97f7366495015f36b15a6
Reviewed-on: https://skia-review.googlesource.com/c/169520
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-08 16:33:04 +00:00
Cary Clark
77b3f3aeee Check every word in docs
This enables checking all text to see if it
either represents a valid reference or is a
word in docs/spelling.txt . Expressions are
checked for validity as well.

There are a few shortcuts (marked with TODO):
- typedefs aren't resolved, so cheats are
added for SkVector and SkIVector.
- operator overload detection is incomplete
- constructor detection is incomplete
- formula definitions aren't detected

Found and fixed a bunch of spelling, usage,
and incorrect or obsolete references.

A few comment changes are needed in
include/core to get this to work, mostly
centered around recent SkPaint/SkFont edits.

TBR=reed@google.com
Docs-Preview: https://skia.org/?cl=167541
Bug: skia:
Change-Id: I2e0d5990105c5a8482b0c0d3e50fd0b330996dd6
Reviewed-on: https://skia-review.googlesource.com/c/167541
Reviewed-by: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-11-08 13:27:57 +00:00
Mike Klein
8e12cc6dfe Reland "Revert "hide nested hinting enum""
This reverts commit f49563bf92.

Reason for revert: Google3 also.

Original change's description:
> Revert "Revert "hide nested hinting enum""
> 
> This reverts commit 6bd19df9fa.
> 
> Restores original CL, but adds guards for flutter.
> 
> Bug: skia:
> Change-Id: I380b4ea87d293355026d734249aa2b8c397da144
> Reviewed-on: https://skia-review.googlesource.com/c/169345
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I26a07555df56ce92e86b114ecf4ab64643e71ed1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/169441
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-07 23:56:24 +00:00
Mike Reed
f49563bf92 Revert "Revert "hide nested hinting enum""
This reverts commit 6bd19df9fa.

Restores original CL, but adds guards for flutter.

Bug: skia:
Change-Id: I380b4ea87d293355026d734249aa2b8c397da144
Reviewed-on: https://skia-review.googlesource.com/c/169345
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-11-07 22:47:53 +00:00
Mike Reed
6bd19df9fa Revert "hide nested hinting enum"
This reverts commit fbebecee0e.

Reason for revert: need staging guard for flutter

Original change's description:
> hide nested hinting enum
> 
> Bug: skia:2664
> Bug: skia:8527
> Change-Id: I8f4b832d5524fb792bcc608d6bd515229881b048
> Reviewed-on: https://skia-review.googlesource.com/c/168270
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I19496daa059932574f36ac47061068a81d5524c3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:2664, skia:8527
Reviewed-on: https://skia-review.googlesource.com/c/169344
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-07 22:06:01 +00:00
Mike Reed
fbebecee0e hide nested hinting enum
Bug: skia:2664
Bug: skia:8527
Change-Id: I8f4b832d5524fb792bcc608d6bd515229881b048
Reviewed-on: https://skia-review.googlesource.com/c/168270
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-11-07 21:42:28 +00:00
Mike Reed
d7f6b72d85 transition to enum class for SkFontHinting
Bug: skia:8527
Change-Id: I8c1f2b9d97b51ca577c2e912c6cb048f5b6e2dc4
Reviewed-on: https://skia-review.googlesource.com/c/168760
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-11-07 17:07:26 +00:00
Mike Klein
d282860c94 get rid of SkScalarDiv
It looks like it's possible to divide by zero safely in the one place
it's used, so I've replaced it with sk_ieee_float_divide().

Change-Id: I3ebfa697869bc7d4da61b6fc5711421a833c9081
Reviewed-on: https://skia-review.googlesource.com/c/169080
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-11-07 14:15:09 +00:00
Cary Clark
7e69c8f348 fix paint docs
quick and dirty edit to get the bots green.
Larger edit is in the works to bring docs
related to these changes up to date.

TBR=reed@google.com

Docs-Preview: https://skia.org/?cl=168923
Bug: skia:
Change-Id: I38af409e75e46439288e94de2758b34094d0e08f
Reviewed-on: https://skia-review.googlesource.com/c/168923
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-11-07 02:10:01 +00:00
Mike Klein
d3ed301a36 remove SkScalarFastInvert
Its implementation is just 1/x,
and looks like we never expect x == 0.

Change-Id: I405a3bd02b04d9ac0b13cea17573e32fc80ac0b2
Reviewed-on: https://skia-review.googlesource.com/c/168920
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-07 01:06:30 +00:00
Mike Klein
a4c277b07f make float divide-by-zero fatal
Change-Id: I9ba1caa4862bdf9ffc9c0e637bd69cce91fd8468
Reviewed-on: https://skia-review.googlesource.com/c/168740
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-06 21:56:27 +00:00
Leon Scroggins III
e5eb1a5904 Remove SkBitmap::[setH/h]asHardwareMipMap
These are no longer used by Android.

Change-Id: Ie3b9aa60af681f9e076a0d0680fc716ae51f9cd8
Reviewed-on: https://skia-review.googlesource.com/c/168486
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-11-06 21:44:01 +00:00
Mike Reed
cb6f53efbc split out fontmetrics into its own struct
Future CLs will migrate all callers to use SkFontMetrics,
so we can remove the SkPaint typedef.

Next migrate the world to use SkFont::getMetrics() instead

Bug: skia:2664
Change-Id: I2aa45cd88762c3d3589c12f5074974af7fb85410
Reviewed-on: https://skia-review.googlesource.com/c/168641
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-06 18:16:48 +00:00
Mike Klein
3674336c33 Reland "make enum santizer fatal"
This is a reland of 166dbd3135

Since last attempt,
   - update SkPath::Direction docs
   - kIllegal is not an advanced blend mode

Original change's description:
> make enum santizer fatal
>
> This enum sanitizer checks that all the values of the enum we use fall
> within the range of the enumerated values.
>
> The main thing this helps point out is that the size of enum types in
> C++ need only be large enough to hold the largest declared value; larger
> values are undefined.  In practice, most enums are implemented as ints
> for compatibility with C, so while this hasn't pointed out anything
> egregiously broken, the sanitizer has found a couple possibly dangerous
> situations in our codebase.
>
> For most types using values outside the enum range, we can just
> explicitly size them to int.  This makes their de facto size de jure.
>
> But we need to actually make GrBlendEquation and GrBlendCoeff not store
> values outside their enumerated range.  They're packed into bitfields
> that really can't represent those (negative) values.  So for these I've
> added new kIllegal values to the enums, forcing us to deal with our
> once-silent illegal values a bit more explicitly.
>
> Change-Id: Ib617694cf1aaa83ae99289e9e760f49cb6393a2f
> Reviewed-on: https://skia-review.googlesource.com/c/168484
> Reviewed-by: Brian Osman <brianosman@google.com>

Cq-Include-Trybots: skia.primary:Housekeeper-PerCommit-Bookmaker,Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Debug-All-Android
Change-Id: Id93b80bbeae11872542c9b76715e3c3cb10609fd
Reviewed-on: https://skia-review.googlesource.com/c/168582
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-06 17:31:00 +00:00
Mike Klein
f2b35e4fb8 Revert "make enum santizer fatal"
This reverts commit 166dbd3135.

Reason for revert: illegal is not advanced, docs

Original change's description:
> make enum santizer fatal
> 
> This enum sanitizer checks that all the values of the enum we use fall
> within the range of the enumerated values.
> 
> The main thing this helps point out is that the size of enum types in
> C++ need only be large enough to hold the largest declared value; larger
> values are undefined.  In practice, most enums are implemented as ints
> for compatibility with C, so while this hasn't pointed out anything
> egregiously broken, the sanitizer has found a couple possibly dangerous
> situations in our codebase.
> 
> For most types using values outside the enum range, we can just
> explicitly size them to int.  This makes their de facto size de jure.
> 
> But we need to actually make GrBlendEquation and GrBlendCoeff not store
> values outside their enumerated range.  They're packed into bitfields
> that really can't represent those (negative) values.  So for these I've
> added new kIllegal values to the enums, forcing us to deal with our
> once-silent illegal values a bit more explicitly.
> 
> Change-Id: Ib617694cf1aaa83ae99289e9e760f49cb6393a2f
> Reviewed-on: https://skia-review.googlesource.com/c/168484
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=mtklein@chromium.org,mtklein@google.com,brianosman@google.com

Change-Id: I691c08092340a6273e442c0f098b844f7d0363ba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/168581
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-06 16:30:19 +00:00
Mike Reed
4529cb56e0 change MakeRecAndEffects to take SkFont
Bug: skia:
Change-Id: I35be940a27e917b18f698addeb8827cb0216f067
Reviewed-on: https://skia-review.googlesource.com/c/168277
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-06 16:16:32 +00:00
Hal Canary
7a305a2ef7 Enums: specify base
Change-Id: I540435869bfd22b47eaa4f2f1471654c53707ea1
Reviewed-on: https://skia-review.googlesource.com/c/168279
Commit-Queue: Cary Clark <caryclark@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-11-06 15:47:19 +00:00
Mike Klein
166dbd3135 make enum santizer fatal
This enum sanitizer checks that all the values of the enum we use fall
within the range of the enumerated values.

The main thing this helps point out is that the size of enum types in
C++ need only be large enough to hold the largest declared value; larger
values are undefined.  In practice, most enums are implemented as ints
for compatibility with C, so while this hasn't pointed out anything
egregiously broken, the sanitizer has found a couple possibly dangerous
situations in our codebase.

For most types using values outside the enum range, we can just
explicitly size them to int.  This makes their de facto size de jure.

But we need to actually make GrBlendEquation and GrBlendCoeff not store
values outside their enumerated range.  They're packed into bitfields
that really can't represent those (negative) values.  So for these I've
added new kIllegal values to the enums, forcing us to deal with our
once-silent illegal values a bit more explicitly.

Change-Id: Ib617694cf1aaa83ae99289e9e760f49cb6393a2f
Reviewed-on: https://skia-review.googlesource.com/c/168484
Reviewed-by: Brian Osman <brianosman@google.com>
2018-11-06 15:39:50 +00:00
Cary Clark
11407e56f2 fix paint docs
fix bookmaker build for setHinting

TBR=reed@google.com

Bug: skia:
Change-Id: Ieade1bca4cd369eb5a9431796c83e039ae69e81c
Reviewed-on: https://skia-review.googlesource.com/c/168480
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
2018-11-06 03:06:20 +00:00
Mike Reed
d9b16dfe71 add alternative setters for hinting
Bug: skia:2664
Change-Id: I77248d9012e44d6ed5de92731fb0769c61fd7298
Reviewed-on: https://skia-review.googlesource.com/c/168278
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-05 22:16:36 +00:00
Mike Reed
04346d538f use SkFontHinting from SkFontTypes.h
Bug: skia:2664
Change-Id: Id10cd5efe79681411ce556874fd89ca7624909f7
Reviewed-on: https://skia-review.googlesource.com/c/168267
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-05 18:16:32 +00:00
Mike Reed
0909331d95 add SkFontTypes.h
Bug: skia:
Change-Id: I4506066ae2d22885164c0680a293a2a8f9cd32c8
Reviewed-on: https://skia-review.googlesource.com/c/168262
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-05 15:38:48 +00:00
Mike Reed
16d91aaf44 remove empty devKern from SkPaint
Bug: skia:
Change-Id: I59f1bc11324755b536f93c83180c9b92e799c50d
Reviewed-on: https://skia-review.googlesource.com/c/168024
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-11-04 14:44:24 +00:00
Mike Reed
1edff303fd SkPaint::Align is dead
Bug: skia:8493
Change-Id: I272de164a4cfc630972294152d3fb10e1d4bd702
Reviewed-on: https://skia-review.googlesource.com/c/167944
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-02 21:48:27 +00:00
Herb Derby
6113a41aed Make special SkRunFont ctor in SkPaint private again
Change-Id: I0c68f7417666e86ae3762777d6b7238f0bdb3afb
Reviewed-on: https://skia-review.googlesource.com/c/167923
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-11-02 21:06:50 +00:00
Jim Van Verth
18b950a527 Add SK_API to SkYUVASizeInfo def
Bug: skia:7903
Change-Id: I98a3133384d9ddb9cbc17da85fc175dc5ad559f2
Reviewed-on: https://skia-review.googlesource.com/c/167940
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-11-02 20:03:32 +00:00
Herb Derby
9bb6b7e1a2 Remove mutablePaint from glyphRuns
This call confuses future paint changes.

Change-Id: Ie4c37f4c74d999c212992252bb65d06cd259c647
Reviewed-on: https://skia-review.googlesource.com/c/167687
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-11-02 19:03:25 +00:00
Mike Klein
ef1c83a0c5 make big-endian very opt-in
Change-Id: I578d064660cb20b834b80898ddc18e2f36394f11
Reviewed-on: https://skia-review.googlesource.com/c/167685
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-02 18:04:49 +00:00
Brian Osman
1a8e6aba48 Remove SkUnPreMultiply::UnPreMultiplyPreservingByteOrder
Also remove the second, bespoke implementation in displacement
map effect.

Bug: skia:
Change-Id: I7363673337caba73c1311fe3cef4385dd7d1804e
Reviewed-on: https://skia-review.googlesource.com/c/167840
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-11-02 17:46:26 +00:00
Florin Malita
d6db27cfd2 Observe SkFont::textToGlyphs() maxGlyphCount
Change-Id: Ic0f8738a2edf0592aa45333e5fab1f2b09c21fc1
Reviewed-on: https://skia-review.googlesource.com/c/167542
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-11-02 17:22:17 +00:00
Cary Clark
d029c0e837 remove color 16 implementation out of public
Make the public include/core/SkColorPriv.h a little smaller
and internal src/core/SkColorData.h a little larger.

R=brianosman@google.com
TBR=reed@google.com

Bug: skia:
Change-Id: Ic51b1c397f0c6ed5383f9c054c7b4f83b7b3c308
Reviewed-on: https://skia-review.googlesource.com/c/167721
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-11-02 15:29:01 +00:00
Mike Klein
6a2a1f6c0f move SkICC::WriteToICC out of line
Change-Id: I03760e49437b82bc8faf76fa42ce876d618bf516
Reviewed-on: https://skia-review.googlesource.com/c/167680
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-11-02 15:17:35 +00:00
Mike Reed
67510d3a7d remove (unused and weird) zoom parameter on getFontMetrics
Bug: skia:
Change-Id: I17d1d79da7518aaa37daf22768f1b2624bd59bcf
Reviewed-on: https://skia-review.googlesource.com/c/167540
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-02 00:48:07 +00:00
Brian Osman
6d546b5cd1 Simplify PMColor preprocessor logic, move it all into SkColorPriv.h
This was spread across SkColorPriv.h and SkColorData.h, and was
accomodating fictional users that set SK_PMCOLOR_IS_* themselves.

Also, remove an unused define and stop grilling colors.

Bug: skia:
Change-Id: I70efd51052f32afdc3e19fd55dd38270d98b6b76
Reviewed-on: https://skia-review.googlesource.com/c/167392
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-11-01 18:14:20 +00:00
Mike Klein
ff0e8409e1 clean up some odd SkRefCnt features
SkRefCntBase is an implementation detail of SkRefCnt, so let's not
mention it in SkContext_Compute.h.  While I'm here, I notice SkNVRefCnt
would work fine too.

No one else calls internal_dispose_restore_refcnt_to_1(), so we can
inline it.  While here, I notice it's resetting the ref count to 1 even
in release builds.  I'm not sure if that is/can be optimized away, but
in any case I think we can wrap with #ifdef SK_DEBUG, if only to make it
clear that it's only there to support the assert in the destructor.

I've removed validate().  Most of the places it's called read pretty
weird, and I think suggest some sort of class-specific validation than
just checking that we're holding a ref.  SkWeakRefCnt::validate() isn't
called anywhere.

There were few users of getRefCnt() outside SkRefCnt itself, so I
removed the rest and made it private.

I've added a few this-> to self calls while at it.

Change-Id: I98be06677a6e8b8e66f44cbb17d14e38b0f39d38
Reviewed-on: https://skia-review.googlesource.com/c/167160
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-10-31 20:47:16 +00:00
Brian Osman
d5ea99871c Remove SkRGBA4f pinning functions
Bug: skia:
Change-Id: I48ba39465a160e73502ee38d90062d955da6e8e6
Reviewed-on: https://skia-review.googlesource.com/c/167140
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-31 20:32:28 +00:00
Cary Clark
82456498d8 give include comments the once over
In preparation for upcoming changes to bookmaker
which validate more include contents, revise
generated files in include/core to fix various
errors.

Fixes include:
- references in comments to other Skia interface elements
- @param names agree with function declarations
- spelling typos
- generic references (e.g. 'x' in place of 'x-axis')
- lines longer than 100 columns

The fix to SkPath::rCubicTo triggered a parallel
fix to SkPath_Reference.bmh; other wed documentation
fixes will be in an upcoming CL.

TBR=reed@google.com

Docs-Preview: https://skia.org/?cl=166680
Bug: skia:
Change-Id: If734696dc64655f1cf40b121a180210c932b1d89
Reviewed-on: https://skia-review.googlesource.com/c/166680
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-10-31 15:37:37 +00:00
Mike Reed
73329c8df9 remove alignenum flag -- rely on clients to add it as needed
Bug: skia:
Change-Id: Ic4ee895c3d04c7d22aee026859f84c65e1252505
Reviewed-on: https://skia-review.googlesource.com/c/166563
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-10-31 14:21:51 +00:00
Jim Van Verth
9bf8120cab More YUV cleanup
* Remove more uses of colortype
* Add back SkImage_GpuYUVA::MakeFromYUVATextures

Bug: skia:7903
Change-Id: I3ee119d190db39c128516dbb78db34fe29ba3cce
Reviewed-on: https://skia-review.googlesource.com/c/165943
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-10-30 21:11:54 +00:00
Mike Reed
3a42ec0ee7 hide the SkPaint::Align enum entirely
Bug: skia:2664
Change-Id: I080b015dbcb3a3cd73bb6847f3243a996d5f7b7d
Reviewed-on: https://skia-review.googlesource.com/c/166282
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-10-30 17:26:47 +00:00
Mike Klein
408ef21c79 Revert "replace SkNVRefCnt with SkRefCnt"
This reverts commit 0fb1ee98cf.

Reason for revert: looks like this increased size by ~8K.

Original change's description:
> replace SkNVRefCnt with SkRefCnt
> 
> SkNVRefCnt trades a small amount of code size (vtable) and runtime
> (vptr) memory usage for a larger amount of code size (templating).  It
> was written back in a time when all we were really thinking about was
> runtime memory usage, so I'm curious to see where performance, code
> size, and memory usage all move if it's removed.
> 
> Looking at the types I've changed here, my guess is that performance and
> memory usage will be basically unchanged, and that code size will drop a
> bit.  Nothing else it's nicer to have only one ref-counting base class.
> 
> Change-Id: I7d56a2b9e2b9fb000ff97792159ea1ff4f5e6f13
> Reviewed-on: https://skia-review.googlesource.com/c/166203
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,bsalomon@google.com,mtklein@chromium.org

Change-Id: Ibcfcc4b523c466a535bea5ffa30d0fe2574c5bd7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/166360
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-30 15:23:06 +00:00
Jim Van Verth
e24b587a00 Replace use of SkYUVSizeInfo with SkYUVASizeInfo
Bug: skia:7903
Change-Id: If5acd50711ed8bd4a49efcb93db66fd3d14c8992
Reviewed-on: https://skia-review.googlesource.com/c/164681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-10-30 15:00:34 +00:00
Mike Klein
0fb1ee98cf replace SkNVRefCnt with SkRefCnt
SkNVRefCnt trades a small amount of code size (vtable) and runtime
(vptr) memory usage for a larger amount of code size (templating).  It
was written back in a time when all we were really thinking about was
runtime memory usage, so I'm curious to see where performance, code
size, and memory usage all move if it's removed.

Looking at the types I've changed here, my guess is that performance and
memory usage will be basically unchanged, and that code size will drop a
bit.  Nothing else it's nicer to have only one ref-counting base class.

Change-Id: I7d56a2b9e2b9fb000ff97792159ea1ff4f5e6f13
Reviewed-on: https://skia-review.googlesource.com/c/166203
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-30 13:26:12 +00:00
Mike Reed
97047b18eb declare SkFont SK_API
Bug: skia:
Change-Id: I83c5d6aabcb56338b76a5a4e6bba8685e90a83b4
Reviewed-on: https://skia-review.googlesource.com/c/166202
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-30 12:24:27 +00:00