Commit Graph

6121 Commits

Author SHA1 Message Date
Brian Salomon
662ea4baba Remove texel buffer support.
Change-Id: Ia6f21afe714208979a5bc384e436b28ea2b9a297
Reviewed-on: https://skia-review.googlesource.com/141051
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-07-13 00:45:54 +00:00
Herb Derby
c434ade20e Move to using pointers in simplifyDraw*
Move to using pointers into buffers. This will allow
multiple runs from blobs to share buffers.

Change-Id: I6ebed2e490c5fe71077ddc921ead145ce17c5ebd
Reviewed-on: https://skia-review.googlesource.com/141049
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-07-12 20:59:19 +00:00
Brian Osman
b62f50cf76 Replace nearly all kRespect with kIgnore
- Encoders and decoders always assume kIgnore.
- They are less opinionated about F16 and color space,
  we just trust the color space that's passed in, and
  put that directly in the image (no sRGB encoding).
- SkBitmap and SkPixmap read/write pixels functions were
  defaulting to kResepct, those are now always kIgnore.
- Many other bits of plumbing are simplified, and I
  added a default of kIgnore to SkImage::makeColorSpace,
  so we can phase out that argument entirely.
- Still need to add defaults to other public APIs that
  take SkTransferFunctionBehavior.

- This makes gold think that we've dramatically changed
  the contents of all F16 images, but that's because
  it doesn't understand the (now linear) color space
  that's embedded. Once we triage them all once, they
  will work fine (and they'll look perfect in the browser).

Bug: skia:
Change-Id: I62fa090f96cae1b67d181ce14bd91f34ff2ed747
Reviewed-on: https://skia-review.googlesource.com/140570
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-07-12 20:54:14 +00:00
Herb Derby
ff19d3473b Use simple buffers instead of vectors
Start using simple buffers, these will be used for
multiple runs latter on.

Change-Id: Iab0559d5a47eb5e54254a985051d5d25a91be69f
Reviewed-on: https://skia-review.googlesource.com/140791
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-07-12 19:24:34 +00:00
Mike Klein
9e229233a6 update SkColor4f::FromColor() to preserve transfer function
This kills off some sRGB tables,
and lots of call sites can now use SkColor4f::FromColor().

It doesn't seem important to keep this test.

Change-Id: Ia79ec8ace45e80bbc7a1e33f560f59289e61b2fb
Reviewed-on: https://skia-review.googlesource.com/141046
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-07-12 19:19:28 +00:00
Ben Wagner
e346b1eea4 Add SkTypeface::getVariationDesignParameters
This adds a way for users to query the axis parameters for a typeface.

Change-Id: Idc2ac0d84bc7ae2ca484ae410cba5b01883418e5
Reviewed-on: https://skia-review.googlesource.com/137706
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-07-12 17:30:20 +00:00
Brian Osman
f494bd2ebb Update SRGBReadWritePixelsTest again, to only test opaque colors
With our new world (never doing linear blending), the read-back
conversion from premul sRGB to premul linear no longer produces the same
answer. By always using opaque pixels, the existing check functions in
this test can continue to verify that the sRGB <-> linear conversion is
happening correctly during read/write, independent of any color space
transformation (which is now altering the outcome).

Bug: skia:
Change-Id: Id8e28b3bc4b9674043bd870a39d229207ccdc6d7
Reviewed-on: https://skia-review.googlesource.com/140987
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-07-12 15:24:58 +00:00
Brian Osman
fe76395c4d Remove SK_LEGACY_GPU_PIXEL_OPS tests
Bug: skia:
Change-Id: I12ba9199845a43c8e070454093b744eed272a548
Reviewed-on: https://skia-review.googlesource.com/140981
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-07-12 14:45:28 +00:00
Brian Osman
91b5a7690f In RGBA444TextureTest, use valid premul colors
In both the 565 and 4444 tests, we use a repeating pattern of two 16-bit
values. Neither of these were valid premul colors in 4444, and the first
one (FF00) had zero alpha. With upcoming changes to format conversion,
that may need to be unpremul'd and premul'd during readPixels, causing
this test to fail.

Change-Id: Idbf0f8162d6f68ca2b70ede8c48f788f4379d414
Reviewed-on: https://skia-review.googlesource.com/140799
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-07-12 14:05:08 +00:00
Herb Derby
fd77fe5d06 Use new SkGlyphIDSet - v3
v1 - had problems with msan and unintialized glyphs.
v2 - had problems with typefaces with no glyphs in them

This adds a check to make sure there are glyphs in the font
when going to uniquify.

Change-Id: Id27fa4578be33da1e468b4652db19740ddcadfc6
Reviewed-on: https://skia-review.googlesource.com/140785
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-07-12 05:47:37 +00:00
Ben Wagner
2c312c4f58 Remove SkDrawFilter.
Change-Id: I0204a9522e828c87bb7c6c20ae34ce51161442af
Reviewed-on: https://skia-review.googlesource.com/137895
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-07-12 02:36:44 +00:00
Brian Salomon
238069b3f5 Reland "Make GPU cache invalidation SkMessageBus messages go to one GrContext."
This is a reland of f4c5bb9aba

Original change's description:
> Make GPU cache invalidation SkMessageBus messages go to one GrContext.
> 
> Makes it so the template param to SkMessageBus must implement:
> bool shouldSend(uint32_t inboxID) const
> 
> Updates all GPU backend message types to only go to the GrContext that
> is adding a cache entry.
> 
> Bug: skia:
> Change-Id: I3e8a4eb90654b7b8ac57cac9fb508c0ef1d51058
> Reviewed-on: https://skia-review.googlesource.com/140220
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

Bug: skia:
Change-Id: I8402bfe3ed0170c99936d47050458817030b473b
Reviewed-on: https://skia-review.googlesource.com/140801
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-07-11 20:36:38 +00:00
Ben Wagner
97c6a0ee41 Remove interal use of SkRefCnt_SafeAssign.
It turns out that SkDeviceProfile is no longer used and can just be
deleted. The ResourceCacheTest and DebugGLTestContext are changed to use
smart pointers where possible. This also clarifies the squirrelly part of
the test. DebugGLTestContext is going away soon anyway.

Change-Id: I95ef24afa58aa4d356429b93d4dec0d72e3fd827
Reviewed-on: https://skia-review.googlesource.com/140577
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-07-11 20:31:18 +00:00
Mike Klein
4eebd9eed0 collapse parametric_{r,g,b} into parametric, remove _a and gamma_dst
parametric_a and gamma_dst were unused outside of unit tests.

In all other cases, we always use parametric_{r,g,b} together
and always pass them the same argument.  So we can collapse
them into a single stage like gamma and to/from_srgb.

Change-Id: I08cea896c7744f97b4f4bf9e029f5d643e45e177
Reviewed-on: https://skia-review.googlesource.com/140576
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-07-11 20:14:38 +00:00
Herb Derby
c0a2708172 Revert "Use new SkGlyphIDSet - v2"
This reverts commit 0421083a44.

Reason for revert: fushia page fault

Original change's description:
> Use new SkGlyphIDSet - v2
> 
> Add bzero to make msan and valgrind happy.
> 
> Change-Id: I9b4e2f2b8e690da4b4b920fef27d5a8854092219
> Reviewed-on: https://skia-review.googlesource.com/140563
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=mtklein@google.com,herb@google.com

Change-Id: I4e5e16644cbf56b5ff0b21afd6f3962e3976a1da
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/140803
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-07-11 20:08:23 +00:00
Herb Derby
ba38320804 Revert "Use simple buffers instead of vectors"
This reverts commit b188da121c.

Reason for revert: Patch on a rollback

Original change's description:
> Use simple buffers instead of vectors
> 
> Start using simple buffers, these will be used for
> multiple runs latter on.
> 
> Change-Id: I8dadbed036b7a60d708c49b84bb5e3bb3710f704
> Reviewed-on: https://skia-review.googlesource.com/140578
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=mtklein@google.com,herb@google.com

Change-Id: I51d9ad9bc0fd7efb93e5db4dc504d8dc31e7cfb4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/140802
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-07-11 20:03:19 +00:00
Brian Salomon
143cf8e599 Revert "Make GPU cache invalidation SkMessageBus messages go to one GrContext."
This reverts commit f4c5bb9aba.

Reason for revert: Accidentally submitted without CQ

Original change's description:
> Make GPU cache invalidation SkMessageBus messages go to one GrContext.
> 
> Makes it so the template param to SkMessageBus must implement:
> bool shouldSend(uint32_t inboxID) const
> 
> Updates all GPU backend message types to only go to the GrContext that
> is adding a cache entry.
> 
> Bug: skia:
> Change-Id: I3e8a4eb90654b7b8ac57cac9fb508c0ef1d51058
> Reviewed-on: https://skia-review.googlesource.com/140220
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

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

Change-Id: Iadb667d8027341703d254325320ddaa528fb33a1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/140800
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-07-11 20:01:28 +00:00
Brian Salomon
f4c5bb9aba Make GPU cache invalidation SkMessageBus messages go to one GrContext.
Makes it so the template param to SkMessageBus must implement:
bool shouldSend(uint32_t inboxID) const

Updates all GPU backend message types to only go to the GrContext that
is adding a cache entry.

Bug: skia:
Change-Id: I3e8a4eb90654b7b8ac57cac9fb508c0ef1d51058
Reviewed-on: https://skia-review.googlesource.com/140220
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-07-11 20:00:11 +00:00
Herb Derby
b188da121c Use simple buffers instead of vectors
Start using simple buffers, these will be used for
multiple runs latter on.

Change-Id: I8dadbed036b7a60d708c49b84bb5e3bb3710f704
Reviewed-on: https://skia-review.googlesource.com/140578
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-07-11 19:51:32 +00:00
Hal Canary
d4998178ae Whitespace Fixup
Change-Id: I6c4c4b43dfa6b59832c63f8fcf43192b4973d88b
Reviewed-on: https://skia-review.googlesource.com/140565
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-07-11 19:27:58 +00:00
Brian Osman
28f8393e19 Only generate valid premul test data in SRGBReadWritePixels test
Change-Id: I9ca830b2bcf3341b06bc4e261dba40809b452194
Reviewed-on: https://skia-review.googlesource.com/140572
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-07-11 18:53:38 +00:00
Jim Van Verth
061cc21b61 Add more tests for PolyUtils
* Add fuzzer
* Add bench tests
* Add additional unit test
* Fix some bugs these exposed.

Bug: skia:
Change-Id: I6c587c92cb6cff32ab8300020b78f9f247d2bf64
Reviewed-on: https://skia-review.googlesource.com/139169
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-07-11 18:37:38 +00:00
Herb Derby
0421083a44 Use new SkGlyphIDSet - v2
Add bzero to make msan and valgrind happy.

Change-Id: I9b4e2f2b8e690da4b4b920fef27d5a8854092219
Reviewed-on: https://skia-review.googlesource.com/140563
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-07-11 16:08:58 +00:00
Cary Clark
1857ddbe21 propogate simple angles in pathops
If an edge is unsortable, its winding value is untrustworthy;
it cannot be added to the output on that alone. If one end
adjoins a trusted edge, and that edge is added to the output,
the untrusted edge can be added as well.

Also add in msvs debugging for angles.

With this change, all extended tests pass.

TBR=reed@google.com

Bug: skia:8125
Change-Id: I049c6efa2fa83edd7b49cdd598ec94c356481b0f
Reviewed-on: https://skia-review.googlesource.com/140562
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-07-11 15:30:28 +00:00
Brian Osman
532b3f944a Remove clamping of kPlus with F16 configs
The most common use-case for F16 is to draw things that are explicitly
outside of [0,1]. We can't prevent out-of-range values in general, users
could just draw out-of-range content in src mode. We've decided that
it's best to avoid surprising behavior, and trust the user in these
situations.

This effectively reverts https://skia-review.googlesource.com/c/skia/+/48183

Bug: skia:
Change-Id: I71c2dd925c567e2862d96ab70c752f19245a69c4
Reviewed-on: https://skia-review.googlesource.com/140500
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-07-11 14:30:58 +00:00
Brian Osman
c87cfb674b Remove old lazy image decoding heuristic logic
This led to removing a lot of transfer function behavior code. There is
more that could be done, and we need to add in decoding to dst color
space, but this CL is almost entirely mechanical.

Change-Id: I91b2169f95aadcfaacdd2b9821bb1a01ce53f9a6
Reviewed-on: https://skia-review.googlesource.com/140349
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-07-11 14:07:08 +00:00
Herb Derby
83a355d698 Revert "Use new SkGlyphIDSet"
This reverts commit 819f73c23c.

Reason for revert: uninitialized memory - this is expected but

Original change's description:
> Use new SkGlyphIDSet
> 
> Change-Id: I6b8080393a22a56577528f66630ad39372edf712
> Reviewed-on: https://skia-review.googlesource.com/140243
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,herb@google.com

Change-Id: I43e204520710738e9e8c84b0eb00260ca06fe6a2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/140384
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-07-10 22:59:26 +00:00
Herb Derby
819f73c23c Use new SkGlyphIDSet
Change-Id: I6b8080393a22a56577528f66630ad39372edf712
Reviewed-on: https://skia-review.googlesource.com/140243
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-07-10 22:15:05 +00:00
Cary Clark
1d314433ff fix line intersect divide by zero
Test filinmangust14 exposes two problems:
- finding top of contour can expose divide by zero
- joining partial contour results can add diagonal

The latter makes the test return the wrong result,
and has not been seen in other tests. The fix
is to join disconnected contours by only following
the contours provided as input. Working on that.

The former bug is more straight-forward; just
don't try to compute axis-aligned intersection
if the denominator is zero.

All existing tests prior to the new one work
with this change.

R=caryclark@google.com
Bug: skia:8125
Change-Id: Ic878d090066708d9baca8475f27d4d5aba2294cc
Reviewed-on: https://skia-review.googlesource.com/140121
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
2018-07-10 15:25:35 +00:00
Robert Phillips
c100d48e42 Expand testing of SkMatrix::decomposeScale
Bug: skia:7211
Change-Id: If03ad1d364b33e174d91010ca250cd6c2d2f67c2
Reviewed-on: https://skia-review.googlesource.com/140185
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-07-10 15:01:11 +00:00
Herb Derby
45e27c8eed Remove run list code
Temporarily remove run list code to gut some
overly complicated code.

Change-Id: Ib12efc394c05dee391143b440b2fab5bba4f22ae
Reviewed-on: https://skia-review.googlesource.com/139865
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-07-10 14:57:55 +00:00
Brian Salomon
653f42f72a Deinline some GrPathRenderer method and one GrDrawingMananger method.
Removes circular dependencies from coming change.

Some IWYU fallout from removing #includes from GrPathRenderer.h and
GrDrawingManager.h

Bug: skia:
Change-Id: Ice377538e6d64b6a74a59e6140e1de9a58ab99bf
Reviewed-on: https://skia-review.googlesource.com/140181
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-07-10 14:56:05 +00:00
Brian Osman
ccb21bffeb Add sRGB profile to mandrill images
Bug: skia:
Change-Id: Ic0e0ae23c88f86885583a304d90d1ce874ff14ed
Reviewed-on: https://skia-review.googlesource.com/139960
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-07-09 23:02:39 +00:00
Brian Salomon
c3833b4c15 Revert "Add genIDs from all contributing elements to GrReducedClip's mask key."
This reverts commit 1354048c8f.

Reason for revert: tsan/valgrind failures


Original change's description:
> Add genIDs from all contributing elements to GrReducedClip's mask key.
> 
> Change-Id: I3fed124ba3fefd1ef82acdb4ace9531d0c89ad8b
> Reviewed-on: https://skia-review.googlesource.com/138586
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,csmartdalton@google.com

Change-Id: Ia5bc098309cd02baf46f03d8ff17fabbd383481e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/139920
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-07-09 18:24:08 +00:00
Brian Salomon
1354048c8f Add genIDs from all contributing elements to GrReducedClip's mask key.
Change-Id: I3fed124ba3fefd1ef82acdb4ace9531d0c89ad8b
Reviewed-on: https://skia-review.googlesource.com/138586
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-07-09 14:54:16 +00:00
Brian Osman
a50205fca5 Add color type to the image filter DAG's OutputProperties
Don't try to guess the pixel config to use for intermediates. Instead,
just make the intermediates in the same color type (and space) as the
final destination. This removes some no-longer-correct logic that was
using sRGB configs, resulting in linear blending and precision loss.

Change-Id: I627c47193a9f2889c3dc121170ff3e7d5d315fa0
Reviewed-on: https://skia-review.googlesource.com/139547
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-07-06 18:34:58 +00:00
Jim Van Verth
6784ffa78e Add some new PolyUtils tests.
Also:
* clean up PolyUtils checks to be correct and consistent.
* fix some bugs discovered by the unit tests.

Bug: skia:
Change-Id: I1a8e07d13cb44fecc67344154dc1002f3f910f5d
Reviewed-on: https://skia-review.googlesource.com/138592
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-07-03 23:10:27 +00:00
Greg Daniel
108bb23277 Reland "Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors."
This reverts commit 34aa059c15.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors."
> 
> This reverts commit ff2181e62e.
> 
> Reason for revert: suspect it's behind Chrome roll failure
> 
> Original change's description:
> > Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors.
> > 
> > Bug: skia:
> > Change-Id: I1466668e3502cd1e6e1f6aed4105e0f626d293dd
> > Reviewed-on: https://skia-review.googlesource.com/138987
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: I4cba44858aafffbadc45e18349b93c741d7cfc66
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/139220
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

Bug: skia:
Change-Id: Ib1fd10c126862824f3e31c420c697ac749c637f5
Reviewed-on: https://skia-review.googlesource.com/139221
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-07-03 20:46:27 +00:00
Ethan Nicholas
34aa059c15 Revert "Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors."
This reverts commit ff2181e62e.

Reason for revert: suspect it's behind Chrome roll failure

Original change's description:
> Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors.
> 
> Bug: skia:
> Change-Id: I1466668e3502cd1e6e1f6aed4105e0f626d293dd
> Reviewed-on: https://skia-review.googlesource.com/138987
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: I4cba44858aafffbadc45e18349b93c741d7cfc66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/139220
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-07-03 16:38:45 +00:00
Greg Daniel
ff2181e62e Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors.
Bug: skia:
Change-Id: I1466668e3502cd1e6e1f6aed4105e0f626d293dd
Reviewed-on: https://skia-review.googlesource.com/138987
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-07-03 13:41:13 +00:00
Stephen White
24289e05d5 GrTessellator: handle three consecutive collinear edges.
In some cases, splitting may produce three consecutive edges which
are collinear. The first one was being merged out, causing the third
one to be missed.

The fix is to switch the arguments to merge_edges_*, ensuring that the
second parameter (the destination edge) is never merged out.

Bug: 851409
Change-Id: I65be2e8222846c99f7bc8d17ea61ddead617cc31
Reviewed-on: https://skia-review.googlesource.com/138700
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-07-02 21:03:43 +00:00
Brian Osman
9aa30c6ee0 Remove sRGB config checks based on color space
All of the restrictions/assumptions that led to this code are gone,
so we can always use appropriate color space.

For the YUV provider, if/when we re-introduce 8888 sRGB, the color
space will have a linear transfer function, so the color space
xform will automatically do what was happening here. That removes
the last usage of framebuffer sRGB control, so we can remove all
kinds of GrPaint and GrPipeline plumbing for that feature.

Change-Id: I24af1d498dbc75210f92f8c61b10aa31eec022f6
Reviewed-on: https://skia-review.googlesource.com/138986
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-07-02 20:13:52 +00:00
Brian Salomon
d818ebf4a3 Revert "Some scissor state cleanup."
This reverts commit a219419c9d.

Reason for revert: breaking things
Original change's description:
> Some scissor state cleanup.
> 
> Separate flushing the enablement of scissor from the rect in GrGLGpu.
> 
> Move GrPipeline::ScissorState to a global enum and use more broadly.
> Rename to GrScissorTest to avoid name conflict with existing
> GrScissorState.
> 
> Change-Id: Ib32160b3300bc12de2d2e1761d152fd1bba8b683
> Reviewed-on: https://skia-review.googlesource.com/137395
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com

Change-Id: If71a5c5efc86d4239b40675bad2a6cb1f77460f8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/138900
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-07-02 14:09:01 +00:00
Brian Salomon
a219419c9d Some scissor state cleanup.
Separate flushing the enablement of scissor from the rect in GrGLGpu.

Move GrPipeline::ScissorState to a global enum and use more broadly.
Rename to GrScissorTest to avoid name conflict with existing
GrScissorState.

Change-Id: Ib32160b3300bc12de2d2e1761d152fd1bba8b683
Reviewed-on: https://skia-review.googlesource.com/137395
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-07-02 13:46:30 +00:00
Mike Klein
a898f04e68 Revert "GrTessellator: handle three consecutive collinear edges."
This reverts commit 26bb0e66f2.

Reason for revert: segfaulty

Here's a log with a stacktrace:

https://chromium-swarm.appspot.com/task?id=3e658f7aa40dbb10&refresh=10

Original change's description:
> GrTessellator: handle three consecutive collinear edges.
> 
> In some cases, splitting may produce three consecutive edges which
> are collinear. The first one was being merged out, causing the third
> one to be missed.
> 
> The fix is to switch the arguments to merge_edges_*, ensuring that the
> second parameter (the destination edge) is never merged out.
> 
> Bug: 851409.
> Change-Id: I70fbbc506e97a26b259c1443b6d1787adec0f9b0
> Reviewed-on: https://skia-review.googlesource.com/138561
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Stephen White <senorblanco@chromium.org>

TBR=robertphillips@google.com,senorblanco@chromium.org

Change-Id: I6ecfb4c487d6f96e9fae7b8b40d74162354ed57c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 851409.
Reviewed-on: https://skia-review.googlesource.com/138640
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-06-29 18:26:18 +00:00
Stephen White
26bb0e66f2 GrTessellator: handle three consecutive collinear edges.
In some cases, splitting may produce three consecutive edges which
are collinear. The first one was being merged out, causing the third
one to be missed.

The fix is to switch the arguments to merge_edges_*, ensuring that the
second parameter (the destination edge) is never merged out.

Bug: 851409.
Change-Id: I70fbbc506e97a26b259c1443b6d1787adec0f9b0
Reviewed-on: https://skia-review.googlesource.com/138561
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-06-29 18:02:27 +00:00
Jim Van Verth
8664a1d7d7 Add ear-clipping code to triangulate simple polygons.
Use this to fill concave shadows.

Bug: skia:7971
Change-Id: I63dc1ed845f9fa3fcd86f1ad13b03da23cae0313
Reviewed-on: https://skia-review.googlesource.com/135200
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-06-29 13:29:57 +00:00
Timothy Liang
036fdfe5aa implemented getting format from texture as virtual in gpu caps
Bug: skia:
Change-Id: If6bbbd212ff472ea322d2bbed61995fe7ba85df7
Reviewed-on: https://skia-review.googlesource.com/138240
Commit-Queue: Timothy Liang <timliang@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-06-28 20:21:17 +00:00
Stephen White
3de40f8bee GrTessellator: handle collinear final vertex.
If the last vertex in a contour is collinear with its neighbours,
remove it (this edge case was missing). Otherwise, the simplify step
may try to split it indefinitely.

Bug: 851409
Change-Id: I7efa4e616cdc1508a73c7a9f3de9d3f571569af8
Reviewed-on: https://skia-review.googlesource.com/138106
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-06-28 14:07:47 +00:00
Robert Phillips
385804514e Revert "Remove drawTextBlob from device use drawGlyphRunList"
This reverts commit e2e52e46ca.

Reason for revert: See if this is blocking the Chrome roll

Original change's description:
> Remove drawTextBlob from device use drawGlyphRunList
> 
> Convert all backends to use GlyphRunList instead of
> text blobs. If the device did not originally implement
> drawTextBlob it will be simulated by drawPosText on the
> device.
> 
> Other changes:
> Change to using an origin from absolulte positioning. The GPU
> code uses origin change to update blobs under translation.
> 
> Change cluster to use const uint32_t instead of just
> uint32_t.
> 
> Add SkPaint to runs.
> 
> The draw filter is hosted up to the canavas level and applied there.
> 
> Change-Id: Ib105b6bd26b67db55f1c954e37c79fbdcaa9d4a2
> Reviewed-on: https://skia-review.googlesource.com/137224
> Reviewed-by: Herb Derby <herb@google.com>
> Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
> Reviewed-by: Hal Canary <halcanary@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=jvanverth@google.com,halcanary@google.com,bungeman@google.com,herb@google.com,reed@google.com,khushalsagar@chromium.org,khushalsagar@google.com

Change-Id: I4d93a534990c89deee7d3aaa00ec40d47e0d2ece
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/138120
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-06-28 12:00:47 +00:00
Herb Derby
e2e52e46ca Remove drawTextBlob from device use drawGlyphRunList
Convert all backends to use GlyphRunList instead of
text blobs. If the device did not originally implement
drawTextBlob it will be simulated by drawPosText on the
device.

Other changes:
Change to using an origin from absolulte positioning. The GPU
code uses origin change to update blobs under translation.

Change cluster to use const uint32_t instead of just
uint32_t.

Add SkPaint to runs.

The draw filter is hosted up to the canavas level and applied there.

Change-Id: Ib105b6bd26b67db55f1c954e37c79fbdcaa9d4a2
Reviewed-on: https://skia-review.googlesource.com/137224
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-28 03:36:16 +00:00
Jim Van Verth
3645bb069d Fix some shadow issues.
* Clamp path polygon points to nearest 1/16th of a pixel to help
  with floating point issues.
* Added check for multiple contour paths.
* Return empty SkVertices for certain degenerate cases to avoid
  unnecessary blurs.
* Check iteration count in SkOffsetPolygon to avoid infinite loops.
* Add new tests to verify these.

Bug: skia:
Change-Id: Ie6ad48d2504e065dcc822609d369f90c56ef3ad3
Reviewed-on: https://skia-review.googlesource.com/136701
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-06-26 20:28:55 +00:00
Mike Klein
3785471ff6 basic first pass at RGBA F32 support
Draws basically the same as f16.

The existing load_f32, load_f32_dst, and store_f32 stages all had the
same bug that we'd never noticed because dy was always 0 until now.

Change-Id: Ibbd393fa1acc5df414be4cdef0f5a9d11dcccdb3
Reviewed-on: https://skia-review.googlesource.com/137585
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-06-26 19:02:52 +00:00
Leon Scroggins III
a57488a1f5 Expose public factories for platform decoders
Bug: skia:8076

Move SkImageGeneratorCG and SkImageGeneratorWIC to include/ports/,
and make them SK_API.

Remove SkImageGeneratorCG::NewFromEncodedCG. No known clients are using
it, and it was a private API in src/. There is already a
MakeFromEncodedCG to replace it.

Similarly, switch WIC from New to Make.

Add a compile test for using them with
SetImageGeneratorFromEncodedDataFactory.

Change-Id: I897eb7a887b3736a6c614a68e38f38b6a1942cf1
Reviewed-on: https://skia-review.googlesource.com/137387
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-06-26 17:30:52 +00:00
Brian Salomon
493489054f Refactor GrPipeline dynamic state.
Remove scissor rect from GrPipeline.

Draws can specify "fixed dynamic state" which doesn't use the dynamism at
all or can specify dynamic state arrays with an entry per GrMesh.

When we state other than scissor rects this will allow the caller to
use a mix of truly dynamic and fixed dynamic state. So a caller that
only has dynamic scissor rects doesn't need to store its remaining
unvarying state in an array.

Change-Id: I8fcc07eb600c72a26cc712b185755c2116021a8a
Reviewed-on: https://skia-review.googlesource.com/137223
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-06-26 15:35:12 +00:00
Leon Scroggins III
665949a3ec Update libjpeg-turbo to pre-2.0.0 (from 1.5.3)
jpeg_skip_scanlines was incorrectly incrementing an internal counter,
resulting in an infinite loop. (This only occurs for certain types of
progressive images, using certain sample sizes.)

The fix is at 26f109290d.
This is included in tip-of-tree, which is unofficially 2.0.0, so go ahead and
update to it.

Add a test based on the original bug.

Bug: b/78329453
Change-Id: I5ade9924812324d58668c26f71cd622ef93f40a7
Reviewed-on: https://skia-review.googlesource.com/129459
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-26 15:22:12 +00:00
Bruce Wang
536ad2c146 Implement onMakeClone function on all subclasses of SkTypeface except
on mac.

Change-Id: I2b8777a5b54e190c37623ab798a89b4f1833ceac
Reviewed-on: https://skia-review.googlesource.com/137382
Commit-Queue: Bruce Wang <brucewang@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-25 20:42:25 +00:00
Brian Salomon
ff168d9258 Put GrPrimitiveProcessor/GrGeometryProcessor before GrPipeline in param lists.
We were inconsistent about which order these were in. Having the processor first
will make the parameter order more logical for an upcoming change. Also, the primitive
processor comes logically before the pipeline.

Change-Id: I3968c5e4e6dff01f9c4ad311eb1795b3c7580ff5
Reviewed-on: https://skia-review.googlesource.com/137228
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-06-25 17:55:45 +00:00
Herb Derby
ed55419d85 Use indices into the vectors shared by runs
With multiple runs, the shared vectors were moving out from
under the pointers in earlier runs.

Change-Id: I486d2e603e18ea7effc0dbdbc7c5d3c545278703
Reviewed-on: https://skia-review.googlesource.com/137222
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-25 16:05:25 +00:00
Chris Dalton
a2b5b6467f ccpr: Enable ccpr by default
Now that the path cache is implemented, we can use ccpr everywhere.

Modifies ccpr to not cache unless the "fAllowPathMaskCaching" context
option is enabled.

Adds a small condition to skip complicated paths with more vertices
than pixels, simply so we don't regress a couple testcases.

Updates skpbench to do three draws before starting the timer, in order
to prime the cache.

Bug: skia:
Change-Id: Ic3a0a2bdad8a22ff6431e77fa4da2b54d6bb9aba
Reviewed-on: https://skia-review.googlesource.com/137207
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-25 01:47:14 +00:00
Mike Reed
73be50da2a flush to zero tiny radii
Bug: 850350
Change-Id: If1f8efdb02782d520195a6b66bd159628c89f811
Reviewed-on: https://skia-review.googlesource.com/137220
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-06-22 21:13:57 +00:00
Ben Wagner
37a06c063c Reland "Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig."
This reverts commit cce82d2b7c.

Reason for revert: Just add suppression.

Original change's description:
> Revert "Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig."
>
> This reverts commit 96b1ecc25d.
>
> Reason for revert: Breaking Google3, I think
>
> Original change's description:
> > Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig.
> >
> > Create FontMgrFontConfigTest.cpp file to test the above function.
> >
> > Change-Id: I7716355f702af3d6f25574305914f0b82a4147ce
> > Reviewed-on: https://skia-review.googlesource.com/137133
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Ben Wagner <bungeman@google.com>
>
> TBR=bungeman@google.com,herb@google.com,brucewang@google.com
>
> Change-Id: I665de46d379f1b533358f0be644814aa4bfffb33
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/137240
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

TBR=bungeman@google.com,herb@google.com,kjlubick@google.com,brucewang@google.com

Change-Id: I41f0e4505ed0579a77a56212898e9a6caf6f1ed5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/137260
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-22 21:12:58 +00:00
Kevin Lubick
cce82d2b7c Revert "Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig."
This reverts commit 96b1ecc25d.

Reason for revert: Breaking Google3, I think

Original change's description:
> Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig.
> 
> Create FontMgrFontConfigTest.cpp file to test the above function.
> 
> Change-Id: I7716355f702af3d6f25574305914f0b82a4147ce
> Reviewed-on: https://skia-review.googlesource.com/137133
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

TBR=bungeman@google.com,herb@google.com,brucewang@google.com

Change-Id: I665de46d379f1b533358f0be644814aa4bfffb33
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/137240
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2018-06-22 21:07:38 +00:00
Chris Dalton
a8429cf8fd ccpr: Cache paths with >=50% visibility
Adds a hit count to cache entries. Paths now don't get stashed until
their second hit (and cached on their third). Mostly-visible, cachable
paths render their entire mask on the second hit, in hopes that we
will be able to cache them alongside the fully visible ones.

Bug: skia:
Change-Id: Idd18f5dc3090f13531f630d229f4808198695fea
Reviewed-on: https://skia-review.googlesource.com/136541
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-06-22 20:44:17 +00:00
Bruce Wang
96b1ecc25d Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig.
Create FontMgrFontConfigTest.cpp file to test the above function.

Change-Id: I7716355f702af3d6f25574305914f0b82a4147ce
Reviewed-on: https://skia-review.googlesource.com/137133
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-06-22 17:49:27 +00:00
Stephen White
13f3d8d4bc GrTessellator: avoid split with zero primary and out-of-range secondary.
Sometimes the intersector will return an intersection which is on the
same primary sort criterion (eg., Y coordinate), but out-of-range on the
secondary. We shouldn't do splits in this case. The only case we really
care about is if it's less than one epsilon and greater than zero,
and thus numerically unsplittable.

Bug: 851914
Change-Id: Ia772763b6a66a14ca159cf409a832835244e83bc
Reviewed-on: https://skia-review.googlesource.com/136803
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-06-22 15:27:57 +00:00
Herb Derby
b9177cfaa8 Add SkGlyphRunList - v2
Extend the glyph run system with a glyph run list. This
allows the processing of text blobs.

Add original text an cluster to runs for PDF.

PS - the original had read off the end of a buffer problem.

Change-Id: I9430f0c27aaa3d9458bfe3caba5f433b72fdf84c
Reviewed-on: https://skia-review.googlesource.com/136792
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-22 15:26:17 +00:00
Brian Salomon
9457546761 Alternative fix for stale MIP maps on texture export/import.
This change assumes imported textures in SkImages have dirty mip levels
and disables regenerating the MIP levels on export (added in
https://skia.googlesource.com/skia/+/930f939c48af1be6005af12bb6f709ca5da9d118).

This is being done temporarily because it is a simpler change to cherry
pick to earlier branches than
https://skia.googlesource.com/skia/+/930f939c48af1be6005af12bb6f709ca5da9d118

Bug: chromium:850617
Change-Id: I7c90da782a0ed9014acd6a54ffdee1a0b34fa00c
Reviewed-on: https://skia-review.googlesource.com/136788
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-06-21 22:17:04 +00:00
Herb Derby
149b541d88 Revert "Add SkGlyphRunList"
This reverts commit f2e4a039df.

Reason for revert: Breaks asan tests

Original change's description:
> Add SkGlyphRunList
> 
> Extend the glyph run system with a glyph run list. This
> allows the processing of text blobs.
> 
> Add original text an cluster to runs for PDF.
> 
> Change-Id: If4867d000e45f8975a30e982fc8fdbe104ef4332
> Reviewed-on: https://skia-review.googlesource.com/135627
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=bungeman@google.com,herb@google.com

Change-Id: I903592714da901383efc7e5f47ce3dfd529e2aca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/136761
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-21 20:03:07 +00:00
Herb Derby
5c0c7983bb Use local strike caches to avoid flaky test behavior
The remote glyph cache tests assume that the strike cache will not
change during a test. This is not true because other test also
mutate the strike cache. This is causing flaky tests.

 BUG=skia:8091

Change-Id: I397d411f9412006715f6860941dfb05ad54ae1b6
Reviewed-on: https://skia-review.googlesource.com/136741
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-21 19:49:27 +00:00
Herb Derby
c113e9e23d Make SkStrikeCache::Validate call non global version
Change Validate to ValidateGlyphCacheDataSize. Make it call a
non-global version.

BUG=skia:8091

Change-Id: Iec31a06569a0ab1ec318e693e699a808eb9ad247
Reviewed-on: https://skia-review.googlesource.com/136638
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-21 19:22:27 +00:00
Herb Derby
f2e4a039df Add SkGlyphRunList
Extend the glyph run system with a glyph run list. This
allows the processing of text blobs.

Add original text an cluster to runs for PDF.

Change-Id: If4867d000e45f8975a30e982fc8fdbe104ef4332
Reviewed-on: https://skia-review.googlesource.com/135627
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-21 19:11:47 +00:00
Mike Reed
9ffe3dc245 add test for wacky conic edges (disabled for now)
Bug: 850350
Change-Id: Ib73c27da14a74ec6e3b5c04c2f5c9dd7e2462f1c
Reviewed-on: https://skia-review.googlesource.com/136601
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-06-21 16:37:33 +00:00
Bruce Wang
37b6109cde Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_AndroidSystem.
Add FontMgrAndroidSystemVariableTypeface test to test the above
function.

Change-Id: I36a2f65550784a86feecc6ef69a870a33e973804
Reviewed-on: https://skia-review.googlesource.com/136248
Commit-Queue: Bruce Wang <brucewang@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-21 16:32:28 +00:00
Herb Derby
960d421fb9 Revert "Make SkRemoteGlyphCache tests use private glyph cache"
This reverts commit 3e36ce6e66.

Reason for revert: Too much verification

Original change's description:
> Make SkRemoteGlyphCache tests use private glyph cache
> 
> Change-Id: If6aa189f3badc7558ab8ecf71ee3d704b275b20f
> Reviewed-on: https://skia-review.googlesource.com/136225
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,herb@google.com

Change-Id: Ia0c096abd0ab651bc7c907f0595af4f07c88fb5e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/136478
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-21 12:44:28 +00:00
Brian Salomon
930f939c48 Ensure that textures exported via SkImage::MakeBackendTextureFromSkImage
have consistent content in their mip map levels.

Bug= chromium:850617

Change-Id: I3ad918aa453bd8e4e625eb145de6ba2a5dab7b0c
Reviewed-on: https://skia-review.googlesource.com/136230
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-06-20 21:13:27 +00:00
Herb Derby
3e36ce6e66 Make SkRemoteGlyphCache tests use private glyph cache
Change-Id: If6aa189f3badc7558ab8ecf71ee3d704b275b20f
Reviewed-on: https://skia-review.googlesource.com/136225
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-20 20:24:47 +00:00
Brian Salomon
92be2f74db Revert "Revert "Change how vertex/instance attributes are handled in geometry processors.""
This reverts commit 5045e501d2.

TBR=csmartdalton@google.com

Change-Id: Ifbf5f1d8f8ef340fdc69653e931b6d68d4bf0854
Reviewed-on: https://skia-review.googlesource.com/135862
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-06-19 20:01:29 +00:00
Robert Phillips
c994a93b32 Move op memory storage to GrContext (take 2)
TBR=bsalomon@google.com

Change-Id: I4a448694d4114d83cd3a720cfc8bd37de51733d1
Reviewed-on: https://skia-review.googlesource.com/135707
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-06-19 19:51:20 +00:00
Florin Malita
80452bee11 Fold SkJSON into Skia/utils
It's a tiny, core-ish component -- might as well treat as such to
simplify dependencies.

Change-Id: I6f31ce2d151f9a629d88bfc7f15d64891d5150c0
Reviewed-on: https://skia-review.googlesource.com/135780
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-19 18:23:30 +00:00
Kevin Lubick
f203078309 Revert "added GrSkSLFP and converted DitherEffect to use it"
This reverts commit dfbfc738a9.

Reason for revert: Seems to be breaking DDL/ASAN bots

Original change's description:
> added GrSkSLFP and converted DitherEffect to use it
>
> Bug: skia:
> Change-Id: I84b71165eab1712355f3c7669cee2d33d259f3df
> Reviewed-on: https://skia-review.googlesource.com/124504
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,ethannicholas@google.com

Change-Id: Ic4c3978aaba0391f2f8bb1316a456e3821a3a2f2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/135700
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-06-19 12:23:21 +00:00
Ben Wagner
f08d1d0ce1 Stop using SkTSwap.
Use std::swap instead. It does not appear that any external user
specializes SkTSwap, but some may still use it. This removes all use in
Skia so that SkTSwap can later be removed in a smaller CL. After that
the <utility> include can be removed from SkTypes.h.

Change-Id: If03d4ee07dbecda961aa9f0dc34d171ef5168753
Reviewed-on: https://skia-review.googlesource.com/135578
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-06-19 02:06:31 +00:00
Mike Klein
5045e501d2 Revert "Change how vertex/instance attributes are handled in geometry processors."
This reverts commit 19c1233c44.

Reason for revert: want to make sure Google3 can roll

Original change's description:
> Change how vertex/instance attributes are handled in geometry processors.
> 
> * No longer register vertex/instance attributes on base class, just counts
> 
> * Separate instance and vertex attributes and remove InputRate and offset
> 
> * Make attributes constexpr where possible
> 
> Change-Id: I1f1d5e772fa177a96d2aeb805aab7b69f35bfae6
> Reviewed-on: https://skia-review.googlesource.com/132405
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com

Change-Id: I4800632515e14fbf54af52826928ac915657b59f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/135661
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-06-19 01:41:10 +00:00
Ethan Nicholas
dfbfc738a9 added GrSkSLFP and converted DitherEffect to use it
Bug: skia:
Change-Id: I84b71165eab1712355f3c7669cee2d33d259f3df
Reviewed-on: https://skia-review.googlesource.com/124504
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-18 18:40:58 +00:00
Mike Klein
e72e773ad0 remove SkTCast
SkTCast is functionally equivalent to reinterpret_cast.

The comment about SkTCast helping to avoid strict alising issues is not
true.  Dereferencing a pointer cast to a pointer of an unrelated type is
always undefined, even if smuggled through a union like in SkTCast.

To really avoid aliasing issues, you need to make a union[1] of the two
value types, or better, memcpy between values.  I've had to fix
MatrixText.cpp where switching to reinterpret_cast actually let Clang
notice and warn that we're exploiting undefined behavior, and
GrSwizzle.h and SkCamera.cpp caught by GCC.

I've switched SkTLList over to use SkAlignedSTStorage, which seems
to help convince some GCC versions that fObj is used in a sound way.

[1] The union punning trick is non-standard in C++, but GCC and MSVC
both explicitly support it.  I believe Clang does not officially
explicitly support it, but probably does quietly for GCC compatibility.

Change-Id: I71822e82c962f9aaac8be24d3c0f39f4f8b05026
Reviewed-on: https://skia-review.googlesource.com/134947
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-18 17:22:18 +00:00
Brian Salomon
19c1233c44 Change how vertex/instance attributes are handled in geometry processors.
* No longer register vertex/instance attributes on base class, just counts

* Separate instance and vertex attributes and remove InputRate and offset

* Make attributes constexpr where possible

Change-Id: I1f1d5e772fa177a96d2aeb805aab7b69f35bfae6
Reviewed-on: https://skia-review.googlesource.com/132405
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-06-18 17:13:58 +00:00
Chris Dalton
4da70190aa ccpr: Implement path mask caching
Implement caching as follows:

1) Instead of deleting the mainline ccpr atlas when finished, stash it
   away from flush to flush.

2) On subsequent flushes, check the stashed atlas to see if we can
   reuse any of its cachable paths. Copy reusable paths into 8-bit
   literal coverage atlases and store them in the resource cache.

