Moved named common transfer functions and gamuts to constexpr values in
SkColorSpace.h, in SkNamedTransferFn and SkNamedGamut namespaces.
Converted nearly all SkColorSpace::MakeRGB calls within Skia to use the
new factory with the named values. Multiple clients want a way to
extract named transfer function and gamut - this still doesn't provide
that, but this may be a better path forward for honestly advertising how
SkColorSpace works internally.
Originally landed as:
https://skia.googlesource.com/skia/+/a9549ab31630fc244094e6f1692371cbaf87f666
Re-landing with a new serialization format, but maintaining ability to
load old serialized color spaces, for SKP compatibility.
Bug: skia:
Change-Id: Ib84a6e1cd5d7d9816175773fdbaff2ca32658667
Reviewed-on: https://skia-review.googlesource.com/c/181176
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit a9549ab316.
Reason for revert: SKPs changed?
Original change's description:
> Add SkColorSpace factory from 3x3 row-major gamut and transfer function
>
> Moved named common transfer functions and gamuts to constexpr values in
> SkColorSpace.h, in SkNamedTransferFn and SkNamedGamut namespaces.
>
> Converted nearly all SkColorSpace::MakeRGB calls within Skia to use the
> new factory with the named values. Multiple clients want a way to
> extract named transfer function and gamut - this still doesn't provide
> that, but this may be a better path forward for honestly advertising how
> SkColorSpace works internally.
>
> Bug: skia:
> Change-Id: I9296d67e8f0dab5ceb49869cb3ba24e98a05f3c4
> Reviewed-on: https://skia-review.googlesource.com/c/180360
> Reviewed-by: Mike Klein <mtklein@google.com>
> 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: Ie888f877b3c1dba33e1a8c0f5fa92594628de7fb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/181300
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Moved named common transfer functions and gamuts to constexpr values in
SkColorSpace.h, in SkNamedTransferFn and SkNamedGamut namespaces.
Converted nearly all SkColorSpace::MakeRGB calls within Skia to use the
new factory with the named values. Multiple clients want a way to
extract named transfer function and gamut - this still doesn't provide
that, but this may be a better path forward for honestly advertising how
SkColorSpace works internally.
Bug: skia:
Change-Id: I9296d67e8f0dab5ceb49869cb3ba24e98a05f3c4
Reviewed-on: https://skia-review.googlesource.com/c/180360
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The cloud-build is now at a new enough Clang to find these.
Bug: skia:
Change-Id: Ib7cfecb7d79194dcdeca7c0cf22a9b2dbb8cb655
Reviewed-on: https://skia-review.googlesource.com/c/181162
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
trying to reduce casts at call-sites
Bug: skia:
Change-Id: I7c74cfd89111f7a197cbb1d77b499e2adc193579
Reviewed-on: https://skia-review.googlesource.com/c/180363
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Change-Id: I6e29e08a1bfaeafe98c8a61f8ce5c279839f4b3c
Reviewed-on: https://skia-review.googlesource.com/c/180301
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Like other image drawing, paint color is only used when drawing alpha
images, so I had to add a new GM to trigger the relevant code path.
That GM previously drew wrong (clipped color) in glenarrow, and now
draws correctly (matching enarrow).
Bug: skia:
Change-Id: I12c19c2afba29d5176b3ac60ef840d849107bb17
Reviewed-on: https://skia-review.googlesource.com/c/179987
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The function is inlined - the compiler can do whatever optimizations it
wants at each call-site. In the future, stride and uvOffset won't be
static (with optional wide colors), so this is required anyway.
Also, the pointer being passed in is never const, so stop cleverly
casting away the const-ness via reinterpret into and out of intptr_t.
Bug: skia:
Change-Id: I404c418a01d70ac77667ba89338940b086922dc6
Reviewed-on: https://skia-review.googlesource.com/c/179988
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The proxy/proxies in the SkImage_GpuBase subclasses already track
whether they're budgeted.
The parameters are sometimes redundantly stating the known budgeted
status of the proxy. Other times they are an illusion of control as
the value doesn't actually affected the budgeting of the proxy/proxies.
Change-Id: Ic2b12fbbed653fca1ec1910eeab686de69782834
Reviewed-on: https://skia-review.googlesource.com/c/179402
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
It's probably nicer to draw these images than not draw them.
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I9f8df081c8256d345ad2d8bbbb30dbad982ad94e
Reviewed-on: https://skia-review.googlesource.com/c/178981
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Gives the caller more predictable/reliable results, and allows GMs to be
a little sloppy about how they leave the canvas.
For normal saves, this isn't really significant. But if the gm left an
unbalanced saveLayer, then we can get wacky results... Before this CL:
- raster backend balanced because ~SkCanvas got called
- gpu backend was not balanced, all we did was call flush()
Bug: skia:
Change-Id: Id058351504876db22f9915e3db0f60970fa80e39
Reviewed-on: https://skia-review.googlesource.com/c/178927
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
There was an issue on Android where a client was drawing a small bit of text,
and then a large chunk of text below it. On the next frame they started fading
out the text and then swapped out all of the large chunk of text. We were not
marking the Plot containing the small bit of text as still in use in this case,
so it was getting overwritten by later uploads. That bug has been fixed,
but this GM tests that codepath.
Bug: b/118850208
Change-Id: I81b795d6b0ee5d5d0b8e380823a568a52118ed0c
Reviewed-on: https://skia-review.googlesource.com/c/178924
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: I6f588f1268cf79eb251a6819d306e423c8b8f53a
Reviewed-on: https://skia-review.googlesource.com/c/178264
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Herb Derby <herb@google.com>
We were shifting the verticies for the fallback subrun
twice when using paths to render. Once in regenerate,
and once using MapPoints.
BUG=chromium:913057
Change-Id: I4d2e977b0edbec22cbd57c45fe47c959d172908f
Reviewed-on: https://skia-review.googlesource.com/c/177920
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:
Change-Id: Ib39f74886c0edc655ded8ba1075e5205361ae650
Reviewed-on: https://skia-review.googlesource.com/c/176225
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
A stroked arc with round caps was batched with a filled circle. The circle op
code would choose a GeometryProcessor configuration that expected round cap
centers as vertex attributes. However, the tessellation code for the filled
circle would not put in dummy round cap centers and then didn't advance the
pointer into which vertex data was being written by the expected vertex
stride.
Bug: b/119394958
Change-Id: I6fe95b32d750599e775ed96e656757fe3087795a
Reviewed-on: https://skia-review.googlesource.com/c/177881
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This separates the existing convexity logic into
two passes. The first pass detects concavity by
counting the changes in direction.
The second pass computes the cross product to
see that all angles bend in the same direction, and
computes the dot product to see if the angle
doubles back on itself.
The second pass treats axis-aligned vectors
separately, and computes the dot and cross products
by comparing point values; it does not use arithmetic
to determine convexity, so it works with all finite
values.
A compile time switch enables returning concave
for co-linear diagonal points:
If successive points are not axis-aligned, and
those points are co-linear along a diagonal;
the path is treated as concave. This is conservative
but avoids paths that change convexity when the
are translated or scaled, since transforming the
path may cause the midpoint to shift to either
side of a line formed by the endpoints.
The compile time switch is set so that co-linear
diagonal points do not affect convexity. Note that
this permits shapes formerly considered concave, such
as stroked lines with round caps, to become convex;
this accounts for many of the GM differences.
A path may double back on itself and be convex;
for instance, a path containing a single line.
Path may have multiple initial moveTo verbs, or
trailing moveTo verbs, and still evaluate as convex.
A separate entry point, SkPathPriv::IsConvex()
allows passing an array of points instead of a path.
A legacy define has been checked into Chrome to
use the old code until layout tests have been
rebaselined.
R=reed@google.com,bsalomon@google.com
Bug:899689
Change-Id: I392bbe04836ffb19666ad92ab2a2404c56543019
Reviewed-on: https://skia-review.googlesource.com/c/173427
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
Bug: skia:6886
Change-Id: Ic184ef7e5dd76615f626581b897a3606c6241aa7
Reviewed-on: https://skia-review.googlesource.com/c/177001
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: Iee57bc970a026de2ad5a0758153e9cbb20753fa1
Reviewed-on: https://skia-review.googlesource.com/c/173105
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
likely will move this to SkFont soon
Bug: skia:
Change-Id: I53a6d9114c9e8768a50951e96284d10bda83285b
Reviewed-on: https://skia-review.googlesource.com/c/175434
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Bug: skia:7903
Change-Id: I77346b301777479694b051486d95d720d8fd179f
Reviewed-on: https://skia-review.googlesource.com/c/175360
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 10273c1d5f.
Reason for revert: bad gms
Original change's description:
> Use unnormalized coords all the way through with GL_TEXTURE_RECTANGLE textures.
>
> We used to unnormalize them in the shader via SkSL.
>
> This allows us to support GL_TEXTURE_RECTANGLE without having textureSize()
> available in GLSL.
>
> Change-Id: Ibe63a302228811933ef000251db4cad9aaf4f2ea
> Reviewed-on: https://skia-review.googlesource.com/c/174068
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: I9bf38e1040578becba28ac8cccd81e2af2844278
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/175252
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
We used to unnormalize them in the shader via SkSL.
This allows us to support GL_TEXTURE_RECTANGLE without having textureSize()
available in GLSL.
Change-Id: Ibe63a302228811933ef000251db4cad9aaf4f2ea
Reviewed-on: https://skia-review.googlesource.com/c/174068
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Thin conic dashes are treated as lines both if the
curvature is detected as zero, and if the midpoint
is close enough to the control point.
To fix:
Halve the midpoint to control point magic number.
Use quad max curvature as a placeholder for conic
max curvature.
R=reed@google.com,fmalita@chromium.org
Bug:843966
Change-Id: Ide43bef8767c03670ffd19fdc38c191d6e2332f3
Reviewed-on: https://skia-review.googlesource.com/c/129243
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>