Commit Graph

79 Commits

Author SHA1 Message Date
Tyler Denniston
cc04b6f0bf Revert "Reland "Reland "Omit inner join geometry when possible"""
This reverts commit 40dfc67917.

Reason for revert: same android CTS failures

Original change's description:
> Reland "Reland "Omit inner join geometry when possible""
>
> This reverts commit bdc412f149.
>
> Original change's description:
> > Revert "Reland "Omit inner join geometry when possible""
> >
> > This reverts commit 44edd1952a.
> >
> > Reason for revert: problematic gold diffs (e.g. paths-data-10-t) and androit CTS failures
> >
> > Original change's description:
> > > Reland "Omit inner join geometry when possible"
> > >
> > > This is a reland of 1b0a95e0ee
> > >
> > > Original change's description:
> > > > Omit inner join geometry when possible
> > > >
> > > > There is some relatively cheap math we can do to determine easy cases
> > > > when the inner join geometry can be skipped. This CL is not
> > > > comprehensive in that there may be other cases where we can skip the
> > > > geometry.
> > > >
> > > > Only handling miter joins in this CL - the other join types can likely
> > > > have similar logic, but will require a bit more computation to compute
> > > > the inner (reflected) miter point.
> > > >
> > > > Misc notes:
> > > > - Added SK_LEGACY_INNER_JOINS ifdef in the event that clients depend on
> > > >   the old behavior.
> > > > - Modified stroker to track "previous previous" point, which is the
> > > >   start point of the previous line segment.
> > > >
> > > > Bug: b/165379671, skia:11964
> > > > Change-Id: I56789e85a2b4627c32f2a30fe60e47d448e9adf3
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404717
> > > > Reviewed-by: Mike Reed <reed@google.com>
> > > > Commit-Queue: Tyler Denniston <tdenniston@google.com>
> > >
> > > Bug: b/165379671, skia:11964
> > > Change-Id: If8bf183db9379d0a98a6f88e70f871a559692a60
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423821
> > > Reviewed-by: Tyler Denniston <tdenniston@google.com>
> > > Commit-Queue: Tyler Denniston <tdenniston@google.com>
> >
> > TBR=reed@google.com,tdenniston@google.com
> >
> > Change-Id: I5a2dfd402269db6c788f0e0625f67e9bf3b1f5cf
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: b/165379671, skia:11964
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426059
> > Reviewed-by: Tyler Denniston <tdenniston@google.com>
> > Commit-Queue: Tyler Denniston <tdenniston@google.com>
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: b/165379671, skia:11964
> Change-Id: Icfd420954a291f414fc2cb5cc2fe2756224a5d8d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436518
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>

TBR=reed@google.com,tdenniston@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ifbca34b8ff836aee6b517f58cbf05cf0aa38eace
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/165379671, skia:11964
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436567
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-08-04 20:29:09 +00:00
Tyler Denniston
40dfc67917 Reland "Reland "Omit inner join geometry when possible""
This reverts commit bdc412f149.

Original change's description:
> Revert "Reland "Omit inner join geometry when possible""
>
> This reverts commit 44edd1952a.
>
> Reason for revert: problematic gold diffs (e.g. paths-data-10-t) and androit CTS failures
>
> Original change's description:
> > Reland "Omit inner join geometry when possible"
> >
> > This is a reland of 1b0a95e0ee
> >
> > Original change's description:
> > > Omit inner join geometry when possible
> > >
> > > There is some relatively cheap math we can do to determine easy cases
> > > when the inner join geometry can be skipped. This CL is not
> > > comprehensive in that there may be other cases where we can skip the
> > > geometry.
> > >
> > > Only handling miter joins in this CL - the other join types can likely
> > > have similar logic, but will require a bit more computation to compute
> > > the inner (reflected) miter point.
> > >
> > > Misc notes:
> > > - Added SK_LEGACY_INNER_JOINS ifdef in the event that clients depend on
> > >   the old behavior.
> > > - Modified stroker to track "previous previous" point, which is the
> > >   start point of the previous line segment.
> > >
> > > Bug: b/165379671, skia:11964
> > > Change-Id: I56789e85a2b4627c32f2a30fe60e47d448e9adf3
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404717
> > > Reviewed-by: Mike Reed <reed@google.com>
> > > Commit-Queue: Tyler Denniston <tdenniston@google.com>
> >
> > Bug: b/165379671, skia:11964
> > Change-Id: If8bf183db9379d0a98a6f88e70f871a559692a60
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423821
> > Reviewed-by: Tyler Denniston <tdenniston@google.com>
> > Commit-Queue: Tyler Denniston <tdenniston@google.com>
>
> TBR=reed@google.com,tdenniston@google.com
>
> Change-Id: I5a2dfd402269db6c788f0e0625f67e9bf3b1f5cf
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: b/165379671, skia:11964
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426059
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>

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

