aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathTest.cpp
Commit message (Collapse)AuthorAge
...
* add dumpHex() option to SkPathGravatar caryclark2014-09-15
| | | | | | | | | | | | | This provides exact precision to help debugging when the float representation of a SkScalar may introduce error. R=reed@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/571973003
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002
* Add dirty_after_edit to SkPath::moveTo. Add commented out test case that ↵Gravatar bsalomon2014-08-28
| | | | | | | | | | | triggers assert. BUG=skia:1460 R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/517023003
* Fallback to moveTo when unable to find the first tangent in cubicToGravatar piotaixr2014-08-26
| | | | | | | | | | | | | | | | | | | | When calling cubicTo(a, b, c) and if the distance between fPrevPt and a is too small, b is used instead of a to calculate the first tangent, even if the distance between fPrevPt and b is too small. In debug mode, this is causing an assertion to fail in SkPathStroker::preJoinTo() and, in Release, the use of an unitialized value. The first patch set is adding a failing test. The second one add the fix to SkPathStroker::cubicTo() BUG=skia:2820 R=bsalomon@chromium.org, junov@chromium.org, reed@google.com, caryclark@google.com, bsalomon@google.com Author: piotaixr@chromium.org Review URL: https://codereview.chromium.org/460813002
* add path dump testGravatar caryclark2014-06-24
| | | | | | | | | | | | | Add a unit test for SkPath::dump(). The unit test exposed a minor bug (inconsistent CRs) and an unused parameter (title). R=bsalomon@google.com TBR=bsalomon BUG=skia:1836 Author: caryclark@google.com Review URL: https://codereview.chromium.org/351833003
* In convexity checker don't advance last vector when x-product isn't significant.Gravatar commit-bot@chromium.org2014-05-22
| | | | | | | | | | | BUG=skia:2235 R=caryclark@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/298973004 git-svn-id: http://skia.googlecode.com/svn/trunk@14845 2bbb7eff-a529-9590-31e7-b0007b416f81
* add rounding-using-doubles methods on SkScalar and SkRectGravatar commit-bot@chromium.org2014-05-05
| | | | | | | | | | | | | | | Inspired by the excellent repro case for https://crbug.com/364224 patch from issue 265933010 BUG=skia: R=bungeman@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/267003002 git-svn-id: http://skia.googlecode.com/svn/trunk@14566 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2014-02-12
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@13418 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding new 'extend' mode to SkPath::addPathGravatar commit-bot@chromium.org2014-02-11
| | | | | | | | | | | BUG=261727 R=reed@google.com, caryclark@google.com, schenney@chromium.org, robertphillips@google.com Author: junov@chromium.org Review URL: https://codereview.chromium.org/151353006 git-svn-id: http://skia.googlecode.com/svn/trunk@13415 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix minor error between kStroke_PathAsRect and kFill_PathAsRect in ↵Gravatar commit-bot@chromium.org2014-02-11
| | | | | | | | | | | | SkPath::asRect R=caryclark@google.com, reed@google.com Author: yunchao.he@intel.com Review URL: https://codereview.chromium.org/138703008 git-svn-id: http://skia.googlecode.com/svn/trunk@13390 2bbb7eff-a529-9590-31e7-b0007b416f81
* add alternative to isRect named asRectGravatar commit-bot@chromium.org2014-01-25
| | | | | | | | | | | | | | This defines yunchao's proposed interface in terms of an existing implementation. BUG=skia: R=reed@google.com, yunchao.he@intel.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/140953003 git-svn-id: http://skia.googlecode.com/svn/trunk@13183 2bbb7eff-a529-9590-31e7-b0007b416f81
* Cleanup: Sanitize the order of includes under tests/Gravatar tfarina@chromium.org2014-01-24
| | | | | | | | | | | | | | | | Initially this was to make sure Test.h appeared after the Sk*.h includes. Patch generated by the following command line: $ ~/chromium/src/tools/sort-headers.py tests/*.cpp BUG=None TEST=tests R=robertphillips@google.com Review URL: https://codereview.chromium.org/145313004 git-svn-id: http://skia.googlecode.com/svn/trunk@13177 2bbb7eff-a529-9590-31e7-b0007b416f81
* change isRect to return true for 3-sided rectangular pathsGravatar commit-bot@chromium.org2014-01-15
| | | | | | | | | | | BUG=skia: R=caryclark@google.com, yunchao.he@intel.com Author: reed@google.com Review URL: https://codereview.chromium.org/139483002 git-svn-id: http://skia.googlecode.com/svn/trunk@13092 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move macros from TestClassDef.h to Test.hGravatar commit-bot@chromium.org2014-01-14
| | | | | | | | | | | | | | Motivation: those macros don't make any sense without the definitions in Test.h. BUG= R=mtklein@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/138563004 git-svn-id: http://skia.googlecode.com/svn/trunk@13074 2bbb7eff-a529-9590-31e7-b0007b416f81
* Convert SkWriter32 to use an SkTDArray for its internal storage.Gravatar commit-bot@chromium.org2014-01-14
| | | | | | | | | | | | | | | | | | | | | | | | This reduces the allocation overhead of a null picture (create, beginRecording(), endRecording) from about 18K to about 1.9K. (There's still lots more to prune.) SkPictureFlat can exploit the fact that Writer32 is contiguous simplify its memory management. The Writer32 itself becomes the scratch buffer. Remove lots and lots of arbitrary magic numbers that were size guesses and minimum allocation sizes. Keep your eyes open for the big obvious DUH why we save 16K per picture! (Spoiler alert. It's because that first save we issue in beginRecording() forces the old SkWriter32 to allocate 16K.) Tests passing, DM passing. bench --match writer: ~20% faster null bench_record: ~30% faster bench_record on buildbot .skps: ~3-6% slower, ranging 25% faster to 20% slower bench_pictures on buildbot .skps: ~1-2% faster, ranging 13% faster to 28% slower BUG=skia:1850 R=reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/137433003 git-svn-id: http://skia.googlecode.com/svn/trunk@13073 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floatsGravatar reed@google.com2013-12-17
| | | | | | | | | | | | | To keep the CL (slightly) managable, this does not make any changes to existing macros (e.g. SkScalarMul). Just tackling #ifdef constructs this time around. BUG= R=bsalomon@google.com, caryclark@google.com Review URL: https://codereview.chromium.org/117053002 git-svn-id: http://skia.googlecode.com/svn/trunk@12712 2bbb7eff-a529-9590-31e7-b0007b416f81
* Improved SkPathRef interface securityGravatar robertphillips@google.com2013-12-13
| | | | | | | | https://codereview.chromium.org/115323004/ git-svn-id: http://skia.googlecode.com/svn/trunk@12676 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move segment mask from SkPath to SkPathRefGravatar robertphillips@google.com2013-12-12
| | | | | | | | https://codereview.chromium.org/105083003/ git-svn-id: http://skia.googlecode.com/svn/trunk@12660 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use DEFINE_TESTCLASS_SHORT macro in tests.Gravatar tfarina@chromium.org2013-12-12
| | | | | | | | | | | | | The three version of DEFINE_TESTCLASS macro is deprecated and thus just use the simple, short one. BUG=None TEST=out/Debug/tests R=mtklein@google.com, bsalomon@google.com, robertphillips@google.com Review URL: https://codereview.chromium.org/100113004 git-svn-id: http://skia.googlecode.com/svn/trunk@12653 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-12-04
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12477 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix for SkPathRef::CreateTransformedCopy bugGravatar robertphillips@google.com2013-12-03
| | | | | | | | https://codereview.chromium.org/99423004/ git-svn-id: http://skia.googlecode.com/svn/trunk@12464 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move fIsOval from SkPath to SkPathRefGravatar robertphillips@google.com2013-12-03
| | | | | | | | https://codereview.chromium.org/89123002/ git-svn-id: http://skia.googlecode.com/svn/trunk@12463 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of r12450 (Move fIsOval from SkPath to SkPathRef)Gravatar robertphillips@google.com2013-12-03
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12452 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move fIsOval from SkPath to SkPathRefGravatar robertphillips@google.com2013-12-02
| | | | | | | | https://codereview.chromium.org/89123002/ git-svn-id: http://skia.googlecode.com/svn/trunk@12450 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkFloatToScalar macroGravatar commit-bot@chromium.org2013-11-25
| | | | | | | | | | | BUG= R=reed@google.com, djsollen@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/85463005 git-svn-id: http://skia.googlecode.com/svn/trunk@12385 2bbb7eff-a529-9590-31e7-b0007b416f81
* increase coverage of SkPath.cpp, remove unused codeGravatar commit-bot@chromium.org2013-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using Mike Klein's excellent coverage tool, increase the unit testing of SkPath.cpp from 70% to 95%. Along the way, determined that these functions were not maintained or used: SkPath::pathTo SkPath::contains as well as a large block of SkPath::cheapGetDirection(). Changed SkPath::validate() to permit infinities in the path data points. Fixed errors in preserving direction. Fixed error setting direction when convexity is unknown. Added missing conic to moveTo only detector. BUG= R=bsalomon@google.com, reed@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/65493004 git-svn-id: http://skia.googlecode.com/svn/trunk@12291 2bbb7eff-a529-9590-31e7-b0007b416f81
* use quads for mixed radius rrectsGravatar commit-bot@chromium.org2013-11-08
| | | | | | | | | | | | | | | Create a specialized version of adding a pair of corner quads that avoids the overhead of the full arc machinery. This is on the way to changing Chrome to calling Skia directly to create fully general round rects rather than rolling their own. R=robertphillips@google.com, reed@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/60203002 git-svn-id: http://skia.googlecode.com/svn/trunk@12190 2bbb7eff-a529-9590-31e7-b0007b416f81
* Checking structure sizes before reading them from memory to avoid ↵Gravatar commit-bot@chromium.org2013-11-05
| | | | | | | | | | | | | | | | | overflowing the buffer's stream. BUG= R=reed@google.com, mtklein@google.com, senorblanco@chromium.org Committed: https://code.google.com/p/skia/source/detail?r=12114 Committed: https://code.google.com/p/skia/source/detail?r=12119 Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/41253002 git-svn-id: http://skia.googlecode.com/svn/trunk@12130 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Checking structure sizes before reading them from memory to avoid ↵Gravatar reed@google.com2013-11-04
| | | | | | | | overflowing the buffer's stream." This reverts commit 6bc22e8ef1ea70a1b58409aa21254358c50f149a. git-svn-id: http://skia.googlecode.com/svn/trunk@12124 2bbb7eff-a529-9590-31e7-b0007b416f81
* Checking structure sizes before reading them from memory to avoid ↵Gravatar sugoi@google.com2013-11-04
| | | | | | | | | | | | | overflowing the buffer's stream. BUG= R=reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=12114 Review URL: https://codereview.chromium.org/41253002 git-svn-id: http://skia.googlecode.com/svn/trunk@12119 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r12114 due to https://code.google.com/p/skia/issues/detail?id=1794 ↵Gravatar epoger@google.com2013-11-04
| | | | | | ('Assertion failures on various buildbots as of r12114') git-svn-id: http://skia.googlecode.com/svn/trunk@12115 2bbb7eff-a529-9590-31e7-b0007b416f81
* Checking structure sizes before reading them from memory to avoid ↵Gravatar sugoi@google.com2013-11-04
| | | | | | | | | | | overflowing the buffer's stream. BUG= R=reed@google.com Review URL: https://codereview.chromium.org/41253002 git-svn-id: http://skia.googlecode.com/svn/trunk@12114 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, ↵Gravatar reed@google.com2013-10-31
| | | | | | | | | | | | since it triggers a warning"" This reverts commit 1e787c38fa71f2a21fd728f1b1d620b9b09b0d3d. BUG= Review URL: https://codereview.chromium.org/54603004 git-svn-id: http://skia.googlecode.com/svn/trunk@12057 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it ↵Gravatar reed@google.com2013-10-31
| | | | | | | | triggers a warning" This reverts commit 1d22c4aaf9d8f053f25194a1ed74b137bfb19497. git-svn-id: http://skia.googlecode.com/svn/trunk@12056 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers ↵Gravatar reed@google.com2013-10-31
| | | | | | | | | | | a warning BUG= R=robertphillips@google.com, senorblanco@chromium.org, vandebo@chromium.org Review URL: https://codereview.chromium.org/51033004 git-svn-id: http://skia.googlecode.com/svn/trunk@12055 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use SkPathRef gen id for SkPath::getGenerationIDGravatar commit-bot@chromium.org2013-10-30
| | | | | | | | | | R=mtklein@google.com, robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/49693002 git-svn-id: http://skia.googlecode.com/svn/trunk@12029 2bbb7eff-a529-9590-31e7-b0007b416f81
* add disabled tests, in pref for experimental isRect behaviorGravatar reed@google.com2013-10-16
| | | | | | | | | BUG= R=bsalomon@google.com Review URL: https://codereview.chromium.org/27513003 git-svn-id: http://skia.googlecode.com/svn/trunk@11810 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-10-16
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@11800 2bbb7eff-a529-9590-31e7-b0007b416f81
* account for inverse-paths when we prealloc storage in the rgn-builderGravatar reed@google.com2013-10-15
| | | | | | | | | | | test inversepath->rgn BUG= R=caryclark@google.com Review URL: https://codereview.chromium.org/27222005 git-svn-id: http://skia.googlecode.com/svn/trunk@11776 2bbb7eff-a529-9590-31e7-b0007b416f81
* meant to DISABLE this testGravatar reed@google.com2013-10-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@11775 2bbb7eff-a529-9590-31e7-b0007b416f81
* add test for https://code.google.com/p/skia/issues/detail?id=1706Gravatar reed@google.com2013-10-15
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/27344002 git-svn-id: http://skia.googlecode.com/svn/trunk@11774 2bbb7eff-a529-9590-31e7-b0007b416f81
* Refactor PathTest.cpp test_isNestedRects and test_isRect.Gravatar bungeman@google.com2013-09-25
| | | | | | | | | | | The existing implementations make it difficult to add new tests and rely on non-local side effects. R=bsalomon@google.com Review URL: https://codereview.chromium.org/24502004 git-svn-id: http://skia.googlecode.com/svn/trunk@11455 2bbb7eff-a529-9590-31e7-b0007b416f81
* promote SkImage::AlphaType to SkAlphaTypeGravatar reed@google.com2013-09-20
| | | | | | | | | BUG= R=bsalomon@google.com Review URL: https://codereview.chromium.org/24130009 git-svn-id: http://skia.googlecode.com/svn/trunk@11421 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
* My clang now doesn't complain about !"foo".Gravatar mtklein@google.com2013-08-22
| | | | | | | | | BUG= R=robertphillips@google.com Review URL: https://codereview.chromium.org/22875037 git-svn-id: http://skia.googlecode.com/svn/trunk@10874 2bbb7eff-a529-9590-31e7-b0007b416f81
* 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