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>
Added a GM that demonstrates the bug. Should draw a blur with
the center masked out, and a circular blurry shape that's
roughly the inverse. On raster, this was already the result.
On GPU, the blurred/eroded layer becomes a subset with an
origin other than (0,0), and that layer was shifted.
I *think* this is the correct fix - we are including 'offset'
in the texture matrices, but that's just based on the crop
rects and adjustments from each filter. We still need to adjust
the texture coords for the subsets themselves.
Bug: chromium:905548
Change-Id: I19c936adad90311aef243a9395a270d2e015df2f
Reviewed-on: https://skia-review.googlesource.com/c/173321
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
-- lots more where this came from
Bug: skia:2664
Change-Id: I8bb47f02c156b0b88fbb92fec73af0eb6641b1bf
Reviewed-on: https://skia-review.googlesource.com/c/173769
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This reverts commit 1a2476d294.
Reason for revert: Fixes printf signatures and asserts.
Original change's description:
> Revert "Initial definition of fill rect op"
>
> This reverts commit d3c92d9a36.
>
> Reason for revert: printf build failure on gcc, assert failures on CQ
>
> Original change's description:
> > Initial definition of fill rect op
> >
> > Bug: skia:
> > Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924
> > Reviewed-on: https://skia-review.googlesource.com/c/163486
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
>
> Change-Id: Ib32f91a39d91aeb87982a7b19719485e4a1bf8ae
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/173233
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
Change-Id: I415913a269ba5bcdebd169b5ebc3510673247bfd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/173234
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This reverts commit d3c92d9a36.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Initial definition of fill rect op
>
> Bug: skia:
> Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924
> Reviewed-on: https://skia-review.googlesource.com/c/163486
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
Change-Id: Ib32f91a39d91aeb87982a7b19719485e4a1bf8ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/173233
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:
Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924
Reviewed-on: https://skia-review.googlesource.com/c/163486
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
These aren't testing Skia core functionality
Bug: skia:7518
Change-Id: Ib564dc7b0aa8f137c2c40141fa5d7e9a1bfe4d64
Reviewed-on: https://skia-review.googlesource.com/c/172968
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This was based on old ideas about color management. We have better
mechanisms for testing this now.
Bug: skia:
Change-Id: If59b5039f31ab0ebbdbed4205c941dd9266f67c1
Reviewed-on: https://skia-review.googlesource.com/c/172860
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>
I was sampling near the edge of the stroke, not the middle of it,
so some configs were picking up antialiased pixels.
Bug: skia:
Change-Id: I46314ba0bafe056505037deaa8dd32f4f68119f6
Reviewed-on: https://skia-review.googlesource.com/c/172503
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
p3_ovals GM exercises four different oval ops. Before, they all drew
wrong in extended range GPU configs. Now, they all draw correctly.
Bug: skia:
Change-Id: I4ea803b6325bfd20e9361880b1822cc6f0441cea
Reviewed-on: https://skia-review.googlesource.com/c/172480
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The V0 version of this will use the product of the "global" and per-quad
alpha.
A new V1 version is added that does not take a global alpha.
The V0 version will be removed once SkiaRenderer no longer uses it.
Bug: skia:8563
Change-Id: Iace3dff6c4f1fd1a5c6c30eb8226f4815c58e0ed
Reviewed-on: https://skia-review.googlesource.com/c/172146
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Bug: skia:7903
Change-Id: I41ee31ad3657aee372e22ec3e7a0a317e31b2791
Reviewed-on: https://skia-review.googlesource.com/c/171007
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
In most places we were using 0.25 (maximum distance between the actual
and approximated curves). In these few places, we were using 0.5, which
is enough to produce visible errors.
Added a GM that demonstrated the problem as reported - many of the arcs
with radius ~8 were previously closer to round-rects than circles.
Bug: chromium:888453
Change-Id: I7d22e27773f56174861526dd0223f52a93bf48eb
Reviewed-on: https://skia-review.googlesource.com/c/172060
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:
Change-Id: Ie681369ef4b1d3d43c326da684afde9ce6d08486
Reviewed-on: https://skia-review.googlesource.com/c/171726
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Fixes an issue where negative scales caused an inset rather than an outset.
Add GM.
Bug: chromium:899512
Change-Id: I9164c76da479af80d4f5389b057ec52a946726fb
Reviewed-on: https://skia-review.googlesource.com/c/171641
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
GrRenderTargetOpList maintains an array of op chains. When it receives a
new op it tries to add it to an existing chain, working backwards from
the end of the current array. If the op can be added to a chain it
additionally tries to merge the new op with ops already in the chain
before adding it to the tail of the chain.
In forward combining it tries to concatenate chains. If chains can
concatenate it also attempts to merge ops between the two chains.
Now op chaining results reported by Op subclasses must be transitive.
Moreover, if op A is able to merge with B then it must be the case that
any op that can chain with A will either merge or chain with any op that
can chain to B.
Bug: skia:8491
Change-Id: Ib6a2a669acd4257134a37d271289b8b3f247cd3f
Reviewed-on: https://skia-review.googlesource.com/c/170351
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>