Commit Graph

18 Commits

Author SHA1 Message Date
John Stiles
a212b95413 Fix cases of variable shadowing in gm/.
These were reviewed last year at http://review.skia.org/312480 but never
landed. Splitting into small chunks to land individually.

If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.

Change-Id: Ie6a262328315a5726265ef4afede7e0e66337752
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435718
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-08-02 19:02:56 +00:00
Mike Reed
06d7c9d798 Revert "Revert "use pathbuilder""
This reverts commit 43e3e91883.

Change-Id: I43f6c195f96b1601225801ffaa05a3133c236eba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313421
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-08-26 17:35:34 +00:00
Mike Reed
43e3e91883 Revert "use pathbuilder"
This reverts commit 4b25d41d96.

Reason for revert: grrrr, broke some layout test (a little)

https://test-results.appspot.com/data/layout_results/linux-blink-rel/40609/blink_web_tests%20%28with%20patch%29/layout-test-results/results.html

Original change's description:
> use pathbuilder
> 
> Change-Id: I4b7cd6aed0c8da44e6065bb171332e25988ec8cc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313376
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I7a073aafcfddc398ab9a761719230f2427c987c6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313420
Reviewed-by: Mike Reed <reed@google.com>
2020-08-26 16:35:37 +00:00
Mike Reed
4b25d41d96 use pathbuilder
Change-Id: I4b7cd6aed0c8da44e6065bb171332e25988ec8cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313376
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-26 14:58:13 +00:00
Mike Reed
9ded74e024 use strokeandfill patheffect, and fix it
Similar to our stroker, I try to detect when to reverse the fill.

Change-Id: I3099f009dd78dc6e4ffd295e13183c85e0990761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291179
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-05-20 21:37:52 +00:00
Mike Reed
1963009cd0 stroke-and-fill is deprecated, introduce simpler api
baby step for https://skia-review.googlesource.com/c/skia/+/158020/

Bug: skia:8428
Change-Id: I0411c52a4fb97755e1b06b2aba8cb969776309bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290717
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-19 13:03:29 +00:00
Brian Salomon
3517aa7b14 Fix stroked arcs for mirror matrices.
Bug: b/142280381
Change-Id: I9933543377e6916bd262c6f2e936ed9f0976d039
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259174
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-12-11 14:44:30 +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
Brian Osman
e3deee1319 Use a smaller tolerance when chopping conics to quads
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>
2018-11-20 16:42:04 +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
caryclark
f71ab8f58b avoid generating degenerate conic from arc
R=bsalomon@google.com
BUG=skia:5672
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2281953002

Review-Url: https://codereview.chromium.org/2281953002
2016-08-26 09:54:25 -07:00
bsalomon
21af9ca1b1 Respecify SkCanvas::drawArc, consolidate conversion to SkPath, add GM for oddball drawArcs
Allows the arc to wind more than 360 degrees when useCenter is true, specs that nothing draws
if the oval is empty or the sweep angle is 0.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2281653002

Review-Url: https://codereview.chromium.org/2281653002
2016-08-25 12:29:24 -07:00
bsalomon
4c261d0c1e Add cap type variations to circular arcs GMs
BUG=skia:5227
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2269723002

Review-Url: https://codereview.chromium.org/2269723002
2016-08-22 13:10:46 -07:00
bsalomon
ac1d0abfd8 Add stroke-and-fill circular arc test, test near 180deg arc in all circular_arc_tests
BUG=skia:5227
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2261233002

Review-Url: https://codereview.chromium.org/2261233002
2016-08-22 10:00:14 -07:00
bsalomon
36da771226 Adjust angles in circular arcs GMs to test smaller arcs
BUG=skia:5227
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2267713002

Review-Url: https://codereview.chromium.org/2267713002
2016-08-22 07:26:08 -07:00
bsalomon
4c54788e92 Rename circular_arcs_circular_arcs_fill to circular_arcs_fill.
Also fix issue with second paint's alpha getting overwritten.

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

Review-Url: https://codereview.chromium.org/2265643002
2016-08-19 13:41:29 -07:00
bsalomon
71c5eee9d5 Add GMs for testing drawArc.
This is in preparation for virtualizing this on SkCanvas/SkDevice.

Tests the following variations:

aa and non-aa
stroke/hairline/fill
cap types
using center point and not

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

Review-Url: https://codereview.chromium.org/2264593002
2016-08-19 10:53:14 -07:00