Bug: b/165379671, skia:11964
Change-Id: Icfd420954a291f414fc2cb5cc2fe2756224a5d8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436518
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-08-04 16:44:11 +00:00
Michael Ludwig
9cd9d0f3de Fix nearly flat edge detection in GrTriangulator
Adds a GM reproducing triangulator failure. The stroker generated
geometry shown in the GM had two edges intersecting on the inner
contour. One of the edges was practically vertical, such that its top
and bottom vertices X coordinates differed by 1ulp (approx 4.8e-7 when
x = 7.5). The intersection was computed correctly in double but then
clamped to exactly 7.5 when stored back in float at (7.5, ~11), which
is still a reasonable intersection point along the edge represented
by (7.5,0) to (7.5000048,~68).

However, with a sorting direction of horizontal for the vertices,
vertices are sorted on increasing x and then *decreasing* y. The
computed intersection is then technically above the edge's top
vertex. In the original code, the edge was not considered flat, so
it assumes that the intersection vertex is below the top vertex
and above the bottom vertex.

The issue was with the nearly_flat function only checking the difference
against machine epsilon without taking the magnitude of the vertices
into account. However, just changing nearly_flat to use ulp instead of
epsilon led to infinite recursion and asserts on a number of tests due
to inaccuracies in edge intersection tests. To address these issues,
I reworked clamp() to work on X and Y independently, which avoids the
need to check nearly_flat entirely. Additionally, edge intersection
detects when it might be inaccurate due to really large vertex coords
and recursively splits to reject false positives.

Bug: skia:12244
Change-Id: I9a92a163e8c53af799332f1f9369fccd3a9fbf31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/432196
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-08-03 20:45:40 +00:00
Tyler Denniston
bdc412f149 Revert "Reland "Omit inner join geometry when possible""
This reverts commit 44edd1952a.

Reason for revert: problematic gold diffs (e.g. paths-data-10-t) and androit CTS failures

Original change's description:
> Reland "Omit inner join geometry when possible"
>
> This is a reland of 1b0a95e0ee
>
> Original change's description:
> > Omit inner join geometry when possible
> >
> > There is some relatively cheap math we can do to determine easy cases
> > when the inner join geometry can be skipped. This CL is not
> > comprehensive in that there may be other cases where we can skip the
> > geometry.
> >
> > Only handling miter joins in this CL - the other join types can likely
> > have similar logic, but will require a bit more computation to compute
> > the inner (reflected) miter point.
> >
> > Misc notes:
> > - Added SK_LEGACY_INNER_JOINS ifdef in the event that clients depend on
> >   the old behavior.
> > - Modified stroker to track "previous previous" point, which is the
> >   start point of the previous line segment.
> >
> > Bug: b/165379671, skia:11964
> > Change-Id: I56789e85a2b4627c32f2a30fe60e47d448e9adf3
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404717
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Tyler Denniston <tdenniston@google.com>
>
> Bug: b/165379671, skia:11964
> Change-Id: If8bf183db9379d0a98a6f88e70f871a559692a60
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423821
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>

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

Change-Id: I5a2dfd402269db6c788f0e0625f67e9bf3b1f5cf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/165379671, skia:11964
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426059
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-07-08 22:14:00 +00:00
Tyler Denniston
44edd1952a Reland "Omit inner join geometry when possible"
This is a reland of 1b0a95e0ee