3) Recycle the stashed atlas texture for the remaining paths in the
   flush.

Bug: skia:
Change-Id: I9b20fbea708646df1df3a5f9c044e2299706b989
Reviewed-on: https://skia-review.googlesource.com/134703
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-06-18 16:14:28 +00:00
Mike Klein
e475d016d9 remove stray SkTLList includes
Change-Id: I63ba2424bd70f53c14d15bb332a585881d2c4613
Reviewed-on: https://skia-review.googlesource.com/135451
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-06-18 15:52:58 +00:00
Chris Dalton
4c458b12f6 ccpr: Use lazy proxies with GrCCAtlas
Bug: skia:
Change-Id: I576d9303d451352778de0425e3ecbc561331cd09
Reviewed-on: https://skia-review.googlesource.com/135362
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-06-18 15:32:48 +00:00
Cary Clark
1bb47df4fc fast path for pathops
Add faster path for simple but common path ops:
- intersect two rects
- all ops where one operand is empty

R=halcanary@google.com

Bug: skia:8049
Change-Id: I2a516d095feae8478ee9433262c9c77e5e18ce81
Reviewed-on: https://skia-review.googlesource.com/132929
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-06-18 13:30:38 +00:00
Ben Wagner
b0897650f1 Reland "Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines."
This reverts commit ab17347df3.

