aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathTest.cpp
Commit message (Collapse)AuthorAge
* Update how SkPath handles fGenerationID and fSourcePath, and add tests to cover.Gravatar mtklein@google.com2013-08-15
| | | | | | | | | BUG= R=bungeman@google.com, reed@google.com Review URL: https://codereview.chromium.org/22911002 git-svn-id: http://skia.googlecode.com/svn/trunk@10756 2bbb7eff-a529-9590-31e7-b0007b416f81
* All rSomethingTo() immediately following a close() are relative to the point ↵Gravatar commit-bot@chromium.org2013-08-09
| | | | | | | | | | | | | | | we closed from, not the point we close to. Fix that. Seems like this has been broken since the stone ages. BUG=skia:1474, code.google.com/p/android/issues/detail?id=41216 R=bsalomon@google.com Author: mtklein@google.com Review URL: https://chromiumcodereview.appspot.com/22681006 git-svn-id: http://skia.googlecode.com/svn/trunk@10666 2bbb7eff-a529-9590-31e7-b0007b416f81
* Restore SkPath(const SkPath&) to copy the generation ID on Android.Gravatar mtklein@google.com2013-08-07
| | | | | | | | | BUG= R=bsalomon@google.com, bungeman@google.com, reed@google.com Review URL: https://codereview.chromium.org/22471002 git-svn-id: http://skia.googlecode.com/svn/trunk@10622 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkPath::conservativelyContainsRect not assert on paths that begin with ↵Gravatar commit-bot@chromium.org2013-08-01
| | | | | | | | | | | | repeated moveTos R=reed@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/21565002 git-svn-id: http://skia.googlecode.com/svn/trunk@10484 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r9724 (add rect-output parameter to isRect) to allow the DEPS rollGravatar robertphillips@google.com2013-06-25
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@9750 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-06-22
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@9738 2bbb7eff-a529-9590-31e7-b0007b416f81
* add rect-output parameter to isRect, allowing us to return the correct ↵Gravatar reed@google.com2013-06-21
| | | | | | | | | | | | bounds even if a rectagular path has a trailing moveTo https://code.google.com/p/chromium/issues/detail?id=247770 R=caryclark@google.com Review URL: https://codereview.chromium.org/16950021 git-svn-id: http://skia.googlecode.com/svn/trunk@9724 2bbb7eff-a529-9590-31e7-b0007b416f81
* SkPath::rewind needs to have same reset as SkPath::reset.Gravatar bungeman@google.com2013-06-21
| | | | | | | | R=caryclark@google.com, reed@google.com Review URL: https://codereview.chromium.org/17432003 git-svn-id: http://skia.googlecode.com/svn/trunk@9718 2bbb7eff-a529-9590-31e7-b0007b416f81
* bump picture version since SkPath has changed (conics)Gravatar reed@google.com2013-05-31
| | | | | | enable conics in SkPath git-svn-id: http://skia.googlecode.com/svn/trunk@9370 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "add asserts to point<-->verb helpers"Gravatar reed@google.com2013-05-30
| | | | | | This reverts commit b4775ac7b55802e87231768f002e4b42f233b0aa. git-svn-id: http://skia.googlecode.com/svn/trunk@9347 2bbb7eff-a529-9590-31e7-b0007b416f81
* add asserts to point<-->verb helpersGravatar reed@google.com2013-05-30
| | | | | | | | | | patch from issue 16153005 BUG= Review URL: https://codereview.chromium.org/16195004 git-svn-id: http://skia.googlecode.com/svn/trunk@9344 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-05-20
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@9189 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add special handling of rectori case for gpuGravatar robertphillips@google.com2013-05-17
| | | | | | | | https://codereview.chromium.org/15080010/ git-svn-id: http://skia.googlecode.com/svn/trunk@9175 2bbb7eff-a529-9590-31e7-b0007b416f81
* need to clamp all of the cubic points after a chop, in case our finite precisionGravatar reed@google.com2013-05-08
| | | | | | | | | | | | meant we didn't compute values below the chop-point. crbug:234190 R=caryclark@google.com Review URL: https://codereview.chromium.org/14607012 git-svn-id: http://skia.googlecode.com/svn/trunk@9071 2bbb7eff-a529-9590-31e7-b0007b416f81
* turn on pathops unit testGravatar caryclark@google.com2013-04-12
| | | | | | | | | | | | | | | | | | | This temporarily disables SK_ENABLE_INST_COUNT ( skbug.com/1219 ) This fixes a linktime error on VS2012 in PathTest.cpp; -SK_ScalarInfinity should be SK_ScalarNegativeInfinity instead. This adds pathops and pathops unit tests to the main unit tests. Should this change destabilize anything, it should be sufficient to comment out the pathops gypi includes. at test.gyp:18,21. Review URL: https://codereview.chromium.org/14137010 git-svn-id: http://skia.googlecode.com/svn/trunk@8644 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-04-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8608 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix bug introduced with SK_IGNORE_CUBIC_STROKE_FIX where we no longer respectedGravatar reed@google.com2013-04-10
| | | | | | | | | | | | | subDivide limit. This caused problems with degenate paths (too much recursion). The fix was two parts: 1. decrement the subDivide limit as we recurse 2. up the limit for cubics to 7, to match our current quality added unittest that replicated the too-much-recursion bug. Review URL: https://codereview.chromium.org/14086002 git-svn-id: http://skia.googlecode.com/svn/trunk@8599 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change random number generator for 'tests' to SkMWCRandom. Also removes some Gravatar jvanverth@google.com2013-03-04
| | | | | | | | | | | | | | | | | | | | unused headers and fixes a couple of bugs exposed by changing the random number generator: First, the function SkMatrix::getMaxStretch() had an error where it was testing the square of a number against near-zero. This led to it occasionally taking a cheaper but imprecise path for computing the eigenvalues of the matrix. It's been replaced with a check against the square of SK_ScalarNearlyZero. The second case was a failure in ClipStackTest, where it hit the rare case of a practically empty clip stack (it has a single Union) and we set a tight bounds. The bounds rect doesn't get set by GrReducedClip::ReduceClipStack() in this case, so when it clips the reduced stack it's clipping against garbage, and the resulting regions don't match. The solution is to initialize the tightBounds rect. git-svn-id: http://skia.googlecode.com/svn/trunk@7952 2bbb7eff-a529-9590-31e7-b0007b416f81
* Tests : Unused parameters cleanupGravatar sugoi@google.com2013-02-27
| | | | | | | I removed unused parameters in the tests wherever it was trivial to do so. I'm trying to get the easy ones out of the way before we get into more involved discussions around this. Review URL: https://codereview.appspot.com/7394055 git-svn-id: http://skia.googlecode.com/svn/trunk@7891 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove obsolete build flag SK_IGNORE_CONVEX_QUAD_OPTGravatar reed@google.com2013-02-22
| | | | | | Review URL: https://codereview.appspot.com/7363046 git-svn-id: http://skia.googlecode.com/svn/trunk@7820 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverse sense of convex-quad-fix compiler flagGravatar robertphillips@google.com2013-01-23
| | | | | | | | https://codereview.appspot.com/7206045/ git-svn-id: http://skia.googlecode.com/svn/trunk@7349 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-19
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7293 2bbb7eff-a529-9590-31e7-b0007b416f81
* increase iteration count from 16 to 24, when computing cubic-line intersection.Gravatar reed@google.com2013-01-18
| | | | | | | | | | | This fixes crbug 170666. Before the fix, were were finishing the "clip" step with a curve that was still partly negative, and so as assert would fire. added unittest to confirm that the assert doesn't fire. git-svn-id: http://skia.googlecode.com/svn/trunk@7278 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-16
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7215 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix bug in cubic-clipper (SkEdgeClipper). When we chop the cubic on Top/BottomGravatar reed@google.com2013-01-15
| | | | | | | | | | | | | | | | | of the cliprect, we (correctly) clamp the Y coordinate of the control-point right next to the on-curve point that was chopped (this ensures we don't go slightly outside of the clip-rect due to imperfect T value calculation). However, the code was also clamping the other control-point as well, resulting in warping the cubic, which could sometimes force it outside of the clip. The fix is to just remove the line of code that clampped the 2nd control-point. unittest added to reproduce a test cubic that triggered an assert, due to the cubic being outside of the cliprect. The test (w/o the fix) will assert in a SK_DEBUG build. Review URL: https://codereview.appspot.com/7100056 git-svn-id: http://skia.googlecode.com/svn/trunk@7184 2bbb7eff-a529-9590-31e7-b0007b416f81
* Enable warnings-as-errors on Windows.Gravatar bsalomon@google.com2013-01-08
| | | | | | Review URL: https://codereview.appspot.com/7066054 git-svn-id: http://skia.googlecode.com/svn/trunk@7094 2bbb7eff-a529-9590-31e7-b0007b416f81
* check for bad enum use when adding contoursGravatar reed@google.com2012-11-26
| | | | | | Review URL: https://codereview.appspot.com/6849103 git-svn-id: http://skia.googlecode.com/svn/trunk@6547 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-11-22
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6540 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add isRect variant that returns path closure and direction.Gravatar caryclark@google.com2012-11-21
| | | | | | | | Add path test to verify that when isRect() returns false, output parameters are unchanged. Review URL: https://codereview.appspot.com/6855074 git-svn-id: http://skia.googlecode.com/svn/trunk@6524 2bbb7eff-a529-9590-31e7-b0007b416f81
* detect wrapped rect in pathGravatar caryclark@google.com2012-11-21
| | | | | | | | | | | | | Allow a rect to start in the middle of a span, and wrap all the way around. Initialize variable to suppress warning. Add tests to detect rects constructed from a stroked path. Review URL: https://codereview.appspot.com/6847082 git-svn-id: http://skia.googlecode.com/svn/trunk@6522 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-11-20
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6500 2bbb7eff-a529-9590-31e7-b0007b416f81
* add two nested rect detector to pathGravatar caryclark@google.com2012-11-19
| | | | | | | | | | | | | Tease apart existing one rect path detector so that a new variant can detect two nested rects as well. Add tests to verify that both one and two rect detectors both work and return the correct results. Suppress other warnings in PathTest. Review URL: https://codereview.appspot.com/6850059 git-svn-id: http://skia.googlecode.com/svn/trunk@6475 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove unused (and undefined) SkColorSpace parameter.Gravatar mike@reedtribe.org2012-11-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6427 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-11-14
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6413 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add a conservativelyContainsRect function to SkPath.Gravatar bsalomon@google.com2012-11-13
| | | | | | Review URL: https://codereview.appspot.com/6852044 git-svn-id: http://skia.googlecode.com/svn/trunk@6411 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-11-13
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6409 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkPath cache the result of cheapComputeDirection.Gravatar bsalomon@google.com2012-11-13
| | | | | | Review URL: https://codereview.appspot.com/6810111 git-svn-id: http://skia.googlecode.com/svn/trunk@6394 2bbb7eff-a529-9590-31e7-b0007b416f81
* add tests for degenerate serifs to computeDirectionGravatar reed@google.com2012-11-13
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6391 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-10-25
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6088 2bbb7eff-a529-9590-31e7-b0007b416f81
* If a path is known to be nonfinite, don't forget that in our autoboundsGravatar reed@google.com2012-10-24
| | | | | | | | | helper. "Once a non-finite, always a non-finite". Inspired by crbug/157157 Review URL: https://codereview.appspot.com/6764047 git-svn-id: http://skia.googlecode.com/svn/trunk@6087 2bbb7eff-a529-9590-31e7-b0007b416f81
* Removed degenerate quads from zero radius Chrome-style round rectsGravatar robertphillips@google.com2012-10-23
| | | | | | | | https://codereview.appspot.com/6737059/ git-svn-id: http://skia.googlecode.com/svn/trunk@6053 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-10-19
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6013 2bbb7eff-a529-9590-31e7-b0007b416f81
* Place r5997 (make arcto's convex) behind a compiler flag to delay day of ↵Gravatar robertphillips@google.com2012-10-19
| | | | | | reckoning with Webkit baselines git-svn-id: http://skia.googlecode.com/svn/trunk@6012 2bbb7eff-a529-9590-31e7-b0007b416f81
* Altered arcTo's canonical points to (usually) be convexGravatar robertphillips@google.com2012-10-18
| | | | | | | | | | https://codereview.appspot.com/6709051/ This will require rebaselining of: degeneratesegments, shadertext & shadertext2 git-svn-id: http://skia.googlecode.com/svn/trunk@5997 2bbb7eff-a529-9590-31e7-b0007b416f81
* fixed compiler complaintsGravatar robertphillips@google.com2012-09-17
| | | | | | | | http://codereview.appspot.com/6499124/ git-svn-id: http://skia.googlecode.com/svn/trunk@5565 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-09-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@5561 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix fragile cubic stepper, where we want to assert that each tesselated segmentGravatar reed@google.com2012-09-14
| | | | | | | | | | | is monotonically going down, but the finite math we use cannot ensure that... so we explicitly pin the y-value after it is calculated. add unittest that exercises the bug/assert that was found on an SVG site git-svn-id: http://skia.googlecode.com/svn/trunk@5544 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 II of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6474054 git-svn-id: http://skia.googlecode.com/svn/trunk@5263 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix handling of infinite bounds during "fast transforms".Gravatar tomhudson@google.com2012-08-10
| | | | | | | | http://codereview.appspot.com/6449125/ git-svn-id: http://skia.googlecode.com/svn/trunk@5042 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding storage of SkPath::fIsOvalGravatar robertphillips@google.com2012-08-07
| | | | | | | | http://codereview.appspot.com/6453085/ git-svn-id: http://skia.googlecode.com/svn/trunk@4991 2bbb7eff-a529-9590-31e7-b0007b416f81