Original change's description:
> Omit inner join geometry when possible
>
> There is some relatively cheap math we can do to determine easy cases
> when the inner join geometry can be skipped. This CL is not
> comprehensive in that there may be other cases where we can skip the
> geometry.
>
> Only handling miter joins in this CL - the other join types can likely
> have similar logic, but will require a bit more computation to compute
> the inner (reflected) miter point.
>
> Misc notes:
> - Added SK_LEGACY_INNER_JOINS ifdef in the event that clients depend on
>   the old behavior.
> - Modified stroker to track "previous previous" point, which is the
>   start point of the previous line segment.
>
> Bug: b/165379671, skia:11964
> Change-Id: I56789e85a2b4627c32f2a30fe60e47d448e9adf3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404717
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>

Bug: b/165379671, skia:11964
Change-Id: If8bf183db9379d0a98a6f88e70f871a559692a60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423821
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-07-08 13:14:32 +00:00
Tyler Denniston
1700f865c5 Revert "Omit inner join geometry when possible"
This reverts commit 1b0a95e0ee.

Reason for revert: breaking g3, other downstream expectations

Original change's description:
> Omit inner join geometry when possible
>
> There is some relatively cheap math we can do to determine easy cases
> when the inner join geometry can be skipped. This CL is not
> comprehensive in that there may be other cases where we can skip the
> geometry.
>
> Only handling miter joins in this CL - the other join types can likely
> have similar logic, but will require a bit more computation to compute
> the inner (reflected) miter point.
>
> Misc notes:
> - Added SK_LEGACY_INNER_JOINS ifdef in the event that clients depend on
>   the old behavior.
> - Modified stroker to track "previous previous" point, which is the
>   start point of the previous line segment.
>
> Bug: b/165379671, skia:11964
> Change-Id: I56789e85a2b4627c32f2a30fe60e47d448e9adf3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404717
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>

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

Change-Id: I812b39a327606b094cd22fb04b8765afc60ac722
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/165379671, skia:11964
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423583
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-06-30 21:29:19 +00:00
Tyler Denniston
1b0a95e0ee Omit inner join geometry when possible
There is some relatively cheap math we can do to determine easy cases
when the inner join geometry can be skipped. This CL is not
comprehensive in that there may be other cases where we can skip the
geometry.

Only handling miter joins in this CL - the other join types can likely
have similar logic, but will require a bit more computation to compute
the inner (reflected) miter point.

Misc notes:
- Added SK_LEGACY_INNER_JOINS ifdef in the event that clients depend on
  the old behavior.
- Modified stroker to track "previous previous" point, which is the
  start point of the previous line segment.

Bug: b/165379671, skia:11964
Change-Id: I56789e85a2b4627c32f2a30fe60e47d448e9adf3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404717
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-06-30 19:52:42 +00:00
Tyler Denniston
966fb69e5d Add gm for inner join geometry
These paths trigger cases where we know we must add the inner join
geometry.

Bug: skia:11964
Change-Id: I9c66baf6a9f9fda55911651adae01ba1a22b3aa2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408156
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-05-25 14:21:11 +00:00
John Stiles
7571f9e490 Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'.
Mechanically updated via Xcode "Replace Regular Expression":

  typedef (.*) INHERITED;
    -->
  using INHERITED = $1;

The ClangTidy approach generated an even larger CL which would have
required a significant amount of hand-tweaking to be usable.

Change-Id: I671dc9d9efdf6d60151325c8d4d13fad7e10a15b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314999
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-03 03:41:26 +00:00
Robert Phillips
e922953cab Adjust how GM::gpuSetup is handled in the tools
Change-Id: I7a49ff49030b4c8aba1f0798a3742641030fe44f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298710
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-26 15:37:30 +00:00
Mike Reed
30bc527fd6 Revert "Reland "Revert "Use flat version of path-direction enum"""
This reverts commit 7cda6f3743.

Reason for revert: legacy convexity code removed -- google3 should be ok

Original change's description:
> Reland "Revert "Use flat version of path-direction enum""
>
> This reverts commit 1792b19485.
>
> Reason for revert: need to update legacy_convexity, still used by google3
>
> Original change's description:
> > Revert "Revert "Use flat version of path-direction enum""
> >
> > This reverts commit 0dacc6b7d3.
> >
> > Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> > Auto-Submit: Mike Reed <reed@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=reed@google.com
>
> Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I3529139bb391c4f62ce5cd0744cdf38a13b71d78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255984
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-11-22 19:09:54 +00:00
Mike Reed
7cda6f3743 Reland "Revert "Use flat version of path-direction enum""
This reverts commit 1792b19485.