Reason for revert: Chromium should now be ok.

Original change's description:
> Revert "Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines."
>
> This reverts commit e1bc7de7c0.
>
> Reason for revert: chrome used it
>
> Original change's description:
> > Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines.
> >
> > sed 's/SK_MaxSizeT/SIZE_MAX/g'
> > sed 's/SK_MaxU32/UINT32_MAX/g'
> > sed 's/SK_MaxU16/UINT16_MAX/g'
> >
> > SK_MinU32 and SK_MinU16 were unused
> >
> > Change-Id: I6b6c824df47b05bde7e73b13a58e851a5f63fe0e
> > Reviewed-on: https://skia-review.googlesource.com/134607
> > Commit-Queue: Hal Canary <halcanary@google.com>
> > Reviewed-by: Ben Wagner <bungeman@google.com>
>
> TBR=halcanary@google.com,bungeman@google.com,reed@google.com
>
> Change-Id: I1e2c440dcf9f59bf87c1fea113248cd5136f7519
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/134921
> Reviewed-by: Hal Canary <halcanary@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-ozone-rel
TBR=halcanary@google.com,bungeman@google.com,reed@google.com

Change-Id: I7709f9715bea0463b85b5b0a89712ac1020fcddb
Reviewed-on: https://skia-review.googlesource.com/135180
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-15 16:26:05 +00:00
Robert Phillips
4f6ba2e522 Revert "Move op memory storage to GrContext"
This reverts commit c8cee446bf.

