Commit Graph

8716 Commits

Author SHA1 Message Date
Ben Wagner
d89e811684 SkImageGeneratorCG.h to only expose factory method.
Instead of requiring the implementation details of the SkImageGenerator
which backs the CG image generator to be present in the header, move the
class into the implementation and only expose the factory method.

Change-Id: I728276ffcfb6bb4e7302280459a79210e8d67475
Reviewed-on: https://skia-review.googlesource.com/155611
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2018-09-19 21:20:35 +00:00
Hal Canary
912cd3d2e4 SkImageGeneratorWIC: make the header compile without src/.
SkTScopedComPtr.h is located in src/utils/win/.

Change-Id: If2f3a28d7427e9a2e196272ce07f303de4d613ca
Reviewed-on: https://skia-review.googlesource.com/155562
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2018-09-19 20:31:47 +00:00
Brian Osman
a5c578ff3d Add Short4 vertex attributes, and benchmark them as 4.12 colors
This reverts commit 90d2d9381e.

Updated to use float in the shader (many ES2 implementations
don't support integral types as attributes).

Bug: skia:
Change-Id: I0898f1730da60ff03f8165b2f1a3ee18a7b2fec8
Reviewed-on: https://skia-review.googlesource.com/155162
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-19 18:56:49 +00:00
Hal Canary
c2d0fb17de include: whitespace changes for clang-format
Change-Id: I76ab59d963cebf6cbb450e1873c3e0c63f3f2da0
Reviewed-on: https://skia-review.googlesource.com/155560
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-09-19 14:54:57 +00:00
Hal Canary
27c8404d87 IWYU: three files
Change-Id: I7d4fefeafce06145818c607b28b30887a52acc74
Reviewed-on: https://skia-review.googlesource.com/155501
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-09-19 14:21:55 +00:00
Robert Phillips
0790f8a471 Fix DDL reattachment of uniquely keyed proxies
This fix has three parts:
   No longer clear all proxy unique keys in DDL mode
   Handle unique keys appropriately in lazy proxy instantiation
   Handle attaching to cached surfaces for non-lazy proxies

Change-Id: I86b0422a784acaf8c5f9b67cb981b440e08352de
Reviewed-on: https://skia-review.googlesource.com/154502
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-09-18 17:33:30 +00:00
Mike Klein
0191ed8e87 Make listener lists threadsafe with a mutex.
PS1 reverts commit 6c8d242b14.
PS2 uses an SkMutex for thread safety.

Change-Id: I9318f92cc028844b3dc5a99a00282c2762057895
Reviewed-on: https://skia-review.googlesource.com/155060
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-18 15:46:26 +00:00
Cary Clark
cdc371af3e fix bookmaker
add docs for new SkImage methods

Also, the tool slightly adjusted the spacing
for the include comments, and fixed a few references.

TBR=bsalomon@google.com

Docs-Preview: https://skia.org/?cl=155160
Bug: skia:
Change-Id: I7977ca3048bd7d0c23f84db19f62f7accdcd77bb
Reviewed-on: https://skia-review.googlesource.com/155160
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-09-18 11:58:35 +00:00
Brian Salomon
d2fcfb5813 WEBGL_video_texture : sharing texture prototype in skia
Bug: 776222

Change-Id: I84c81bdaa6dc0b5548f116a28c6319e601effb32
Reviewed-on: https://skia-review.googlesource.com/146695
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Kenneth Russell <kbr@google.com>
2018-09-18 02:22:00 +00:00
Herb Derby
6c8d242b14 Make atomic lists list for bitmaps and paths
Make the listner list for bitmas and paths use a simple atomic
stack. This stack implementation does not have the ABA problem
because you can only pop the entire stack at once
with exchange(nullptr).

BUG=skia:8324

Change-Id: I7b0438a42c473b36cd4b0cbf236bf1692c5afab3
Reviewed-on: https://skia-review.googlesource.com/154861
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-09-17 20:54:06 +00:00
Brian Osman
90d2d9381e Revert "Add Short4 vertex attributes, and benchmark them as 4.12 colors"
This reverts commit d2ca0473f6.

Reason for revert: Various bots failing.

Original change's description:
> Add Short4 vertex attributes, and benchmark them as 4.12 colors
> 
> This is likely our best widely portable option for encoding wide gamut
> colors that doesnt sacrifice too much performance. The benchmark uses
> them as we're likely to do: 4.12 fixed point, in the destination color
> space. We're using SINT vertex attributes for simplicity, so the encode
> and decode are simple multiply/divide by 4096.
> 
> Bug: skia:
> Change-Id: I9b544f3e187b775d81f83dc9dd44611570ad33c2
> Reviewed-on: https://skia-review.googlesource.com/155001
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=mtklein@google.com,bsalomon@google.com,brianosman@google.com

Change-Id: I921e29cf9a121c5752ec7d99a03470b5193afd4a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/154883
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-17 20:41:30 +00:00
Brian Osman
d2ca0473f6 Add Short4 vertex attributes, and benchmark them as 4.12 colors
This is likely our best widely portable option for encoding wide gamut
colors that doesnt sacrifice too much performance. The benchmark uses
them as we're likely to do: 4.12 fixed point, in the destination color
space. We're using SINT vertex attributes for simplicity, so the encode
and decode are simple multiply/divide by 4096.

Bug: skia:
Change-Id: I9b544f3e187b775d81f83dc9dd44611570ad33c2
Reviewed-on: https://skia-review.googlesource.com/155001
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-17 20:19:07 +00:00
Brian Osman
d4c29709ca Specify CPU (buffer) and GPU (shader) types explicitly in Attribute
The CPU type is still specified using GrVertexAttribType.
The GPU type is specified directly using GrSLType.

kHalfX_GrVertexAttribType now really means half-float buffer
data, rather than float. (Caveat: The GL enum is only correct
with ES3/GL3 - ES2+extension needs a different value. Sigh.)

Bug: skia:
Change-Id: Ife101db68a5d4ea1ddc2f6c60fbec0c66d725c16
Reviewed-on: https://skia-review.googlesource.com/154628
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-14 21:54:03 +00:00
Chris Dalton
b68bcc4398 ccpr: Remove the dangling pointer from GrCCDrawPathsOp
Actually takes a ref on fOwningPerOpListPaths, instead of just
asserting it continues to exist. Removes unnecessary asserts
surrounding dangling pointers.

Bug: skia:8359
Change-Id: Ie80da55510f320452bd9ee3a4b38bd59d48681a0
Reviewed-on: https://skia-review.googlesource.com/154684
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-09-14 16:32:58 +00:00
Cary Clark
9bb34b74f3 update generated includes
This fixes all comments in generated includes
to fit in 100 columns.

TBR=reed@google.com

Bug: skia:6898
Change-Id: I6d28a24d4e2d079e4a9284d4b2a25326dc5f2dc6
Reviewed-on: https://skia-review.googlesource.com/154440
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-09-13 19:03:00 +00:00
Stan Iliev
505dd57406 Add GrSurfaceOrigin to MakeFromAHardwareBuffer
Add support for kBottomLeft_GrSurfaceOrigin origin for SkImage
backed by an Android hardware buffer.

Bug: b/115610873
Change-Id: I8ba142007ee01c3fc2fd48317b29388d07a7b6e0
Reviewed-on: https://skia-review.googlesource.com/154301
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-09-13 18:43:25 +00:00
Cary Clark
dcec329d3b fix 100 column violators in generated includes
Several generated includes include code that exceeds the 100 column
limit. Fix the code that exceeds 100 columns here.
In a later CL, bookmaker will fix the comments that
exceed 100 columns.

TBR=reed@google.com

Bug: skia:6898
Change-Id: I8b44b01675e99c5750f3c89689f29bb709203ec2
Reviewed-on: https://skia-review.googlesource.com/154303
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
2018-09-13 16:00:54 +00:00
Mike Reed
5152c4acfb Reland "remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM"
This reverts commit b8e125281d.

Reason for revert: flutter has landed in fuchsia

Original change's description:
> Revert "remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM"
> 
> This reverts commit 558fabb31c.
> 
> Reason for revert: flutter hasnt rolled into fuschia so this breaks fuschia
> 
> Original change's description:
> > remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM
> > 
> > ... now that Brian updated Flutter's callsites
> > 
> > Bug: skia:8350
> > Change-Id: I5ae72700125e09d84392eee8045c9602f718909a
> > Reviewed-on: https://skia-review.googlesource.com/153901
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Auto-Submit: Mike Reed <reed@google.com>
> 
> TBR=brianosman@google.com,reed@google.com
> 
> Change-Id: I263e3c7694895ac85dc71a785832e7fb89dc81de
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8350
> Reviewed-on: https://skia-review.googlesource.com/154081
> Reviewed-by: Cary Clark <caryclark@skia.org>
> Commit-Queue: Cary Clark <caryclark@skia.org>

TBR=brianosman@google.com,reed@google.com,caryclark@skia.org

Change-Id: Iabf3c78c883275c0256b31bcde87d4cdc8eecbec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8350
Reviewed-on: https://skia-review.googlesource.com/154302
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-13 15:19:09 +00:00
Florin Malita
d661474866 Improved SkPath packing
sizeof(SkPath): 24 -> 16 (on 64bit)

Change-Id: Iea0d363b70209eb984c816f9fba59c461fe42cec
Reviewed-on: https://skia-review.googlesource.com/154041
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-12 19:39:40 +00:00
Cary Clark
b8e125281d Revert "remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM"
This reverts commit 558fabb31c.

Reason for revert: flutter hasnt rolled into fuschia so this breaks fuschia

Original change's description:
> remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM
> 
> ... now that Brian updated Flutter's callsites
> 
> Bug: skia:8350
> Change-Id: I5ae72700125e09d84392eee8045c9602f718909a
> Reviewed-on: https://skia-review.googlesource.com/153901
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

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

Change-Id: I263e3c7694895ac85dc71a785832e7fb89dc81de
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8350
Reviewed-on: https://skia-review.googlesource.com/154081
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-09-12 18:55:00 +00:00
Mike Reed
558fabb31c remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM
... now that Brian updated Flutter's callsites

Bug: skia:8350
Change-Id: I5ae72700125e09d84392eee8045c9602f718909a
Reviewed-on: https://skia-review.googlesource.com/153901
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-09-12 15:23:48 +00:00
Florin Malita
0e0f1a71da SkPath::shrinkToFit docs
Add header and .bmh docs for shrinkToFit().

Also remove SkPath::debugging_private_getFreeSpace() and refactor tests
to use (friended) helper classes.

Docs-Preview: https://skia.org/?cl=153668
Change-Id: I3f93f9561b25025ce04a81d5e2f0271295b3daad
Reviewed-on: https://skia-review.googlesource.com/153668
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-09-11 20:43:22 +00:00
Mike Klein
8f5a7a6f50 first start on a P3 GM
We don't have anything drawing colors outside sRGB,
but now that we've got SkPaint::setColor4f(), that's easy.

Looks like we have lots of work to do.

Pin GrColor4f floats before converting to unsigned.
Underflowing floats would get pinned to 255 spuriously
instead of to 0.  I think this fixes the failing CQ
bot, and the white square problem.

Change-Id: I866963ff026e6ab891b4c7d57decc43538000099
Reviewed-on: https://skia-review.googlesource.com/153640
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-11 19:17:06 +00:00
Florin Malita
3d413c5761 Reland: add SkPath::shrinkToFit
Original CL: https://skia-review.googlesource.com/c/skia/+/150967

  * expanded tests
  * fixed shared pathref copying

Change-Id: I4bfe89f597485aa2db68f58d99112188615faceb
Reviewed-on: https://skia-review.googlesource.com/153553
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
2018-09-11 18:33:00 +00:00
Herb Derby
3c4d533d8e Simplify plots to always be 512x512 and simplify GrDrawOpAtlasConfig
With less stressful tests.

Change-Id: I600cb728f6efca5aab87a16e71039a0ed00c47e1
Reviewed-on: https://skia-review.googlesource.com/153220
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-09-10 21:57:16 +00:00
Mike Reed
a21a16b5dd Revert "add SkPath::shrinkToFit"
This reverts commit 3d69be51bb.

Reason for revert: breaks on SAN builds

Original change's description:
> add SkPath::shrinkToFit
> 
> Bug: skia:
> Change-Id: Ief647bcea53c0aeae2750473288bd31f16521772
> Reviewed-on: https://skia-review.googlesource.com/150967
> 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: Ic3d6497268df1eb86392f83844d3fdcdb0674373
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/153261
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-10 21:03:53 +00:00
Mike Reed
3d69be51bb add SkPath::shrinkToFit
Bug: skia:
Change-Id: Ief647bcea53c0aeae2750473288bd31f16521772
Reviewed-on: https://skia-review.googlesource.com/150967
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-09-10 20:49:31 +00:00
Brian Osman
086679bc11 Revert "increase Builder's prealloc size after colorspace change"
This reverts commit e53de48393.

Reason for revert: Key size distribution has changed back.

Original change's description:
> increase Builder's prealloc size after colorspace change
> 
> BUG=skia:
> 
> Change-Id: I003dcbde7d987404ae823df6621e13664cf440a1
> Reviewed-on: https://skia-review.googlesource.com/9523
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reed@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:
Change-Id: I506a1ec791e6d99df1836cbf3262747fbfa224a7
Reviewed-on: https://skia-review.googlesource.com/153008
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-10 20:49:30 +00:00
Cary Clark
aa5f38f0ba Revert "Simplify plots to always be 512x512 and simplify GrDrawOpAtlasConfig"
This reverts commit a2bc1ca21b.

Reason for revert: see if make chromecast failures go away

Original change's description:
> Simplify plots to always be 512x512 and simplify GrDrawOpAtlasConfig
> 
> Change-Id: I1353d3facf191e3323027fc288715672240d1f87
> Reviewed-on: https://skia-review.googlesource.com/152591
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=jvanverth@google.com,bsalomon@google.com,herb@google.com

Change-Id: I970ec86678c97046001889dc436df5307750da1b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/153180
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-09-10 20:28:13 +00:00
Herb Derby
a2bc1ca21b Simplify plots to always be 512x512 and simplify GrDrawOpAtlasConfig
Change-Id: I1353d3facf191e3323027fc288715672240d1f87
Reviewed-on: https://skia-review.googlesource.com/152591
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-09-10 17:49:56 +00:00
Brian Salomon
43b882bced Remove purging of GPU resources based on flush counts.
We've had a better time-based mechanism available for a long time.

Change-Id: I130ab79dc0e8161a6817eb53b83e0988546dfa71
Reviewed-on: https://skia-review.googlesource.com/152668
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-09-10 13:11:07 +00:00
Mike Reed
87ce0690b7 Revert "Revert "add flag to soften the blow of removing a legacy api for flutter""
Remember to delete the define from SkTypeface.h

This reverts commit b5f23f398d.

Bug: skia:
Change-Id: I63b2e395dac3850d352f38fdfee9ad751cdcace9
Reviewed-on: https://skia-review.googlesource.com/152590
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-07 20:58:54 +00:00
Mike Klein
d9187c085b Revert "SkMath takes some functions from from SkTypes"
This reverts commit 3b347232bc.

Reason for revert: tree done gone red.

Original change's description:
> SkMath takes some functions from from SkTypes
> 
> Moved to include/core/SkMath.h: Sk{Is|}Align{2|4|8|Ptr}, SkLeftShift,
> SkAbs{32|}, SkM{ax|in}32 SkTM{in|ax}, SkTClamp, SkFastMin32, SkTPin.
> 
> Change-Id: Ibcc07be0fc3677731048e7cc86006e7aa493cb92
> Reviewed-on: https://skia-review.googlesource.com/133381
> Auto-Submit: Hal Canary <halcanary@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

TBR=mtklein@google.com,halcanary@google.com,bungeman@google.com,reed@google.com

Change-Id: I44073cf397e2a3a6a941a90f0aa63c6396d4c742
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/152587
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-07 17:32:54 +00:00
Hal Canary
3b347232bc SkMath takes some functions from from SkTypes
Moved to include/core/SkMath.h: Sk{Is|}Align{2|4|8|Ptr}, SkLeftShift,
SkAbs{32|}, SkM{ax|in}32 SkTM{in|ax}, SkTClamp, SkFastMin32, SkTPin.

Change-Id: Ibcc07be0fc3677731048e7cc86006e7aa493cb92
Reviewed-on: https://skia-review.googlesource.com/133381
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-09-07 17:18:46 +00:00
Mike Reed
41b67730a1 Use the unique_ptr variant of MakeFromStream (the other is deprecated)
This reverts commit 0b80e62a14.

Bug: skia:
Change-Id: I2c8d68e06b7c7f4f2fb1f3f6aa1eed0e12dc8455
Reviewed-on: https://skia-review.googlesource.com/152582
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-07 15:40:19 +00:00
Jim Van Verth
0b80e62a14 Reland "Revert "update to new MakeFromStream signature""
This reverts commit 8695539654.

Reason for revert: Breaking the Housekeeper bot.

Original change's description:
> Revert "Revert "update to new MakeFromStream signature""
> 
> This reverts commit 71f8475a0d.
> 
> Modified to still expose old signature (until we update google3 and flutter)
> 
> Bug: skia:
> Change-Id: Ie51e6227d5c6961d90006a015a5292cebd49e2a2
> Reviewed-on: https://skia-review.googlesource.com/152560
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I731108dac57aac090420594dc19e42c217f51b06
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/152600
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-09-07 12:44:47 +00:00
Mike Reed
8695539654 Revert "Revert "update to new MakeFromStream signature""
This reverts commit 71f8475a0d.

Modified to still expose old signature (until we update google3 and flutter)

Bug: skia:
Change-Id: Ie51e6227d5c6961d90006a015a5292cebd49e2a2
Reviewed-on: https://skia-review.googlesource.com/152560
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-07 11:46:55 +00:00
Hal Canary
2d40490d4c Move some functions to MathPriv.h
Change-Id: I22c57a746e4a997fc03f35aa06b23d9fa9ed4fa9
Reviewed-on: https://skia-review.googlesource.com/152183
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-06 15:48:25 +00:00
Mike Klein
d30937a499 remove SkRandom::next64()
It appears to be unused, and exploits undefined behavior.

Change-Id: I935de36cd2f07e811958b1696afa62d410e1cb5f
Reviewed-on: https://skia-review.googlesource.com/152123
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-09-06 12:46:46 +00:00
Cary Clark
60ebf14ccc Revert "SkStream: remove some WStream functions from public api"
This reverts commit 8b68110507.

Reason for revert: breaks bots

Original change's description:
> SkStream: remove some WStream functions from public api
> 
> move functions to SkStringPriv.h
> 
> also add SkStrAppendU32Hex() function, and re-write
> SkString::insertHex() to use SkStrAppendU32Hex.
> 
> add unit tests.
> 
> Change-Id: Ieda98fb4106db71565b607e593713a91a5ddd892
> Reviewed-on: https://skia-review.googlesource.com/151986
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

TBR=halcanary@google.com,bungeman@google.com,caryclark@google.com,reed@google.com

Change-Id: Idbac615092f46c18b38e08385dafba20930f0ff0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/152121
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-09-06 12:22:41 +00:00
Hal Canary
8b68110507 SkStream: remove some WStream functions from public api
move functions to SkStringPriv.h

also add SkStrAppendU32Hex() function, and re-write
SkString::insertHex() to use SkStrAppendU32Hex.

add unit tests.

Change-Id: Ieda98fb4106db71565b607e593713a91a5ddd892
Reviewed-on: https://skia-review.googlesource.com/151986
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-09-06 11:44:11 +00:00
Mike Klein
71f8475a0d Revert "update to new MakeFromStream signature"
This reverts commit edc6ea7a9e.

Reason for revert: need to update Flutter, Google3.

Original change's description:
> update to new MakeFromStream signature
> 
> Bug: skia:
> Change-Id: Ic18a45628905b90a2477043989ad4cb9fa11ab52
> Reviewed-on: https://skia-review.googlesource.com/151880
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

TBR=djsollen@google.com,bungeman@google.com,reed@google.com

Change-Id: I22daf2cdb86f9e5ca3b78db45f8e15efe4b21005
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/152120
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-06 11:37:06 +00:00
Mike Reed
edc6ea7a9e update to new MakeFromStream signature
Bug: skia:
Change-Id: Ic18a45628905b90a2477043989ad4cb9fa11ab52
Reviewed-on: https://skia-review.googlesource.com/151880
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2018-09-06 00:43:20 +00:00
Mike Klein
5595f6ef0e clean up S16CPU
S16CPU is used only inside Skia, and only sparsely.

    - SkRandom::nextS16() and nextU16() were used rarely enough
      that it makes things simpler to get rid of them.
    - SkAlphaBlend255() was unused outside tests.
    - SkIntToFDot6() looks like it really wants to take an int.

Change-Id: I3ca773beb6c04c691947d4602f27c819b660554d
Reviewed-on: https://skia-review.googlesource.com/151700
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-05 15:48:04 +00:00
Mike Klein
7af2bc8802 more skcolorspace cleanup
This time with infinitely less stack usage.

Change-Id: Ic0b4662203eb2787fd9d793fee65ebcd592ad5f3
Reviewed-on: https://skia-review.googlesource.com/151420
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-05 14:39:31 +00:00
Brian Osman
b0f4d0a658 Reland "Switch SkPaint's color to SkColor4f"
This reverts commit cacf496a9d.

Reason for revert: Android tests have been updated.

Original change's description:
> Revert "Switch SkPaint's color to SkColor4f"
> 
> This reverts commit ee87c8629c.
> 
> Reason for revert: Android tests.
> 
> Original change's description:
> > Switch SkPaint's color to SkColor4f
> > 
> > Change-Id: Ic2b83a05739720013a7c30ec014df0747b3f99a5
> > Reviewed-on: https://skia-review.googlesource.com/149229
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Reviewed-by: Mike Klein <mtklein@google.com>
> 
> TBR=djsollen@google.com,mtklein@google.com,brianosman@google.com,reed@google.com
> 
> Change-Id: I85efd020598d70cbfb90c4f4af7d33482a3d7280
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/151544
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=djsollen@google.com,mtklein@google.com,brianosman@google.com,reed@google.com

Change-Id: Ifb817ab496fef22a7b1306af82186c6badbfa992
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/151664
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-05 14:16:33 +00:00
Brian Osman
cacf496a9d Revert "Switch SkPaint's color to SkColor4f"
This reverts commit ee87c8629c.

Reason for revert: Android tests.

Original change's description:
> Switch SkPaint's color to SkColor4f
> 
> Change-Id: Ic2b83a05739720013a7c30ec014df0747b3f99a5
> Reviewed-on: https://skia-review.googlesource.com/149229
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=djsollen@google.com,mtklein@google.com,brianosman@google.com,reed@google.com

Change-Id: I85efd020598d70cbfb90c4f4af7d33482a3d7280
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/151544
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-04 19:55:02 +00:00
Brian Osman
cca8c6fa47 SkColorSpace cleanup
Remove SkColorSpace_XYZ, no need for an interface with one
implementation.

Change-Id: I47a23293334b5e02a6e5af8356b3df0262f86d5a
Reviewed-on: https://skia-review.googlesource.com/150138
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-04 15:48:02 +00:00
Mike Reed
271d1d9001 Change SkTypeface::MakeFromStream to take unique_ptr
Also, add MakeFromData variant, which matches SkFontMgr

Bug: skia:8350
Change-Id: Ia220496bab8ecf0e7eefaf0c8b62d88ea1394a17
Reviewed-on: https://skia-review.googlesource.com/150969
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-09-04 15:24:12 +00:00
Nigel Tao
de124022f4 Remove obsolete kIndex_8_SkColorType reference
Bug: skia:6828

No public API change. Just removing an obsolete comment.
TBR=reed@google.com

Change-Id: I6c729c62bf7d94fc6acb677d68e7091f80d73b3e
Reviewed-on: https://skia-review.googlesource.com/150781
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-09-04 14:55:48 +00:00
Brian Osman
ee87c8629c Switch SkPaint's color to SkColor4f
Change-Id: Ic2b83a05739720013a7c30ec014df0747b3f99a5
Reviewed-on: https://skia-review.googlesource.com/149229
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-04 13:55:46 +00:00
Ethan Nicholas
78aceb2f87 converted overdraw effect to new FP system
Bug: skia:
Change-Id: I4cff0ecdf3fc61f584012af519730f08bfd78264
Reviewed-on: https://skia-review.googlesource.com/150484
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-09-04 13:37:25 +00:00
Mike Reed
bf67741140 add behavior enum to SkTypeface::serialize()
This enables a simple SkSerialProc for typefaces that can decide,
during picture serialization, how much data to serialize for each
typeface.

Bug: skia:
Change-Id: Ic9d18b24d9e650fd2a78304520a73aa0645dc139
Reviewed-on: https://skia-review.googlesource.com/150968
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-09-03 16:52:26 +00:00
Chris Dalton
09a7bb2221 Reland "ccpr: Implement stroking with fine triangle strips"
This is a reland of 2f2757fa6b

Original change's description:
> ccpr: Implement stroking with fine triangle strips
>
> Implements strokes by linearizing the curve into fine triangle strips
> and interpolating a coverage ramp for edge AA. Each triangle in the
> strip emits either positive or negative coverage, depending on its
> winding direction. Joins and caps are drawn with the existing CCPR
> shaders for triangles and conics.
>
> Conic strokes and non-rigid-body transforms are not yet supported.
>
> Bug: skia:
> Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
> Reviewed-on: https://skia-review.googlesource.com/148243
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Allan MacKinnon <allanmac@google.com>

TBR=robertphillips@google.com

Bug: skia:
Change-Id: I3f0065e80975ee8334300bc5e934231b66b49178
Reviewed-on: https://skia-review.googlesource.com/151188
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-09-03 10:16:28 +00:00
Jim Van Verth
0b7645f6d9 Simplify perspective shadows to match future MD specs.
* For ambient we outset a constant amount around the perspective shape.
* For spot we compute the projection of the bounds from the light's
  perspective, and from that compute a matrix to transform the path.

Bug: skia:7971
Change-Id: I7fffdd1446423956773d145ff4fae0a81602ad5b
Reviewed-on: https://skia-review.googlesource.com/150471
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-31 18:15:19 +00:00
Ethan Nicholas
545aa936f5 fixed uninitialized memory use in arithmetic effect
Bug: skia:
Change-Id: Ieb591db974d858566b35c1e61c1303051ed65f67
Reviewed-on: https://skia-review.googlesource.com/150907
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-08-31 16:01:32 +00:00
Mike Klein
835b2f5769 update SkPreConfig a little
- add AVX-512 to SK_CPU_SSE_LEVEL
  - remove unused SK_ARM_ARCH
  - small formatting changes
  - no need to check for __ARM_NEON__ and __ARM_NEON...
    __ARM_NEON is defined anywhere we'll find NEON.

Change-Id: I6841097d62cf73ddb749f961261e583474470276
Reviewed-on: https://skia-review.googlesource.com/150960
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-08-31 15:09:19 +00:00
Chris Dalton
02e6efe0a4 Revert "ccpr: Implement stroking with fine triangle strips"
This reverts commit 2f2757fa6b.

Reason for revert: issues with DDL

Original change's description:
> ccpr: Implement stroking with fine triangle strips
> 
> Implements strokes by linearizing the curve into fine triangle strips
> and interpolating a coverage ramp for edge AA. Each triangle in the
> strip emits either positive or negative coverage, depending on its
> winding direction. Joins and caps are drawn with the existing CCPR
> shaders for triangles and conics.
> 
> Conic strokes and non-rigid-body transforms are not yet supported.
> 
> Bug: skia:
> Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
> Reviewed-on: https://skia-review.googlesource.com/148243
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Allan MacKinnon <allanmac@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,caryclark@google.com,csmartdalton@google.com,reed@google.com,allanmac@google.com

Change-Id: I1980b09976df8275817eaffb6766dbd9fd3e59c7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/150980
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-08-31 14:45:44 +00:00
Greg Daniel
ecddbc0126 Add support for switching family queues in vulkan.
Bug: skia:
Change-Id: Ie4f620a96d1a6f7662819590d97073a694159f96
Reviewed-on: https://skia-review.googlesource.com/150483
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-08-31 13:25:22 +00:00
Chris Dalton
2f2757fa6b ccpr: Implement stroking with fine triangle strips
Implements strokes by linearizing the curve into fine triangle strips
and interpolating a coverage ramp for edge AA. Each triangle in the
strip emits either positive or negative coverage, depending on its
winding direction. Joins and caps are drawn with the existing CCPR
shaders for triangles and conics.

Conic strokes and non-rigid-body transforms are not yet supported.

Bug: skia:
Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
Reviewed-on: https://skia-review.googlesource.com/148243
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Allan MacKinnon <allanmac@google.com>
2018-08-31 12:51:47 +00:00
Michael Ludwig
10c3776b44 Remove GrTextureStripAtlas, textured gradients use independent textures
The texture strip atlas code path has been disabled without performance
regressions since 8/3/18, so this deletes it completely from the code
base since it is complex and difficult to manage.

GrTextureStripAtlas, GrDynamicTextureStripAtlas, and
GrDDLTextureStripAtlas completely deleted, everything else is cleaning
up references/dead code using the atlas.

Bug: skia:
Change-Id: Ieb967b6e291a1d76da62fce9fa384acbda8c51c0
Reviewed-on: https://skia-review.googlesource.com/150472
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-30 20:43:30 +00:00
Heather Miller
c9367d33dc Update Skia milestone to 71
TBR:reed@google.com
NOTRY=true

Bug: skia:
Change-Id: Ic3a9b2511fed9a731867200e4f298f8f54eaf85b
Reviewed-on: https://skia-review.googlesource.com/150580
Reviewed-by: Heather Miller <hcm@google.com>
2018-08-30 18:02:33 +00:00
Ethan Nicholas
ce008119dc converted arithmetic FP to new FP structure
Bug: skia:
Change-Id: I5492b378fa0f2ab7b453b2b1b18e4aef898370d2
Reviewed-on: https://skia-review.googlesource.com/148910
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-30 17:41:11 +00:00
Mike Reed
500cbc6533 clean up for removing drawTextOnPath from canvas
Docs-Preview: https://skia.org/?cl=150127
Bug: skia:7554
Change-Id: I4aa980e083626e25c2f04d8e18a75bdc280b5191
Reviewed-on: https://skia-review.googlesource.com/150127
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-08-29 16:27:48 +00:00
Mike Reed
a62d036586 textonpath no longer in canvas
Prev behavior available via utils SkDrawTextOnPath

Bug: skia:7554
Change-Id: I3d71963c632cc947e418757bb83cdc18ec3b184e
Reviewed-on: https://skia-review.googlesource.com/150123
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-08-29 14:04:45 +00:00
Brian Osman
18d7cf76cc Reland "Remove old ICC parser, A2B SkColorSpace, SkGammas, etc..."
This reverts commit 7ba1d64f07.

Reason for revert: Chrome's MakeICC calls are gone now.
Original change's description:
> Revert "Remove old ICC parser, A2B SkColorSpace, SkGammas, etc..."
> 
> This reverts commit 8ae7c90faf.
> 
> Reason for revert: Chrome roll
> 
> Original change's description:
> > Remove old ICC parser, A2B SkColorSpace, SkGammas, etc...
> > 
> > Docs-Preview: https://skia.org/?cl=148807
> > Change-Id: I2d77f6543e390c4948d57242a518af77443f0165
> > Reviewed-on: https://skia-review.googlesource.com/148807
> > Commit-Queue: Mike Klein <mtklein@google.com>
> > Reviewed-by: Mike Klein <mtklein@google.com>
> 
> TBR=mtklein@google.com,brianosman@google.com,reed@google.com
> 
> Change-Id: I5821591b22e395327ec0cd29ec18569bf7f61859
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/150142
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=mtklein@google.com,brianosman@google.com,reed@google.com

Change-Id: I0269f8627f3afadeed7d1559a2a3dabf0c7f7b3f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/150122
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-28 20:07:16 +00:00
Brian Osman
7ba1d64f07 Revert "Remove old ICC parser, A2B SkColorSpace, SkGammas, etc..."
This reverts commit 8ae7c90faf.

Reason for revert: Chrome roll

Original change's description:
> Remove old ICC parser, A2B SkColorSpace, SkGammas, etc...
> 
> Docs-Preview: https://skia.org/?cl=148807
> Change-Id: I2d77f6543e390c4948d57242a518af77443f0165
> Reviewed-on: https://skia-review.googlesource.com/148807
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,brianosman@google.com,reed@google.com

Change-Id: I5821591b22e395327ec0cd29ec18569bf7f61859
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/150142
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-28 17:52:22 +00:00
Mike Reed
7c8d2e940e don't support virtual onDrawTextOnPath
Bug: skia:7554
Change-Id: Ia8c663918fea7bc91f3474d1c94e7a1c5536a1d4
Reviewed-on: https://skia-review.googlesource.com/149805
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-08-28 16:54:18 +00:00
Cary Clark
153e76d4bf deprecate draw text on path in docs
Remove documentation, see also references, and examples
that rely on SkCanvas::drawTextOnPath(HV).

Move example that uses SkDrawTextOnPath into illustrations.
TBR=reed@google.com

Docs-Preview: https://skia.org/?cl=150020
Bug: skia:6898
Change-Id: I1d92f258b75a8a10a6aa89ebf9380871ba7ecac5
Reviewed-on: https://skia-review.googlesource.com/150020
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-08-28 16:22:53 +00:00
Cary Clark
1cb97a2f32 fix empty region iter rect
Region iterators return bounds but do not initialize
the result if Iterator has no region or region is
empty.

Add general tests for empty region iterators.

R=reed@google.com,halcanary@google.com

Docs-Preview: https://skia.org/?cl=149980
Bug: skia:8186
Change-Id: If4367d4c0eef7fc9c7bfd7d1436143e155b78309
Reviewed-on: https://skia-review.googlesource.com/149980
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Hal Canary <halcanary@google.com>
2018-08-28 15:21:25 +00:00
Brian Osman
8ae7c90faf Remove old ICC parser, A2B SkColorSpace, SkGammas, etc...
Docs-Preview: https://skia.org/?cl=148807
Change-Id: I2d77f6543e390c4948d57242a518af77443f0165
Reviewed-on: https://skia-review.googlesource.com/148807
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-08-28 14:25:35 +00:00
Mike Reed
c349f18ee8 use textonpath util for canvas::drawTextOnPath
- slight change in pixels
- will allow us to remove lots of virtuals

Bug: skia:7554
Change-Id: I8f95c07bf67760824d9d9bf59c28f11835971d4b
Reviewed-on: https://skia-review.googlesource.com/149683
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-08-27 19:37:24 +00:00
Mike Reed
0fdc53f9ff textonpath util
Bug: skia:7554
Change-Id: Ifff3030f9d7be24146b5230bbf0e47f73000adfd
Reviewed-on: https://skia-review.googlesource.com/141460
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-08-27 18:01:21 +00:00
Leon Scroggins III
36f7e3298e Reland "Switch SkCodec to use skcms plus fixes""
This reverts commit 83988edfd3.

The CTS failure was actually due to another CL.

TBR=brianosman@google.com
TBR=djsollen@google.com

Bug: skia:6839
Bug: skia:8052
Bug: skia:8278
Change-Id: Id9f152ec2c66467d90f49df223cb9b7c168ac2ac
Reviewed-on: https://skia-review.googlesource.com/149483
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-08-27 16:16:14 +00:00
Brian Salomon
2424ec46e9 Make GrGLInterface great for Win32 x86 again
Bug: skia:8262
Change-Id: I607644198d5dc7992e2b89eb34651eb1dc88c6ba
Reviewed-on: https://skia-review.googlesource.com/149225
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-08-27 16:09:48 +00:00
Leon Scroggins
83988edfd3 Revert "Reland "Switch SkCodec to use skcms" plus fixes"
This reverts commit 49894f450f.

Reason for revert: Breaking a CTS test on the Android roll:

java.lang.AssertionError: expected:<67043583> but was:<50266367>
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.failNotEquals(Assert.java:834)
	at org.junit.Assert.assertEquals(Assert.java:645)
	at org.junit.Assert.assertEquals(Assert.java:631)
	at android.graphics.cts.BitmapColorSpaceTest.verifyGetPixel(BitmapColorSpaceTest.java:301)
	at android.graphics.cts.BitmapColorSpaceTest.inColorSpaceP3ToSRGB(BitmapColorSpaceTest.java:612)

Expected: 3FF00FF Actual: 2FF00FF

Original change's description:
> Reland "Switch SkCodec to use skcms" plus fixes
> 
> This reverts commit 33d5394d08,
> relanding 81886e8f94 as well as
> "Fix CMYK handling in JPEG codec" (commit
> f8ae5ce20c)
> 
> Add a test based on the CTS test that failed in the original commit.
> purple-displayprofile.png is the image used in the CTS test, with the
> Android license.
> 
> This also adds a fix for SkAndroidCodec, ensuring that we continue to
> use a wide gamut SkColorSpace for images that do not have a numerical
> transfer function and have a wide gamut. This includes a test, with
> wide-gamut.png, which was created with Photoshop and the profile
> "sRGB_Calibrated_Homogeneous.icc" from the skcms tree.
> 
> Bug: skia:6839
> Bug: skia:8052
> Bug: skia:8278
> 
> TBR=djsollen@google.com
> As with the original, no API change
> 
> Change-Id: I4e5bba6a3151f9dc6491e8eda73d4de0535bd692
> Reviewed-on: https://skia-review.googlesource.com/149043
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>

TBR=djsollen@google.com,mtklein@google.com,scroggo@google.com,brianosman@google.com

Change-Id: Ie71e1fecc26de8225d2fe603765c1e1e0d738634
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6839, skia:8052, skia:8278
Reviewed-on: https://skia-review.googlesource.com/149262
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-08-24 21:41:37 +00:00
Leon Scroggins III
49894f450f Reland "Switch SkCodec to use skcms" plus fixes
This reverts commit 33d5394d08,
relanding 81886e8f94 as well as
"Fix CMYK handling in JPEG codec" (commit
f8ae5ce20c)

Add a test based on the CTS test that failed in the original commit.
purple-displayprofile.png is the image used in the CTS test, with the
Android license.

This also adds a fix for SkAndroidCodec, ensuring that we continue to
use a wide gamut SkColorSpace for images that do not have a numerical
transfer function and have a wide gamut. This includes a test, with
wide-gamut.png, which was created with Photoshop and the profile
"sRGB_Calibrated_Homogeneous.icc" from the skcms tree.

Bug: skia:6839
Bug: skia:8052
Bug: skia:8278

TBR=djsollen@google.com
As with the original, no API change

Change-Id: I4e5bba6a3151f9dc6491e8eda73d4de0535bd692
Reviewed-on: https://skia-review.googlesource.com/149043
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-08-24 17:46:25 +00:00
Adrienne Walker
70e468f93c Add disable_texture_storage workaround
Bug: chromium: 521904, 829614
Change-Id: I808d9c80bac86cbc23982eaefdc7f822fd408a3d
Reviewed-on: https://skia-review.googlesource.com/148659
Commit-Queue: Adrienne Walker <enne@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-22 23:56:23 +00:00
Adrienne Walker
2f4c09b5ca Add remove_pow_with_constant_exponent workaround
Bug: chromium: 477306, 829614
Change-Id: If88c57b15a4cfd6f362a2f5171f8e9c0775cb9d4
Reviewed-on: https://skia-review.googlesource.com/148480
Commit-Queue: Adrienne Walker <enne@chromium.org>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2018-08-22 23:09:36 +00:00
Adrienne Walker
8b23ca6406 Add rewrite_do_while_loops workaround
Bug: chromium: 644669, 829614
Change-Id: Ic6a4cbd9f7c73b9b9a78608f1b4ac4ce4c4f2cb9
Reviewed-on: https://skia-review.googlesource.com/148439
Commit-Queue: Adrienne Walker <enne@chromium.org>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2018-08-22 22:45:52 +00:00
Leon Scroggins III
33d5394d08 Revert "Switch SkCodec to use skcms" and follow on change
This reverts commit 81886e8f94 and
f8ae5ce20c
("Fix CMYK handling in JPEG codec")

This fixes the Android build, which was failing a CTS test with this
change.

Bug: skia:6839
Bug: skia:8052

TBR=djsollen@google.com
As with the original, no API change

Change-Id: Ic744a610e9f431707f871de44f9f64040bc60d14
Reviewed-on: https://skia-review.googlesource.com/148810
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-08-22 21:13:50 +00:00
Adrienne Walker
92b161fab4 Add emulate_abs_int_function workaround
Bug: chromium: 642227,829614
Change-Id: I23be4105041187a6501f45cd2033ac0143642aa1
Reviewed-on: https://skia-review.googlesource.com/147322
Commit-Queue: Adrienne Walker <enne@chromium.org>
Auto-Submit: Adrienne Walker <enne@chromium.org>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2018-08-22 18:25:13 +00:00
Leon Scroggins III
81886e8f94 Switch SkCodec to use skcms
Bug: skia:6839
Bug: skia:8052

Create an skcms_Profile instead of an SkColorSpace when creating an
SkCodec. Eventually we'll move the SkImageInfo (and its SkColorSpace)
entirely to clients (e.g. SkAndroidCodec, SkCodecImageGenerator), but
for now, create it with SkEncodedInfo::makeImageInfo.

Create new SkEncodedInfo::Colors for the special PNG cases that we
want to map to specific SkColorTypes.

SkEncodedInfo:
- Add ICCProfile, which owns an skcms_ICCProfile
 - FIXME: maybe we should have a single instance for
  SRGB like SkColorSpace?
- Add kXAlpha_Color, for kAlpha_8. Since I'm not longer creating
  an SkImageInfo (at least in SkPngCodec), it needs a way to pass
  this info to the caller.
- Add k565_Color, for the same reason. Matt originally had this in
  https://codereview.chromium.org/2212563003/#ps120001, but didn't
  land that version. I like it though. Mike didn't like the bits
  per component for 565, but it seems like a sensible hack, much
  like the existing one for kAlpha_8
- Add width and height. These were removed for redundancy with
  SkImageInfo, but it makes sense to have them here without it.
BUILD.gn:
- Build the new SkEncodedInfo.cpp
SkCodec:
- Remove the constructor with an SkImageInfo. Edit the other one
  to drop width and height (now in SkEncodedInfo) and take a RHS
  reference to SkEncodedInfo
- Create the SkImageInfo from fEncodedInfo (for now)
- Consolidate choosing skcms_AlphaFormat for Transform here
- Call conversionSupported from initializeColorXform, with a new
  parameter for whether there is a color Xform, allowing SkJpegCodec
  and SkHeifCodec to override that method instead of having another
  method.
SkBmpCodec (etc)
- Adapt to the changes above
- Create a new SkEncodedInfo w/o profile for the swizzler.
SkPngCodec:
- use the new SkEncodedInfo::Colors rather than a custom SkImageInfo
SkRawCodec:
- Remove SkEncodedInfo from SkDngImage, which doesn't actually need it.
  This is helpful since we don't know all the info yet.
- Rewrite gAdobeRGB_toXYZD50 as an skcms_Matrix3x3
SkWebpCodec:
- Remove premul_step computation, and simplify to just rely on
  the base class' handling of applying the transform.
SkSwizzler:
- Add cases for the new SkEncodedInfo::Colors

TBR=reed@google.com
No public API changes. Only private/public members of SkCodec.h are
modified.

Change-Id: Ic0d3bb752b03f13be886b80331987aa5a5713fc0
Reviewed-on: https://skia-review.googlesource.com/136062
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-08-22 18:16:20 +00:00
Adrienne Walker
c02165fae1 Add unfold_short_circuit_as_ternary workaround
Bug: chromium: 307751,829614
Change-Id: I1fb347e5470eb2a498192f3fc467a6b744b53a79
Reviewed-on: https://skia-review.googlesource.com/147243
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Adrienne Walker <enne@chromium.org>
2018-08-22 16:54:26 +00:00
Robert Phillips
4f6c9157ba Remove occluder parameter from SkMaskFilter::MakeBlur factory
I've cleaned up the call sites in Chrome so we should be able to remove this

Change-Id: I945c0cd54647b20f47012c26f31667b4dd6a07f0
Reviewed-on: https://skia-review.googlesource.com/148662
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-08-22 15:59:29 +00:00
Nigel Tao
66bc524d34 Rename SkCodec::kNone to SkCodec::kNoFrame
Add a SK_LEGACY_SKCODEC_NONE_ENUM #define'able to ease transition.

Also rename another internal "kNone" enum in SkWebpCodec.cpp.

The "kNone" name is overloaded:
- include/core/SkImageGenerator.h defines its own kNone.
- include/encode/SkPngEncoder.h defines its own kNone.
- include/private/GrTypesPriv.h defines multiple kNone's.

Bug: skia:
Change-Id: I18c03a74f2f1b0237016e0eef53dcd4478b82609
Reviewed-on: https://skia-review.googlesource.com/146020
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-08-22 14:49:56 +00:00
Nigel Tao
96597c22c3 Add more comments to SkCodec::getRepetitionCount
Bug: skia:
Change-Id: Icc2d7d78106cb587905a8ddb039bc9bf7ae6ad91
Reviewed-on: https://skia-review.googlesource.com/146021
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-08-22 14:16:44 +00:00
Nigel Tao
13df9817f8 Update SkCodec::rewindIfNeeded comment
Bug: skia:
Change-Id: I3c08535115b139be80341543daea6d5e23065cd0
Reviewed-on: https://skia-review.googlesource.com/146022
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2018-08-22 13:28:18 +00:00
Mike Klein
12d4b6e545 let's like, chill out about all these rules, man
There's really no reason to prevent any of these conversions;
they all have somewhat reasonable behavior:

   - converting between grey in different color spaces
     should probably work just fine
   - we'll convert color to gray using a fixed set of
     luminance coefficients, but that's better than failing
   - we'll invent {r,g,b} = {0,0,0} if we convert alpha
     to something with color
   - converting to opaque formats without thinking about
     premul/unpremul is probably fine, better than just
     not working at all
   - a missing src color space can always be assumed to be sRGB

Updates to ReadPixelsTest:
   - skip more supported test cases in test_conversion(),
     each with a TODO
   - conversions from non-opaque to opaque should now work
   - conversion from A8 to non-A8 should sometimes now
     work on GPUs, and the test needed a little bit of
     a tweak to not expect A8 to carry around color somehow.

Updates to SRGBReadWritePixelsTest:
   - writing untagged pixels shouldn't fail anymore;
     instead, it should behave like it was tagged sRGB

Change-Id: I19e78f3a6c89ef74fbcbc985d3fbd77fa984b1c2
Reviewed-on: https://skia-review.googlesource.com/147815
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-08-21 22:23:54 +00:00
Herb Derby
65956874e0 Rename SkGlyphRunListDrawer to SkGlyphRunListPainter
Change-Id: I43aa72e67b87f03e234cf5d451ef7259611222da
Reviewed-on: https://skia-review.googlesource.com/148398
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-08-21 21:31:50 +00:00
Adrienne Walker
ee8295c050 Add add_and_true_to_loop_condition workaround
See https://bugs.chromium.org/p/chromium/issues/detail?id=644669#c4 for
what this is doing and trying to work around.

Bug: chromium: 644669, 829614
Change-Id: I5616eb6f7299c30e5bdf812e55099ac0a8fc9c1d
Reviewed-on: https://skia-review.googlesource.com/146856
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Adrienne Walker <enne@chromium.org>
2018-08-21 20:03:50 +00:00
Adrienne Walker
ca0cdef063 Add flush_on_framebuffer_change workaround
Bug: chromium: 829614
Change-Id: Ibd7ebfd74d95e3119f01a3d6ae40a693368ac3de
Reviewed-on: https://skia-review.googlesource.com/147128
Auto-Submit: Adrienne Walker <enne@chromium.org>
Commit-Queue: Adrienne Walker <enne@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-21 01:10:52 +00:00
Robert Phillips
557aad7775 Remove occluder feature from blur mask filter
AFAICT none of our clients are using this feature

This will change the occludedrrectblur GM.

Change-Id: I7e5b8fa67db0373dee11a1467d2b2b6a414a1574
Reviewed-on: https://skia-review.googlesource.com/147561
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-08-17 14:15:30 +00:00
Cary Clark
7d06e2642b fixup winding contours
Add AsWinding to convert SkPath with even odd fill to winding fill.

This basic implementation works for simple non-intersecting paths.
It may fail if contours in paths touch, specifically when the leftmost
point in a contour is shared with another contour.

The incomplete parts are marked with TODO in the code.

If this interface and implementation look promising, I will continue to
tackle the more difficult cases.

R=reed@google.com,bungeman@google.com
Bug: skia:7682
Change-Id: I479fba60072eb1391b451fcb819504245da2e2a9
Reviewed-on: https://skia-review.googlesource.com/147044
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-08-17 14:01:51 +00:00
Ben Wagner
035aa329ba SkFontMgr::matchFamilyStyle can return nullptr.
The current documentation states that SkFontMgr::matchFamilyStyle will
never return nullptr, resolving to the default system font or the empty
typeface if necessary. This isn't the behavior desired by any users,
since doing so makes it difficult for the user to check if a 'good'
match was made or not. All of the current SkFontMgr implementations can
return nullptr anyway for a number of reasons, from lack of a 'good'
match to an error.

Bug: skia:8260
Change-Id: I96299c16aaa7228fd42a9d8ec4889c7355cb53a5
Reviewed-on: https://skia-review.googlesource.com/147721
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-08-16 22:49:52 +00:00
Mike Reed
6d10f8bda1 move patheffect virtuals to protected and rename
- change filterPath to safely handle if src and dst are aliases

Bug: skia:8254
Change-Id: I125d19404ca0a610f73271abb5c5455d1d50f9ed
Reviewed-on: https://skia-review.googlesource.com/147466
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-08-16 17:47:22 +00:00
Cary Clark
0251b1be0b fix SkPath documentation
SkPath now returns reference to itself.
There's also a new addPoly() variant.
Update the docs to match.

TBR=reed@google.com,kjlubick@google.com

Docs-Preview: https://skia.org/?cl=147216
Bug: skia:6818
Change-Id: I0e40e942cc46a8994285dfea4c81e2042a4e689c
Reviewed-on: https://skia-review.googlesource.com/147216
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-08-15 19:57:32 +00:00
Mike Reed
b631742f0b return this from maker calls, so we can chain the calls
Bug: skia:
Change-Id: Id62eda9dab9399ce1183a959438db7dde59889d8
Reviewed-on: https://skia-review.googlesource.com/147113
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-08-15 17:21:59 +00:00
Ruiqi Mao
c97a339cd6 added optimizations to speed up skinning
Docs-Preview: https://skia.org/?cl=145148
Bug: skia:
Change-Id: If27722105a1e8999f6440b6fd4044cc1f327827e
Reviewed-on: https://skia-review.googlesource.com/145148
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-08-15 15:52:29 +00:00
Chris Dalton
916c498c04 Consolidate the scissor enums into one "GrScissorTest" enum
Bug: skia:
Change-Id: If8d40b54860acb5c18d3a9a82cb2a61e3c42025f
Reviewed-on: https://skia-review.googlesource.com/147172
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-08-15 13:53:42 +00:00