Reason for revert: need to update legacy_convexity, still used by google3

Original change's description:
> Revert "Revert "Use flat version of path-direction enum""
> 
> This reverts commit 0dacc6b7d3.
> 
> Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> Auto-Submit: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 11:03:34 +00:00
Mike Reed
1792b19485 Revert "Revert "Use flat version of path-direction enum""
This reverts commit 0dacc6b7d3.

Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 00:51:22 +00:00
Mike Reed
0dacc6b7d3 Revert "Use flat version of path-direction enum"
This reverts commit e0fbe94351.

Reason for revert: need to add guard flag to flutter

Original change's description:
> Use flat version of path-direction enum
> 
> Bug: skia:9663
> Change-Id: I00077d9f2b14b3e983e6a46ef6f560cabdb1678d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242557
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: If47173d9b203b2d3a175af290a15d986accb4703
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9663
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255831
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-21 22:10:32 +00:00
Mike Reed
e0fbe94351 Use flat version of path-direction enum
Bug: skia:9663
Change-Id: I00077d9f2b14b3e983e6a46ef6f560cabdb1678d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242557
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-11-21 21:45:20 +00:00
Mike Reed
92b33354dd more rect api simplifications
set --> setLTRB
set(pts, count) --> setBounds

Bug: skia:9328
Change-Id: I807c0598a8b23b2f721db118ec41c1607114205a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237038
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-08-25 10:12:57 +00:00
Ben Wagner
2e9f772ef0 Move bigconic gm to be a test.
This gm doesn't seem to have ever drawn anything onto the actual canvas,
just leaving a white background. The content is derived from a fuzzer
generated path which caused an assert in the software rasterization of
the path. Since the point is to ensure that this path does not cause an
assertion when drawn, move to the path tests.

Change-Id: Ibff77763d8079386a9b4bfe9a437ffa16856b53b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234663
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-08-14 21:07:03 +00:00
Ben Wagner
7fde8e1728 IWYU for gms.
This almost gets gms to be iwyu clean. The last bit is around gm.cpp
and the tracing framework and its use of atomic. Will also need a way
of keeping things from regressing, which is difficult due to needing to
do this outside-in.

Change-Id: I1393531e99da8b0f1a29f55c53c86d53f459af7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211593
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-05-02 17:48:53 +00:00
Mike Klein
c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00
Mike Klein
ea3f014e2b sk_tool_utils -> ToolUtils, and git clang-format
sk_tool_utils doesn't really fit the naming convention
the rest of code under tools/ tends to use.

Change-Id: I45326a174101c6eb4b6149e9c742f658f2fd23b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202313
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:05:42 +00:00
Mike Reed
9407e24c29 make float more primary API for paint (esp. for alpha)
Bug: skia:8773
Change-Id: I82b1f22f300eadc93f79a35a1638b7eb6376169a
Reviewed-on: https://skia-review.googlesource.com/c/193031
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-15 21:50:16 +00:00
Cary Clark
a0e30b1e40 switch to double in conic split on infinities
If the input conic doesn't contain infinities, it should be possible
to compute the split conic without infinities as well. Fix the case
fuzzer exposes.

R=reed@google.com,fmalita@chromium.org
Bug: skia:7435
Change-Id: Ic128fa14ea0622188e5c43efc16b684efa342e9e
Reviewed-on: https://skia-review.googlesource.com/102425
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-02-02 16:50:29 +00:00
Greg Daniel
9838b49b2e Revert "Revert "long rect dash fix with guards""
This reverts commit fa6b6c2d1b.

Reason for revert: Looks like this was actually caused by another change but happen to fail a test that looked very related to this