Reason for revert: TSAN issues

Original change's description:
> Move op memory storage to GrContext
> 
> TBR=bsalomon@google.com
> Change-Id: Ifa95bf0073b9d948f2c937d10088b7734b971f90
> Reviewed-on: https://skia-review.googlesource.com/131500
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Ia0d2b7408314d9b67d57388315376bbea23d3780
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/135181
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-06-15 15:59:45 +00:00
Robert Phillips
c8cee446bf Move op memory storage to GrContext
TBR=bsalomon@google.com
Change-Id: Ifa95bf0073b9d948f2c937d10088b7734b971f90
Reviewed-on: https://skia-review.googlesource.com/131500
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-06-15 11:33:14 +00:00
Hal Canary
ab17347df3 Revert "Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines."
This reverts commit e1bc7de7c0.

Reason for revert: chrome used it

Original change's description:
> Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines.
> 
> sed 's/SK_MaxSizeT/SIZE_MAX/g'
> sed 's/SK_MaxU32/UINT32_MAX/g'
> sed 's/SK_MaxU16/UINT16_MAX/g'
> 
> SK_MinU32 and SK_MinU16 were unused
> 
> Change-Id: I6b6c824df47b05bde7e73b13a58e851a5f63fe0e
> Reviewed-on: https://skia-review.googlesource.com/134607
> Commit-Queue: Hal Canary <halcanary@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: I1e2c440dcf9f59bf87c1fea113248cd5136f7519
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/134921
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-14 16:17:38 +00:00
Hal Canary
c640d0dc96 Revert "Revert "SkTypes: extract SkTo""
This reverts commit fdcfb8b7c2.

