aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/strokes.cpp
Commit message (Collapse)AuthorAge
* Replace a lot of 'static const' with 'constexpr' or 'const'.Gravatar mtklein2016-09-01
| | | | | | | | | | | | | | | | | | | | | | | '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
* Factor code to rotate a canvas about a point.Gravatar bungeman2016-07-12
| | | | | | | | | | | 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
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | 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
* Reland of "switch patheffects over to sk_sp (patchset #5 id:80001 of ↵Gravatar reed2016-03-18
| | | | | | | | | | | | | https://codereview.chromium.org/1813553005/ )" This reverts commit f28ad894272018fd2855e3f77ea1236ea0cce1c0. 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
* Revert of switch patheffects over to sk_sp (patchset #5 id:80001 of ↵Gravatar reed2016-03-18
| | | | | | | | | | | | | | | | | | | | | | | | 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
* switch patheffects over to sk_spGravatar reed2016-03-18
| | | | | | | 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
* fix hair fuzzGravatar caryclark2015-12-22
| | | | | | | | | | | | | | | | | 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
* Use DEF_GM everywhereGravatar scroggo2015-12-10
| | | | | | BUG=skia:1902 Review URL: https://codereview.chromium.org/1518893002
* Zero length lines may have caps, but do not need joins.Gravatar caryclark2015-12-08
| | | | | | | | | | 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
* add more conservative check for wayward divideGravatar caryclark2015-11-30
| | | | | | | | | | | | | 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
* fix for teeny strokesGravatar caryclark2015-10-26
| | | | | | | | | | | 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
* Reland of more zero-length changes for svg compatibility (patchset #1 id:1 ↵Gravatar caryclark2015-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert of more zero-length changes for svg compatibility (patchset #6 ↵Gravatar caryclark2015-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* more zero-length changes for svg compatibilityGravatar caryclark2015-09-09
| | | | | | | | | | | | | | | | 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
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* 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
* Reland of ix zero-length tangent (patchset #1 id:1 of ↵Gravatar caryclark2015-08-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1312243002/ ) Reason for revert: Layout suppression has landed, and verified that Skia gm test changes are correct. Original issue's description: > Revert of fix zero-length tangent (patchset #2 id:20001 of https://codereview.chromium.org/1311273002/ ) > > Reason for revert: > causes layout test to draw differently -- new drawing is more correct. Reverting until layout test ignore is landed. > > Original issue's description: > > fix zero-length tangent > > > > If the end point and the control point are the same, computing > > the tangent will result in (0, 0). In this case, use the prior > > control point instead. > > > > R=reed@google.com > > > > BUG=skia:4191 > > > > Committed: https://skia.googlesource.com/skia/+/7544124fb8ee744f68f549a353f8a9163cd7432d > > TBR=reed@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia:4191 > > Committed: https://skia.googlesource.com/skia/+/91298b47c547b2ab4697038c04685af957bd1416 TBR=reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4191 Review URL: https://codereview.chromium.org/1320473002
* Revert of fix zero-length tangent (patchset #2 id:20001 of ↵Gravatar caryclark2015-08-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1311273002/ ) Reason for revert: causes layout test to draw differently -- new drawing is more correct. Reverting until layout test ignore is landed. Original issue's description: > fix zero-length tangent > > If the end point and the control point are the same, computing > the tangent will result in (0, 0). In this case, use the prior > control point instead. > > R=reed@google.com > > BUG=skia:4191 > > Committed: https://skia.googlesource.com/skia/+/7544124fb8ee744f68f549a353f8a9163cd7432d TBR=reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4191 Review URL: https://codereview.chromium.org/1312243002
* fix zero-length tangentGravatar caryclark2015-08-25
| | | | | | | | | | | | If the end point and the control point are the same, computing the tangent will result in (0, 0). In this case, use the prior control point instead. R=reed@google.com BUG=skia:4191 Review URL: https://codereview.chromium.org/1311273002
* 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
* IWYU: 'core' target, files starting A-C.Gravatar bungeman2015-08-05
| | | | | | | | | TBR=reed@google.com Verbal lgtm, does not change API. Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69 Review URL: https://codereview.chromium.org/1265033002
* Revert of IWYU: 'core' target, files starting A-C. (patchset #5 id:80001 of ↵Gravatar reed2015-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1265033002/ ) Reason for revert: revert to unblock DEPS roll ../../chrome/browser/chromeos/display/overscan_calibrator.cc:43:10: error: variable has incomplete type 'SkPath' SkPath base_path; Original issue's description: > IWYU: 'core' target, files starting A-C. > > TBR=reed@google.com > Verbal lgtm, does not change API. > > Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69 TBR=reed@google.com,mtklein@google.com,bungeman@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1273613002
* IWYU: 'core' target, files starting A-C.Gravatar bungeman2015-08-04
| | | | | | | TBR=reed@google.com Verbal lgtm, does not change API. Review URL: https://codereview.chromium.org/1265033002
* make tests portable by using 565 compatible colorsGravatar caryclark2015-07-29
| | | | | | TBR=reed@google.com Review URL: https://codereview.chromium.org/1262703002
* handle large conic strokes betterGravatar caryclark2015-05-19
| | | | | | | | | | | | | | | | | | | | A stroked conic computes the outset quad's control point by computing the intersection of the quad's endpoints. If the the denominator used to compute the scale factor for the control point is small, check to see if the numerator is also small so that the division stays bounded. Also clean up error returns and internal function calls to simplify the code. Additionally, remove comic max curvature (unimplemented) and call extrema functions instead to handle cases where the conic is degenerate or is a line. R=reed@google.com, fmalita@chromium.org BUG=skia:3843 Review URL: https://codereview.chromium.org/1144883003
* C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}Gravatar mtklein2015-03-25
| | | | | | | | | NOPRESUBMIT=true BUG=skia: DOCS_PREVIEW= https://skia.org/?cl=1037793002 Review URL: https://codereview.chromium.org/1037793002
* fuzzer fixesGravatar caryclark2015-02-25
| | | | | | | | | | | | | | | | | | | Fix path bugs exposed by the path fuzzer. Changes to existing gm and samplecode files defer their calls to construct SkPath objects until the first draw instead of at test initialization. Add an experimental call to SkPath to validate the internal SkPathRef. Fix SkPath::addPoly to set the last moveto after adding a close verb. Fix stroke to handle failures when computing the unit normal. Add a unit test for the unit normal failure. R=reed@google.com Review URL: https://codereview.chromium.org/953383002
* make strokes3 full sizeGravatar caryclark2015-02-23
| | | | | | | The strokes3 test was limted to 400x800. Allow the captured gm to go to 1500x1500, and shift it down slightly so it isn't clipped. Review URL: https://codereview.chromium.org/945363004
* remove unused GM flagsGravatar mtklein2015-01-23
| | | | | | | | | | Depends on https://codereview.chromium.org/873753002/ Thumbs up to CLion for refactoring this for me. BUG=skia: Review URL: https://codereview.chromium.org/867963004
* Fix up all the easy virtual ... SK_OVERRIDE cases.Gravatar mtklein2015-01-09
| | | | | | | | | | | | This fixes every case where virtual and SK_OVERRIDE were on the same line, which should be the bulk of cases. We'll have to manually clean up the rest over time unless I level up in regexes. for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end BUG=skia: Review URL: https://codereview.chromium.org/806653007
* Cleanup: Another round of override fixes.Gravatar tfarina2014-12-20
| | | | | | | | BUG=skia:3075 TEST=ninja -C out/Debug TBR=mtklein@google.com Review URL: https://codereview.chromium.org/815883002
* There can be only one (SkRandom)!Gravatar scroggo2014-12-15
| | | | | | | | | | | | | | | | | | | | | Remove SkLCGRandom. We already decided the new one was better, which is why we wrote the new SkRandom. Convert GMs that were using SkLCGRandom to use the improved SkRandom. Motivated by the fact that these GMs draw differently on some runs. We believe this to be a result of using the old SkLCGRandom. Add each of the tests that were using SkLCGRandom to ignore-tests.txt, since we expect they'll draw differently using SkRandom. Move a trimmed down version of SkLCGRandom into SkDiscretePathEffect. In order to preserve the old behavior, trim down SkLCGRandom to only the methods used by SkDiscretePathEffect, and hide it in SkDiscretePathEffect's cpp file. BUG=skia:3241 Review URL: https://codereview.chromium.org/805963002
* Turn on quilt mode in DM.Gravatar commit-bot@chromium.org2014-04-30
| | | | | | | | | | | | | | | | | | - Rename TileGrid -> Quilt to avoid the name overload. - Tag all failing GMs with kSkipTiled_Flag. You may be wondering, do any GMs pass? Yes, some do! And that trends towards all of them as we increase --quiltTile. Two GMs only fail in --quilt mode in 565. Otherwise all GMs which fail are skipped, and those which don't fail aren't. (The 8888 variants of those two GMs are skipped even though they pass.) BUG=skia:2477 R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/256373002 git-svn-id: http://skia.googlecode.com/svn/trunk@14457 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change old PRG to be SkLCGRandom; change new one to SkRandomGravatar commit-bot@chromium.org2013-09-09
| | | | | | | | | | | | | | The goal here is to get people to start using the new random number generator, while leaving the old one in place so we don't have to rebaseline GMs. R=reed@google.com, bsalomon@google.com Author: jvanverth@google.com Review URL: https://chromiumcodereview.appspot.com/23576015 git-svn-id: http://skia.googlecode.com/svn/trunk@11169 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7406 2bbb7eff-a529-9590-31e7-b0007b416f81
* Result of running tools/sanitize_source_files.py (which was added in ↵Gravatar rmistry@google.com2012-08-23
| | | | | | | | | https://codereview.appspot.com/6465078/) This CL is part III of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6475053 git-svn-id: http://skia.googlecode.com/svn/trunk@5264 2bbb7eff-a529-9590-31e7-b0007b416f81
* add gm (no images yet) for two-point-radial gradientsGravatar reed@google.com2012-06-05
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4163 2bbb7eff-a529-9590-31e7-b0007b416f81
* Import all GMs as Samples.Gravatar bsalomon@google.com2011-10-31
| | | | | | | | Review URL: http://codereview.appspot.com/5332043/ git-svn-id: http://skia.googlecode.com/svn/trunk@2564 2bbb7eff-a529-9590-31e7-b0007b416f81
* rolling back the experimental rollbacks in r2178-2179Gravatar epoger@google.com2011-08-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2180 2bbb7eff-a529-9590-31e7-b0007b416f81
* rolling tree back to its state as of r2169 to see if that fixes Windows ↵Gravatar epoger@google.com2011-08-26
| | | | | | buildbots git-svn-id: http://skia.googlecode.com/svn/trunk@2179 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move multiple calls to random() out of parameter lists so that theGravatar tomhudson@google.com2011-08-25
| | | | | | | | evaluation order is consistent across compilers. git-svn-id: http://skia.googlecode.com/svn/trunk@2173 2bbb7eff-a529-9590-31e7-b0007b416f81
* Automatic update of all copyright notices to reflect new license terms.Gravatar epoger@google.com2011-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have manually examined all of these diffs and restored a few files that seem to require manual adjustment. The following files still need to be modified manually, in a separate CL: android_sample/SampleApp/AndroidManifest.xml android_sample/SampleApp/res/layout/layout.xml android_sample/SampleApp/res/menu/sample.xml android_sample/SampleApp/res/values/strings.xml android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java experimental/CiCarbonSampleMain.c experimental/CocoaDebugger/main.m experimental/FileReaderApp/main.m experimental/SimpleCocoaApp/main.m experimental/iOSSampleApp/Shared/SkAlertPrompt.h experimental/iOSSampleApp/Shared/SkAlertPrompt.m experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig gpu/src/android/GrGLDefaultInterface_android.cpp gyp/common.gypi gyp_skia include/ports/SkHarfBuzzFont.h include/views/SkOSWindow_wxwidgets.h make.bat make.py src/opts/memset.arm.S src/opts/memset16_neon.S src/opts/memset32_neon.S src/opts/opts_check_arm.cpp src/ports/SkDebug_brew.cpp src/ports/SkMemory_brew.cpp src/ports/SkOSFile_brew.cpp src/ports/SkXMLParser_empty.cpp src/utils/ios/SkImageDecoder_iOS.mm src/utils/ios/SkOSFile_iOS.mm src/utils/ios/SkStream_NSData.mm tests/FillPathTest.cpp Review URL: http://codereview.appspot.com/4816058 git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
* addGravatar mike@reedtribe.org2011-06-18
git-svn-id: http://skia.googlecode.com/svn/trunk@1645 2bbb7eff-a529-9590-31e7-b0007b416f81