Original change's description:
> Revert "long rect dash fix with guards"
> 
> This reverts commit 93ceab1b59.
> 
> Reason for revert: breaking layout test
> 
> Original change's description:
> > long rect dash fix with guards
> > 
> > long rect dash with guards
> > 
> > check dash fix back in with
> > guards against changing
> > chrome layout test results
> > 
> > original change clipped against wrong rectangle
> > some of the time, causing tiled drawing to fail.
> > Always clip against outset rectangle.
> > 
> > original CL: skia-review.googlesource.com/c/skia/+/84862
> > 
> > efficiently dash very large rectangles and very long lines
> > Speed up dashing when lines and rects are absurdly large.
> > 
> > Prior to this CL, only horizontal lines were detected.
> > 
> > Also folded in a change to handle dashing of zero length lines.
> > 
> > TBR=egdaniel@google.com
> > Bug: skia:7311
> > Change-Id: Ic3c68ec8ea35d0597c892c3b26ba7bb077045990
> > Reviewed-on: https://skia-review.googlesource.com/87768
> > Reviewed-by: Cary Clark <caryclark@skia.org>
> > Commit-Queue: Cary Clark <caryclark@skia.org>
> 
> TBR=egdaniel@google.com,caryclark@skia.org
> 
> Change-Id: I56ef771ccb281887d7381c2bd8a2553acbd30621
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:7311
> Reviewed-on: https://skia-review.googlesource.com/88421
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,caryclark@skia.org

Change-Id: Iecdd072544e6623bc4de8d5aab1402378112512d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7311
Reviewed-on: https://skia-review.googlesource.com/88424
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-12-21 14:55:11 +00:00
Greg Daniel
fa6b6c2d1b Revert "long rect dash fix with guards"
This reverts commit 93ceab1b59.

Reason for revert: breaking layout test

Original change's description:
> long rect dash fix with guards
> 
> long rect dash with guards
> 
> check dash fix back in with
> guards against changing
> chrome layout test results
> 
> original change clipped against wrong rectangle
> some of the time, causing tiled drawing to fail.
> Always clip against outset rectangle.
> 
> original CL: skia-review.googlesource.com/c/skia/+/84862
> 
> efficiently dash very large rectangles and very long lines
> Speed up dashing when lines and rects are absurdly large.
> 
> Prior to this CL, only horizontal lines were detected.
> 
> Also folded in a change to handle dashing of zero length lines.
> 
> TBR=egdaniel@google.com
> Bug: skia:7311
> Change-Id: Ic3c68ec8ea35d0597c892c3b26ba7bb077045990
> Reviewed-on: https://skia-review.googlesource.com/87768
> Reviewed-by: Cary Clark <caryclark@skia.org>
> Commit-Queue: Cary Clark <caryclark@skia.org>

TBR=egdaniel@google.com,caryclark@skia.org

Change-Id: I56ef771ccb281887d7381c2bd8a2553acbd30621
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7311
Reviewed-on: https://skia-review.googlesource.com/88421
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-12-21 14:33:31 +00:00
Cary Clark
93ceab1b59 long rect dash fix with guards
long rect dash with guards

check dash fix back in with
guards against changing
chrome layout test results

original change clipped against wrong rectangle
some of the time, causing tiled drawing to fail.
Always clip against outset rectangle.

original CL: skia-review.googlesource.com/c/skia/+/84862

efficiently dash very large rectangles and very long lines
Speed up dashing when lines and rects are absurdly large.

Prior to this CL, only horizontal lines were detected.

Also folded in a change to handle dashing of zero length lines.

TBR=egdaniel@google.com
Bug: skia:7311
Change-Id: Ic3c68ec8ea35d0597c892c3b26ba7bb077045990
Reviewed-on: https://skia-review.googlesource.com/87768
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-12-20 19:18:36 +00:00
Cary Clark
16a127fa60 Revert "long rect dash with guards"
This reverts commit 4ad0c592ce.

Reason for revert: test fails in tiled case
Original change's description:
> long rect dash with guards
> 
> check dash fix back in with
> guards against changing
> chrome layout test results
> 
> original CL: skia-review.googlesource.com/c/skia/+/84862
> 
> efficiently dash very large rectangles and very long lines
> Speed up dashing when lines and rects are absurdly large.
> 
> Prior to this CL, only horizontal lines were detected.
> 
> Also folded in a change to handle dashing of zero length lines.
> 
> TBR=egdaniel@google.com
> Bug: skia:7311
> Change-Id: I139b10f676e7ae06ad83aaf2a35d49cf06280a67
> Reviewed-on: https://skia-review.googlesource.com/87760
> Commit-Queue: Cary Clark <caryclark@skia.org>
> Reviewed-by: Cary Clark <caryclark@skia.org>

TBR=egdaniel@google.com,caryclark@skia.org

