aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/SkDashPath.cpp
Commit message (Collapse)AuthorAge
* start removing uses of SkScalarMulGravatar Mike Reed2017-02-06
| | | | | | | | | BUG=skia:6197 Change-Id: Ic444c7ee4ca547f483dc8232dcacd6d4ba87d913 Reviewed-on: https://skia-review.googlesource.com/8041 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Reed <reed@google.com>
* make SpecialLineRec::addSegment assert more permissive to accomodate ↵Gravatar lsalzman2016-08-08
| | | | | | | | | | | | | | | | rounding error Because the driving code that calls SpecialLineRec::addSegment uses double precision, when converted back to single precision this may round such that d0 and d1 are the same. This causes the assert to trigger. The simplest thing to do here is to modify the assert to not be so picky and allow the rare/occasional equality. Downstream Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1290628 BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2209303004 Review-Url: https://codereview.chromium.org/2209303004
* limit the number of points in SkDashPathEffect::asPointsGravatar lsalzman2016-07-21
| | | | | | | | | | | | | | | | | | | If the length of a line path is sufficiently long relative to the dash interval, it is possible to cause SkDashPathEffect::asPoints to produce so many points that it overflows the amount that can fit in an int type, or otherwise produce non-finite values, i.e. path from (0,0) to (0,9e15) with a dash interval of 1. This fixes that by capping the amount of points to a sane limit - in this case, 1mil, since that limit is also used in utils/SkDashPath.cpp and has precedent. Downstream Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1287515 BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2165013002 Review-Url: https://codereview.chromium.org/2165013002
* Add control over whether lines are special cased in SkDashPath. Disable when ↵Gravatar bsalomon2016-06-13
| | | | | | | | called from GrShape. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2055253002 Review-Url: https://codereview.chromium.org/2055253002
* Make SkDashPathEffect fail for stroke+fill style (in addition to fill style)Gravatar bsalomon2016-06-09
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2048183002 Review-Url: https://codereview.chromium.org/2048183002
* allow one zero length dashGravatar caryclark2016-03-18
| | | | | | | | | | | | | | | | | | If the constructed stroke that represents a dash has a single dash of length zero, and the end cap is square or round, draw the cap. The old code initialized the initial dash length to zero, making it ambiguous whether the first length is zero or not. R=robertphillips@google.com BUG=583299 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1805963002 Committed: https://skia.googlesource.com/skia/+/5e1a24808415df2748822e8082e21a361362cdfe Review URL: https://codereview.chromium.org/1805963002
* Revert of allow one zero length dash (patchset #8 id:140001 of ↵Gravatar bungeman2016-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1805963002/ ) Reason for revert: Causes the dash bench to crash. Example crash: https://build.chromium.org/p/client.skia/builders/Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release/builds/5581/steps/nanobench/logs/stdio Original issue's description: > allow one zero length dash > > If the constructed stroke that represents a dash has a > single dash of length zero, and the end cap is square or > round, draw the cap. > > The old code initialized the initial dash length to zero, > making it ambiguous whether the first length is zero or > not. > > R=robertphillips@google.com > BUG=583299 > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1805963002 > > Committed: https://skia.googlesource.com/skia/+/5e1a24808415df2748822e8082e21a361362cdfe TBR=robertphillips@google.com,reed@google.com,caryclark@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=583299 Review URL: https://codereview.chromium.org/1808303004
* allow one zero length dashGravatar caryclark2016-03-18
| | | | | | | | | | | | | | | | If the constructed stroke that represents a dash has a single dash of length zero, and the end cap is square or round, draw the cap. The old code initialized the initial dash length to zero, making it ambiguous whether the first length is zero or not. R=robertphillips@google.com BUG=583299 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1805963002 Review URL: https://codereview.chromium.org/1805963002
* don't create zero length intervalsGravatar caryclark2016-03-17
| | | | | | | | | | | | | | Dashing a pattern without zero-length intervals should not create them if the end of the on interval coincides with the beginning of the initial dash offset. R=reed@google.com BUG=591993 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1766243004 Committed: https://skia.googlesource.com/skia/+/18bbd00190623fb6cdb119df4a118ac3c1aed52a Review URL: https://codereview.chromium.org/1766243004
* Revert of don't create zero length intervals (patchset #1 id:1 of ↵Gravatar robertphillips2016-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1766243004/ ) Reason for revert: This may, or may not, be blocking the DEPS roll with: svg/W3C-SVG-1.1/painting-stroke-04-t.svg - LayoutSVGPath {path} at (50,127) size 380x26 [stroke={[type=SOLID] [color=#000000] [stroke width=25.00] [dash offset=10.00] [dash array={10.00, 10.00}]}] [data="M 50 140 L 430 140"] + LayoutSVGPath {path} at (60,127) size 370x26 [stroke={[type=SOLID] [color=#000000] [stroke width=25.00] [dash offset=10.00] [dash array={10.00, 10.00}]}] [data="M 50 140 L 430 140"] Original issue's description: > don't create zero length intervals > > Dashing a pattern without zero-length intervals should > not create them if the end of the on interval coincides > with the beginning of the initial dash offset. > > R=reed@google.com > BUG=591993 > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1766243004 > > Committed: https://skia.googlesource.com/skia/+/18bbd00190623fb6cdb119df4a118ac3c1aed52a TBR=reed@google.com,fmalita@chromium.org,caryclark@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=591993 Review URL: https://codereview.chromium.org/1779803002
* don't create zero length intervalsGravatar caryclark2016-03-09
| | | | | | | | | | | | Dashing a pattern without zero-length intervals should not create them if the end of the on interval coincides with the beginning of the initial dash offset. R=reed@google.com BUG=591993 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1766243004 Review URL: https://codereview.chromium.org/1766243004
* resolution dependent path measureGravatar caryclark2016-01-21
| | | | | | | | | | | | | | | | | When a dash is drawn through a canvas with a scaled up matrix, path measure needs the pixel resolution through the matrix to construct the dash with sufficient resolution. Pass the resolution through to path measure. Replicate chrome bug in skia GM. R=reed@google.com BUG=530095 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1608353002 Review URL: https://codereview.chromium.org/1608353002
* ubsan shift fixesGravatar caryclark2015-12-09
| | | | | | | | | | | Use an inline function that does a normal shift. When built for the sanitizer, add casts so that the shift is unsigned. Also make a few fixes to do unsigned shifts or avoid the shift altogether; and add an argument spec to some macros. R=reed@google.com,mtklein@google.com BUG=skia:4633 Review URL: https://codereview.chromium.org/1503423003
* Forward declare SkStrokeRec in SkPathEffectGravatar halcanary2015-09-15
| | | | Review URL: https://codereview.chromium.org/1312163008
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* zero-length cap fixGravatar caryclark2015-08-26
| | | | | | | | | | | | | | | | | | Re-land; layout tests are suppressed and gm differences are understood. A merge conflict prevented a automatic reland. If the endcap is not butt, draw the endcaps even when the line has zero length. If the dash length is zero, generate a zero length line segment. Treat a move followed by a close as a move followed by a zero-length line. TBR=reed@google.com BUG=422974 Review URL: https://codereview.chromium.org/1314213002
* Revert of experiment with zero-length round capped line segments (patchset ↵Gravatar caryclark2015-08-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #4 id:60001 of https://codereview.chromium.org/1309753002/ ) Reason for revert: More GMs changed than I expected. Will probably affect layout tests as well; reverting until I can verify that the changes are correct. Original issue's description: > experiment with zero-length round capped line segments > > If the endcap is not butt, draw the endcaps even when the line > has zero length. > > If the dash length is zero, generate a zero length line segment. > > Treat a move followed by a close as a move followed by a zero-length > line. > > R=reed@google.com,schenney@google.com > BUG=422974 > > Committed: https://skia.googlesource.com/skia/+/dd3c165828fffb369d0f4b13b48381169a0249a9 TBR=reed@google.com,schenney@google.com,schenney@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=422974 Review URL: https://codereview.chromium.org/1304163008
* experiment with zero-length round capped line segmentsGravatar caryclark2015-08-21
| | | | | | | | | | | | | | | If the endcap is not butt, draw the endcaps even when the line has zero length. If the dash length is zero, generate a zero length line segment. Treat a move followed by a close as a move followed by a zero-length line. R=reed@google.com,schenney@google.com BUG=422974 Review URL: https://codereview.chromium.org/1309753002
* Bug fix for cull_line in SkDashPathEffect.Gravatar egdaniel2014-11-05
| | | | | | | | | | | In cull_line we must also check if both points are the same. Otherwise we fail the assert in the else "SkASSERT(dy && !dx)". This is currently blocking the roll as it fails a webkit test. BUG=skia: Review URL: https://codereview.chromium.org/703783002
* Crop the fast path dashed lines to the cull rectGravatar robertphillips2014-11-04
| | | | | | | | | | | | | | | | | | | | | | | Without: maxrss loops min median mean max stddev samples config bench 56M 1 13.3ms 13.6ms 13.6ms 14.2ms 2% Ooooo..... 8888 GM_dashing5_bw 56M 13 390us 417us 416us 459us 5% ooooO..o.o gpu GM_dashing5_bw 56M 1 13.4ms 13.9ms 14.1ms 15ms 3% Oooo..ooOo 8888 GM_dashing5_aa 56M 13 402us 421us 416us 425us 2% Ooo.ooOOOO gpu GM_dashing5_aa With: 40M 1 1.53ms 1.54ms 1.54ms 1.55ms 0% oo.O...o.. 8888 GM_dashing5_bw 40M 12 407us 412us 415us 445us 3% ...Oo..... gpu GM_dashing5_bw 40M 1 1.7ms 1.7ms 1.7ms 1.72ms 0% o.O....... 8888 GM_dashing5_aa 43M 13 405us 409us 409us 415us 1% ooo.Ooo..o gpu GM_dashing5_aa The GM images (including the new one) are the same with and without this CL. BUG=428296 Review URL: https://codereview.chromium.org/699623003
* Move Dashing filterPath to a dashing utils fileGravatar egdaniel2014-06-11
| | | | | | | | | | | | | | | | From inside GrContext, we have a need to create an SkPath an original path and some dashing info. We do not have access to the original path effect so we need a way to make the FilterPath function accessible outside of the effect. So I moved the core filterPath code (and all need helper functions) out of SkDashPathEffect and created a SkDashPath in utils to store these helper functions. BUG=skia: Committed: https://skia.googlesource.com/skia/+/576dcdc793a762ec63fbecdbfd5768066b548fe5 Author: egdaniel@google.com Review URL: https://codereview.chromium.org/314623004
* Revert of Move Dashing filterPath to a dashing utils file ↵Gravatar egdaniel2014-06-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/314623004/) Reason for revert: Need to create utils.gypi file and update chrome Original issue's description: > Move Dashing filterPath to a dashing utils file > > From inside GrContext, we have a need to create an SkPath an original path and > some dashing info. We do not have access to the original path effect so we need > a way to make the FilterPath function accessible outside of the effect. So I moved > the core filterPath code (and all need helper functions) out of SkDashPathEffect > and created a SkDashPath in utils to store these helper functions. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/576dcdc793a762ec63fbecdbfd5768066b548fe5 R=bsalomon@google.com, reed@google.com, rmistry@google.com TBR=bsalomon@google.com, reed@google.com, rmistry@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: egdaniel@google.com Review URL: https://codereview.chromium.org/317663003
* Move Dashing filterPath to a dashing utils fileGravatar egdaniel2014-06-04
From inside GrContext, we have a need to create an SkPath an original path and some dashing info. We do not have access to the original path effect so we need a way to make the FilterPath function accessible outside of the effect. So I moved the core filterPath code (and all need helper functions) out of SkDashPathEffect and created a SkDashPath in utils to store these helper functions. BUG=skia: R=bsalomon@google.com, reed@google.com, rmistry@google.com Author: egdaniel@google.com Review URL: https://codereview.chromium.org/314623004