> Original change's description:
> > SkTypes: extract SkTo
> >
> > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
> > Reviewed-on: https://skia-review.googlesource.com/133620
> > Reviewed-by: Mike Klein <mtklein@google.com>

Change-Id: Ida74fbc5c21248a724a5edbf9fae18a33bcb23aa
Reviewed-on: https://skia-review.googlesource.com/134506
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-14 14:55:17 +00:00
Hal Canary
e1bc7de7c0 Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines.
sed 's/SK_MaxSizeT/SIZE_MAX/g'
sed 's/SK_MaxU32/UINT32_MAX/g'
sed 's/SK_MaxU16/UINT16_MAX/g'

SK_MinU32 and SK_MinU16 were unused

Change-Id: I6b6c824df47b05bde7e73b13a58e851a5f63fe0e
Reviewed-on: https://skia-review.googlesource.com/134607
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-14 14:10:47 +00:00
Mike Klein
b6b5b7a808 Reland "simplify SkTFitsIn, try 2"
This is a reland of 009f51e43f

Original change's description:
> simplify SkTFitsIn, try 2
> 
> Originally we wrote this in C++14 constexpr,
> but because this is used from public headers, we can't use
> C++14 yet.  Now a somewhat sillier looking C++11 version.
> 
> All the old tests still pass, and one new added.
> Updated the comments a bit for correctness and readability.
> 
> Change-Id: I99c01e1346c1a5a36278cc08f30538112e5259aa
> Reviewed-on: https://skia-review.googlesource.com/134425
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Auto-Submit: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: I99676faac6153830538c1396a325ca1456dfb126
Reviewed-on: https://skia-review.googlesource.com/134800
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-06-14 14:05:27 +00:00
Brian Osman
f018b7d607 SkColorSpaceXformSteps improvements and tests
Added some helper functions and put the booleans in a nested struct
(this is motivated by upcoming changes). Added a unit test of steps
against skcms, with round-tripping in both combinations.