Change-Id: Ifd35ddf395826a55c72e650470527d01740b6438
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7311
Reviewed-on: https://skia-review.googlesource.com/87841
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-12-20 16:53:05 +00:00
Cary Clark
d5f447367c Revert "forgot to turn off dash test"
This reverts commit 2b974e4be9.

Reason for revert: test fails in tiled case
Original change's description:
> forgot to turn off dash test
> 
> TBR=egdaniel@google.com
> NOTRY=true
> Bug: skia:
> Change-Id: Id1cf3e25d04e5dab8148114c4378abaa49fd67bc
> Reviewed-on: https://skia-review.googlesource.com/87761
> Commit-Queue: Cary Clark <caryclark@skia.org>
> Reviewed-by: Cary Clark <caryclark@skia.org>

TBR=egdaniel@google.com,caryclark@skia.org

Change-Id: I40aa957c210dec9367bae6cc1be8ca0a044a31af
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/87840
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-12-20 16:51:46 +00:00
Cary Clark
2b974e4be9 forgot to turn off dash test
TBR=egdaniel@google.com
NOTRY=true
Bug: skia:
Change-Id: Id1cf3e25d04e5dab8148114c4378abaa49fd67bc
Reviewed-on: https://skia-review.googlesource.com/87761
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-12-20 14:51:44 +00:00
Cary Clark
4ad0c592ce long rect dash with guards
check dash fix back in with
guards against changing
chrome layout test results

original CL: skia-review.googlesource.com/c/skia/+/84862

efficiently dash very large rectangles and very long lines
Speed up dashing when lines and rects are absurdly large.

Prior to this CL, only horizontal lines were detected.

Also folded in a change to handle dashing of zero length lines.

TBR=egdaniel@google.com
Bug: skia:7311
Change-Id: I139b10f676e7ae06ad83aaf2a35d49cf06280a67
Reviewed-on: https://skia-review.googlesource.com/87760
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-12-20 14:38:04 +00:00
Cary Clark
394197d064 Revert "efficiently dash very large rectangles and very long lines"
This reverts commit 1ad81981b0.

Reason for revert: broke chrome layout tests
Original change's description:
> efficiently dash very large rectangles and very long lines
> 
> Speed up dashing when lines and rects are absurdly large.
> 
> Prior to this CL, only horizontal lines were detected.
> 
> The onOnceBeforeDraw changes are there to make debugging easier.
> 
> Also folded in a change to handle dashing of zero length lines.
> 
> R=​reed@google.com, egdaniel@google.com
> Bug: skia:7311
> Change-Id: Ia16fb124c7a78a5cc639e612fae29c879a37da1a
> Reviewed-on: https://skia-review.googlesource.com/84862
> Commit-Queue: Cary Clark <caryclark@skia.org>
> Reviewed-by: Mike Reed <reed@google.com>

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

Change-Id: I5e8f04c54486f8cd1a931f6cade92feaaa4a7647
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7311
Reviewed-on: https://skia-review.googlesource.com/87282
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-12-19 20:20:17 +00:00
Cary Clark
b0abd8502b Revert "disable large rect dash temporarily"
This reverts commit 54956e1581.

Reason for revert: original cl broke chrome layout tests

Original change's description:
> disable large rect dash temporarily
> 
> fix the build
> 
> TBR:halcanary@google.com
> NOTRY=true
> Bug: skia:7423
> Change-Id: I362fdf2b56c08111c1feab9ffd72351f2ff16f91
> Reviewed-on: https://skia-review.googlesource.com/87002
> Reviewed-by: Cary Clark <caryclark@skia.org>
> Commit-Queue: Cary Clark <caryclark@skia.org>

TBR=halcanary@google.com,caryclark@skia.org

Change-Id: Ia71118dfb7d59ad9d4962d90f2e9a016b0988d0c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7423
Reviewed-on: https://skia-review.googlesource.com/87281
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-12-19 20:17:27 +00:00
Cary Clark
54956e1581 disable large rect dash temporarily
fix the build

TBR:halcanary@google.com
NOTRY=true
Bug: skia:7423
Change-Id: I362fdf2b56c08111c1feab9ffd72351f2ff16f91
Reviewed-on: https://skia-review.googlesource.com/87002
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-12-19 15:31:16 +00:00
Cary Clark
1ad81981b0 efficiently dash very large rectangles and very long lines
Speed up dashing when lines and rects are absurdly large.

