As currently written, some code paths trigger a return, which
inadvertently avoids the "let's run the same test again on full decodes"
at the bottom of the function.
Bug: skia:
Change-Id: I89a06ec6398099d2bfa3b0e81bb9077a28a7f096
Reviewed-on: https://skia-review.googlesource.com/144241
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Prior to this commit, the test would finish (and pass) with a correct
SkCodec implementation, but could infinite loop (instead of finish with
failure) with an incorrect implementation.
Bug: skia:
Change-Id: I89e8cfef9837c50e83a23e67a40204a9478a17cb
Reviewed-on: https://skia-review.googlesource.com/144740
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Move peek[Surface|Texture|RenderTarget]() from GrSurfaceProxyPriv to
to GrSurfaceProxy.
Move proxyMipMapped(), textureType(), and hasRestrictedSampling()
from GrTextureProxyPriv to GrTextureProxy.
Change-Id: I259114d0508c4613d55f7f1faccac362fa6fb281
Reviewed-on: https://skia-review.googlesource.com/144641
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Create new header and namespace, `SkUTF` where we are putting all of our
robust, well documented UTF-8, UTF-16, and UTF-32 functions:
`SkUTF::{Count,Next,To}UTF{8,16,32}()`.
SkUTF.h and SkUTF.cpp do not depend on the rest of Skia and are suitable
for re-use in other modules.
Some of the old UTF-{8,16} functions still live in SkUtils.h; their use
will be phased out in future CLs.
Also added more unit testing and cleaned up old tests.
Removed functions that were unused outside of tests or used only once.
Change-Id: Iaa59b8705abccf9c4ba082f855da368a0bad8380
Reviewed-on: https://skia-review.googlesource.com/143306
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Fold its functionality into GrPrimitiveProcessor and GrFragmentProcessor.
Make each have its own TextureSampler nested class. Currently the only
difference is that fragment processors lose the ability to inject their
samplers into the vertex shader. However, this facilitates refactoring
GrPrimitiveProcessor's TextureSampler class such that the textures are
specified separately from the TextureSampler.
Bug: skia:
Change-Id: I1e590187e7a6ae79ee3147155d397fcdcf5e4619
Reviewed-on: https://skia-review.googlesource.com/142814
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Instead store sampler count on base class and subclasses implement a
virtual to get the ith sampler.
Change-Id: I13e2447a6467a09761d8615acb4aa360b87b1476
Reviewed-on: https://skia-review.googlesource.com/141563
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Removes flag indicating rectangle or external as its now redundant.
Bug: skia:
Change-Id: Ia475b557390e7a6b0f19f6e189cf8c27090e397c
Reviewed-on: https://skia-review.googlesource.com/144346
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: I3fbb4d27b728e5fc5ecec9fc9d9e215dd5a83359
Reviewed-on: https://skia-review.googlesource.com/144123
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
This allows us to identify clockwise-winding triangles, in terms of
Skia device space, in all backends and with all render target origins.
Bug: skia:
Change-Id: I220e1c459e0129d1cc4dee6458ef94277fbedd21
Reviewed-on: https://skia-review.googlesource.com/142662
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This is a reland of 01d6fc9d84
Chrome layout tests have been suppressed so this shouldn't block a Skia roll.
Original change's description:
> Go back to cleaning up MIP levels on texture export rather than assuming dirty
> on texture import.
>
> Bug: skia:8155
> Change-Id: I23399f442d52c73906829132f798eda260b6d4ae
> Reviewed-on: https://skia-review.googlesource.com/143291
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:8155
Change-Id: Ia3843b66c2453daf15e566b7ecf890c2ff4aed22
Reviewed-on: https://skia-review.googlesource.com/143960
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Having the glyph run list be const as it passes through the stack means
that future change can't be introduced in the device code that changes
behavior. Try to force all text changes into the SkGylphRun system.
Change-Id: I9412bc094c7adb8554887c725a6264af306e1d42
Reviewed-on: https://skia-review.googlesource.com/143702
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
In some cases, two edges can be collinear when tested on one side
(e.g., left top vs right edge), but non-collinear when tested on the
other (e.g., right top vs left edge). We were actually merging based
on one criterion, but assserting based on the other.
The safest fix is to merge if either condition is true, and then
assert that both conditions are false.
Bug: 866319
Change-Id: Ia1be330caf62f6d7961746752f73993ca098d0a3
Reviewed-on: https://skia-review.googlesource.com/143501
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
SkColorSpace::MakeSRGB().get() is scary, and causes more ref/unref
pairs than strictly necessary for these singletons.
This time the implementation is still in SkColorSpace.cpp,
so these should really work as singletons.
Change-Id: I40f2942c8dcde3040663a04c4f5330aca90868ae
Reviewed-on: https://skia-review.googlesource.com/143305
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit 01d6fc9d84.
Reason for revert: layout tests.
Original change's description:
> Go back to cleaning up MIP levels on texture export rather than assuming dirty
> on texture import.
>
> Bug: skia:8155
> Change-Id: I23399f442d52c73906829132f798eda260b6d4ae
> Reviewed-on: https://skia-review.googlesource.com/143291
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: Ice4cb4e253e52d67eb8bd6e2a12ccc844b7bfa8d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8155
Reviewed-on: https://skia-review.googlesource.com/143380
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Testing using serialization PaintOpPerfTest, this had the following
improvement in serialization speed:
Before: ~515,000 ops/s
After: ~600,000 ops/s
R=herb@google.com
Change-Id: Iefd80467ea4ff7cc88e8ca1f431883502d249857
Reviewed-on: https://skia-review.googlesource.com/142972
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
on texture import.
Bug: skia:8155
Change-Id: I23399f442d52c73906829132f798eda260b6d4ae
Reviewed-on: https://skia-review.googlesource.com/143291
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Some tests isolated from GrShapes_arcs do not
fail gracefully, so make sure errors are properly
handled.
TBR=reed@google.com
Bug: skia:
Change-Id: Ia8c9903e64ef755ec11c398df3e5d258ca1f5f8b
Reviewed-on: https://skia-review.googlesource.com/143112
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
This is a reland of 946c37057f
Original change's description:
> Reland "Add some optimizations to PolyUtils"
>
> This is a reland of 8bb0db3d07
>
> Original change's description:
> > Add some optimizations to PolyUtils
> >
> > * Switch inset/offset code to use a linked list rather than an array
> > * Use std::set to store active edge list for IsSimplePolygon rather than array
> > * Pre-alloc the priority queue for IsSimplePolygon
> > * When adding radial curves, expand the array all at once rather than pushing
> > one at a time.
> >
> > Bug: skia:
> > Change-Id: I692f8c29c500c41ec1d1be39d924d8a752676bf4
> > Reviewed-on: https://skia-review.googlesource.com/140787
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Jim Van Verth <jvanverth@google.com>
>
> Bug: skia:
> Change-Id: I3f5d42cfb941deab2b28bed020b37ce199e91d3d
> Reviewed-on: https://skia-review.googlesource.com/142200
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:
Change-Id: I598d4be9108d009d0f885cfa72bf9197fc286b3a
Reviewed-on: https://skia-review.googlesource.com/142920
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: chromium:862921
Change-Id: I5f3584ad36e160a5a09d0a37e31e147155076b4d
Reviewed-on: https://skia-review.googlesource.com/142586
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
The SKTextBlob serialization code that is tested by Skia is
unused by Chrome. The serialization code that is
used by Chrome is untested by Skia.
Remove the unused code; test the used code.
The code path introduced nearly a year ago,
likely for slimming paint, attempts to make
text blobs smarter by allowing the reuse of typefaces.
Maybe there needs to be a Chrome bug / feature
request to use this?
If if turns out there is no interest to do so,
This CL aligns used interfaces with tests.
R=reed@google.com,fmalita@google.com,bungeman@google.com
Bug: skia:6818
Change-Id: I9b3ec0c326495322986ba26f20f901bcb208be73
Reviewed-on: https://skia-review.googlesource.com/141542
Reviewed-by: Cary Clark <caryclark@skia.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
This reverts commit 946c37057f.
Reason for revert: strict weak ordering: ((__x LT __y) && (__y LT __x)) != false
Original change's description:
> Reland "Add some optimizations to PolyUtils"
>
> This is a reland of 8bb0db3d07
>
> Original change's description:
> > Add some optimizations to PolyUtils
> >
> > * Switch inset/offset code to use a linked list rather than an array
> > * Use std::set to store active edge list for IsSimplePolygon rather than array
> > * Pre-alloc the priority queue for IsSimplePolygon
> > * When adding radial curves, expand the array all at once rather than pushing
> > one at a time.
> >
> > Bug: skia:
> > Change-Id: I692f8c29c500c41ec1d1be39d924d8a752676bf4
> > Reviewed-on: https://skia-review.googlesource.com/140787
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Jim Van Verth <jvanverth@google.com>
>
> Bug: skia:
> Change-Id: I3f5d42cfb941deab2b28bed020b37ce199e91d3d
> Reviewed-on: https://skia-review.googlesource.com/142200
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: Ie8cdf2375613c51dedaf0d11125d6d22d88821df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/142281
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This is a reland of 8bb0db3d07
Original change's description:
> Add some optimizations to PolyUtils
>
> * Switch inset/offset code to use a linked list rather than an array
> * Use std::set to store active edge list for IsSimplePolygon rather than array
> * Pre-alloc the priority queue for IsSimplePolygon
> * When adding radial curves, expand the array all at once rather than pushing
> one at a time.
>
> Bug: skia:
> Change-Id: I692f8c29c500c41ec1d1be39d924d8a752676bf4
> Reviewed-on: https://skia-review.googlesource.com/140787
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:
Change-Id: I3f5d42cfb941deab2b28bed020b37ce199e91d3d
Reviewed-on: https://skia-review.googlesource.com/142200
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 8bb0db3d07.
Reason for revert: Breaking Google3.
Original change's description:
> Add some optimizations to PolyUtils
>
> * Switch inset/offset code to use a linked list rather than an array
> * Use std::set to store active edge list for IsSimplePolygon rather than array
> * Pre-alloc the priority queue for IsSimplePolygon
> * When adding radial curves, expand the array all at once rather than pushing
> one at a time.
>
> Bug: skia:
> Change-Id: I692f8c29c500c41ec1d1be39d924d8a752676bf4
> Reviewed-on: https://skia-review.googlesource.com/140787
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: Ie8afecd899fa9bd79d22fdf46ec82a0c9e94e893
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/141980
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Switch inset/offset code to use a linked list rather than an array
* Use std::set to store active edge list for IsSimplePolygon rather than array
* Pre-alloc the priority queue for IsSimplePolygon
* When adding radial curves, expand the array all at once rather than pushing
one at a time.
Bug: skia:
Change-Id: I692f8c29c500c41ec1d1be39d924d8a752676bf4
Reviewed-on: https://skia-review.googlesource.com/140787
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
created new GMs for skinning
Bug: skia:
Change-Id: I15fb2bd02fba8beb6dd2dd3f3716da016ea92192
Reviewed-on: https://skia-review.googlesource.com/140241
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
It is unused. Remove it.
Change-Id: If62a93a58d21bfccd6df112e92a709bff4d11c97
Reviewed-on: https://skia-review.googlesource.com/141566
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
When three collinear edges occur during the sanitize_contours() pass,
their vertices may not yet have been discovered to be coincident. So
we must do the vertex comparison by point, rather than by pointer.
Bug: 860655
Change-Id: I89dc7526905bb5473206661348fee431371731a0
Reviewed-on: https://skia-review.googlesource.com/141523
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This reverts commit 9e229233a6.
Reason for revert: See if blocking Android roll
Original change's description:
> 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>
TBR=mtklein@chromium.org,brianosman@google.com
Change-Id: I9d76e4ccf8a101853a7404abb33bdab9e0c64c25
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/141181
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Have all the old code paths start using lists in preparation
for introducing text blobs.
Change-Id: I65cc02ee3da63bc3c9492db78a08b0eee3b1f931
Reviewed-on: https://skia-review.googlesource.com/141081
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Some "missing" intersections (see
https://skia.googlesource.com/skia/+/89042d5f13a56d6b663657aa58f17593123a344e)
cause the active edge list to go out of order. In that case, we need
to rewind the active list, just as we do before edge splitting for
regular intersections.
BUG=860453
Change-Id: I1f7b32157a73b427a4fd94c14c1eb440f26c0743
Reviewed-on: https://skia-review.googlesource.com/141038
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>