Change-Id: Iea3d60cd52edb5259b5576b1422ed6f856cde815
Reviewed-on: https://skia-review.googlesource.com/134660
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-06-14 11:30:47 +00:00
Mike Klein
e4b900bfd9 Revert "simplify SkTFitsIn, try 2"
This reverts commit 009f51e43f.

Reason for revert: unintentional header consequences in Chromium... will reland after fixing Chromium

Original change's description:
> simplify SkTFitsIn, try 2
> 
> Originally we wrote this in C++14 constexpr,
> but because this is used from public headers, we can't use
> C++14 yet.  Now a somewhat sillier looking C++11 version.
> 
> All the old tests still pass, and one new added.
> Updated the comments a bit for correctness and readability.
> 
> Change-Id: I99c01e1346c1a5a36278cc08f30538112e5259aa
> Reviewed-on: https://skia-review.googlesource.com/134425
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Auto-Submit: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: Ic73f8800bd022ffea125b3b1bf138fe49c0db926
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/134621
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-06-13 18:57:06 +00:00
Greg Daniel
da86e2822a Remove unused code that was used for late mip allocations.
This also includes removing code to support changing GrGpuResource's size
since we now have to way to ever change the size.

Bug: skia:
Change-Id: Id27a8bc3cc94f5b954beda528b209727ede10ef6
Reviewed-on: https://skia-review.googlesource.com/134503
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-13 18:06:56 +00:00