Prior to this CL, only horizontal lines were detected.

The onOnceBeforeDraw changes are there to make debugging easier.

Also folded in a change to handle dashing of zero length lines.

R=reed@google.com, egdaniel@google.com
Bug: skia:7311
Change-Id: Ia16fb124c7a78a5cc639e612fae29c879a37da1a
Reviewed-on: https://skia-review.googlesource.com/84862
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Mike Reed <reed@google.com>
2017-12-19 14:51:26 +00:00
Cary Clark
0b1df4b87a fix zero length dashed lines
targeted fix turns zero length line
into very short line.

R=egdaniel@google.com
Bug: skia:7387
Change-Id: Ic2a809d30d722f4e8f51d9205666dc1476a10067
Reviewed-on: https://skia-review.googlesource.com/84661
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-12-15 16:10:38 +00:00
Mike Klein
33d2055e59 GM: some header cleanup
gm.h includes sk_tool_utils.h but does not use it.

The bulk of this CL makes each gm that uses sk_tool_utils include it.

sk_tool_utils.h also provided SkRandom and SkTDArray,
so a couple GMs add those headers too.

Change-Id: Ieb2a7c542f0ca89c3223f744fc11b0ff37af36c1
Reviewed-on: https://skia-review.googlesource.com/10014
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2017-03-22 18:11:49 +00:00
mtklein
dbfd7ab108 Replace a lot of 'static const' with 'constexpr' or 'const'.
'static const' means, there must be at most one of these, and initialize it at
compile time if possible or runtime if necessary.  This leads to unexpected
code execution, and TSAN* will complain about races on the guard variables.

Generally 'constexpr' or 'const' are better choices.  Neither can cause races:
they're either intialized at compile time (constexpr) or intialized each time
independently (const).

This CL prefers constexpr where possible, and uses const where not.  It even
prefers constexpr over const where they don't make a difference... I want to have
lots of examples of constexpr for people to see and mimic.

The scoped-to-class static has nothing to do with any of this, and is not changed.

* Not yet on the bots, which use an older TSAN.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2300623005

Review-Url: https://codereview.chromium.org/2300623005
2016-09-01 11:24:54 -07:00
bungeman
7438bfc080 Factor code to rotate a canvas about a point.
SkMatrix::scale and ::rotate take a point around which to scale or rotate.
Canvas lacks these helpers, so the code to rotate a canvas around a
point has been duplicated many times. Factor all of these
implementations into SkCanvas::rotate.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2142033002

Review-Url: https://codereview.chromium.org/2142033002
2016-07-12 15:01:19 -07:00
halcanary
9d524f22bf Style bikeshed - remove extraneous whitespace
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002

Review URL: https://codereview.chromium.org/1842753002
2016-03-29 09:03:53 -07:00
reed
a439334b6e Reland of "switch patheffects over to sk_sp (patchset #5 id:80001 of https://codereview.chromium.org/1813553005/ )"
This reverts commit f28ad89427.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1813123003

TBR=

Review URL: https://codereview.chromium.org/1813123003
2016-03-18 11:22:57 -07:00
reed
f28ad89427 Revert of switch patheffects over to sk_sp (patchset #5 id:80001 of https://codereview.chromium.org/1813553005/ )
Reason for revert:
some build breaks, possibly related to paint having to know what a patheffect is

Original issue's description:
> switch patheffects over to sk_sp
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1813553005
>
> Committed: https://skia.googlesource.com/skia/+/9fbee18f691a0afed1e38a851048ce06063505ed

TBR=caryclark@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1817543002
2016-03-18 10:17:27 -07:00
reed
9fbee18f69 switch patheffects over to sk_sp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1813553005

Review URL: https://codereview.chromium.org/1813553005
2016-03-18 10:00:32 -07:00
caryclark
40b7d3b48b fix hair fuzz
If the end and control points of a quad, conic, or cubic are the same,
adjust all of them when stretching the curve to account for a square
or round end cap. If all of the points are the same, move all but the
last.

Enlarge the clip check to account for the cap.

The clip bug was detected by ASAN.

R=reed@google.com, msarett@google.com
BUG=571214
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1547483003

Review URL: https://codereview.chromium.org/1547483003
2015-12-22 06:13:33 -08:00
scroggo
96f16e835e Use DEF_GM everywhere
BUG=skia:1902

Review URL: https://codereview.chromium.org/1518893002
2015-12-10 13:31:59 -08:00
caryclark
57eecc154e Zero length lines may have caps, but do not need joins.
Check to see if the point is preceeded or followed
by a line with a computable tangent before adding the join.

R=reed@google.com
BUG=566075

Review URL: https://codereview.chromium.org/1504043002
2015-12-08 04:29:45 -08:00
caryclark
b775e91e87 add more conservative check for wayward divide
When the parallel stroke to the curve can't be computed from
the intersection of the tangent lines, as straight line connects
the two points instead. Allow the intersection to succeed unless
the ratio isn't finite or the contribution of (1 - ratio) isn't
significant.

R=reed@google.com,fmalita@chromium.org
BUG=skia:4603

Review URL: https://codereview.chromium.org/1484873003
2015-11-30 13:47:11 -08:00
caryclark
950305ec77 fix for teeny strokes
Pass the scale before evaluating degenerate line segments.

This does not change other GMs.

R=reed@google.com
BUG=478337

Review URL: https://codereview.chromium.org/1418133007
2015-10-26 08:17:04 -07:00
caryclark
6651a3238d Reland of more zero-length changes for svg compatibility (patchset #1 id:1 of https://codereview.chromium.org/1334543002/ )
Reason for revert:
DEPS should be fixed now

Original issue's description:
> Revert of more zero-length changes for svg compatibility (patchset #6 id:100001 of https://codereview.chromium.org/1330623003/ )
>
> Reason for revert:
> breaks DEPS
>
> Original issue's description:
> > more zero-length changes for svg compatibility
> >
> > If a path contains a moveTo followed by a line or curve,
> > even if the line or curve has no length, SVG expects
> > the end caps to draw if the cap style is round or square.
> >
> > Fredrik Söderquist attached a patch to the chrome bug
> > (slightly modified here) that fixes layout test failures
> > resulting from deleting special-case code in SVG
> > dealing with zero-length path segments.
> >
> > R=reed@google.com,fs@opera.com
> > BUG=22974
> >
> > Committed: https://skia.googlesource.com/skia/+/62fb1ba1786863e545c89839b5706ad5151cec15
>
> TBR=fs@opera.com,reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=22974
>
> Committed: https://skia.googlesource.com/skia/+/5ca4fa3846067a47e88d35ace895df3ebe3ec2a5

TBR=fs@opera.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=22974

Review URL: https://codereview.chromium.org/1314833004
2015-09-09 13:20:49 -07:00
caryclark
5ca4fa3846 Revert of more zero-length changes for svg compatibility (patchset #6 id:100001 of https://codereview.chromium.org/1330623003/ )
Reason for revert:
breaks DEPS

Original issue's description:
> more zero-length changes for svg compatibility
>
> If a path contains a moveTo followed by a line or curve,
> even if the line or curve has no length, SVG expects
> the end caps to draw if the cap style is round or square.
>
> Fredrik Söderquist attached a patch to the chrome bug
> (slightly modified here) that fixes layout test failures
> resulting from deleting special-case code in SVG
> dealing with zero-length path segments.
>
> R=reed@google.com,fs@opera.com
> BUG=22974
>
> Committed: https://skia.googlesource.com/skia/+/62fb1ba1786863e545c89839b5706ad5151cec15

TBR=fs@opera.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=22974

Review URL: https://codereview.chromium.org/1334543002
2015-09-09 09:34:22 -07:00
caryclark
62fb1ba178 more zero-length changes for svg compatibility
If a path contains a moveTo followed by a line or curve,
even if the line or curve has no length, SVG expects
the end caps to draw if the cap style is round or square.

Fredrik Söderquist attached a patch to the chrome bug
(slightly modified here) that fixes layout test failures
resulting from deleting special-case code in SVG
dealing with zero-length path segments.

R=reed@google.com,fs@opera.com
BUG=22974

Review URL: https://codereview.chromium.org/1330623003
2015-09-09 07:04:33 -07:00
halcanary
385fe4d4b6 Style Change: SkNEW->new; SkDELETE->delete
DOCS_PREVIEW= https://skia.org/?cl=1316123003

Review URL: https://codereview.chromium.org/1316123003
2015-08-26 13:07:49 -07:00