aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPath.cpp
Commit message (Collapse)AuthorAge
...
* 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
* Remove SK_IGNORE_QUAD_RR_CORNERS_OPT-related code.Gravatar Florin Malita2014-08-01
| | | | | | | | | Now that the flag is no longer used in Chromium (https://codereview.chromium.org/426593006/), we can remove it. R=bsalomon@google.com, reed@google.com, robertphillips@google.com Review URL: https://codereview.chromium.org/430473012
* 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
* Add dump() to SkClipStack to help with debugging.Gravatar bsalomon2014-06-09
| | | | | | | | R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/311263015
* 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
* Revert of r13379 (Move fLastMoveToIndex from SkPath to SkPathRef - ↵Gravatar commit-bot@chromium.org2014-02-12
| | | | | | | | | | | | | https://codereview.chromium.org/146913002/) due to image quality regression in Chromium. See crbug.com/343123 (Regression - UI issue observed for any "Notification infobars" in Chrome browser) R=bsalomon@google.com TBR=bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/137863006 git-svn-id: http://skia.googlecode.com/svn/trunk@13421 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
* Move fLastMoveToIndex from SkPath to SkPathRefGravatar robertphillips@google.com2014-02-10
| | | | | | | | https://codereview.chromium.org/146913002/ git-svn-id: http://skia.googlecode.com/svn/trunk@13379 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
* No deduping dictionaries for matrices and regions.Gravatar commit-bot@chromium.org2014-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | There's little benefit to deduping matrices and regions: they're infrequently used, and doubly infrequently reused. Their use-weighted byte cost is tiny. There is some downside to deduping matrices and regions. Even when they're not used, we prepare dictionaries for deduping them for every picture. Each of these dictionaries costs 160 bytes, so two unused dictionaries make a big chunk of the ~1100 bytes it takes to allocate an SkPictureRecord. (~330 come from parent class SkCanvas, 768 from SkPictureRecord itself, here reduced to 448). One side benefit of not deduping these guys is that the change weighs -140 lines of code. It may go without saying, but this breaks the picture format. Testing: out/Debug/tests && out/Debug/dm (which runs all picture modes by default) BUG=skia:1850 R=reed@google.com, bensong@google.com, robertphillips@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/143883006 git-svn-id: http://skia.googlecode.com/svn/trunk@13149 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2014-01-16
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@13105 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 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
* Fix compilation with SK_ENABLE_INST_COUNT=1Gravatar commit-bot@chromium.org2013-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add INHERITED declarations to class declarations that prevent compilation with the flag. Remove SK_DEFINE_INST_COUNT from all class implementations. Instead, use function-local static variables in the reference count helper classes to create the global instances to store the needed info. The accessor functions are defined inline in the helper classes, so definitions are not needed. The initialization point of the variables should be as well defined as previously. Remove SK_DECLARE_INST_COUNT_TEMPLATE and use SK_DECLARE_INST_COUNT instead. This avoids possible future compilation errors further. For SK_ENABLE_INST_COUNT=0 compilation, add an empty static member function to all classes that use SK_DECLARE_INST_COUNT and SK_DECLARE_INST_COUNT_ROOT macros. The function ensures that classes contain public INHERITED typedef. This member function seems to be compiled away. This shouĺd ensure that part of the compilation errors are caught earlier. Also adds DSK_DECLARE_INST_COUNT to few SkPDFDict subclasses. R=robertphillips@google.com, richardlin@chromium.org, bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/98703002 git-svn-id: http://skia.googlecode.com/svn/trunk@12501 2bbb7eff-a529-9590-31e7-b0007b416f81
* Code cleanup following recapture of skpsGravatar robertphillips@google.com2013-12-03
| | | | | | | | https://codereview.chromium.org/88233003/ git-svn-id: http://skia.googlecode.com/svn/trunk@12472 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
* Guard against most unintentionally ephemeral SkAutoFoo instantiations.Gravatar commit-bot@chromium.org2013-11-18
| | | | | | | | | | | | | | | | | | | I think I applied the trick everywhere possible. Limitations: - can't be used with templated classes - all constructors and destructors must be defined inline A couple of the SkAutoFoo were unused in Skia, Chromium, and Android, so I deleted them. This change caught the same bugs Cary found in SkPath, plus one more in SampleApp. BUG= R=reed@google.com, caryclark@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/72603005 git-svn-id: http://skia.googlecode.com/svn/trunk@12301 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
* Adding error checks to SkRBufferGravatar commit-bot@chromium.org2013-11-08
| | | | | | | | | | | BUG= R=robertphillips@google.com, bsalomon@google.com, reed@google.com Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/61913002 git-svn-id: http://skia.googlecode.com/svn/trunk@12202 2bbb7eff-a529-9590-31e7-b0007b416f81
* optimize floating pt, save a few instructionsGravatar caryclark@google.com2013-11-08
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12199 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
* Construct round rects with perpendicular tangents.Gravatar commit-bot@chromium.org2013-11-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The round rects are constructed as before out of quadratics, but without fudging the control points. Instead, the mid on- curve point is nudged slightly outward to prevent the convexity test from failing. The convexity test now includes an error term for sign inequality after computing the cross product of the control lines. When the control points are represented as vectors, the number of bits of precision may be greatly reduced. Account for this by passing the number of bits available from the original control point values into the equality check. Making round rect construction lines perpendicular improves the chances of success when path ops encounters clips. No new tests are needed -- this change is exercised by the convex Path unit tests and the gm tests arcofzorro and hairlines. R=robertphillips@google.com, reed@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/48783002 git-svn-id: http://skia.googlecode.com/svn/trunk@12085 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
* remove contains(x,y) for rects and rrects ... not well defined, and unusedGravatar reed@google.com2013-10-30
| | | | | | | | | BUG= R=robertphillips@google.com Review URL: https://codereview.chromium.org/51953003 git-svn-id: http://skia.googlecode.com/svn/trunk@12022 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverting r12010 (Use SkPathRef gen id for SkPath::getGenerationID ↵Gravatar robertphillips@google.com2013-10-29
| | | | | | https://codereview.chromium.org/49693002) due to test failures in PathTest on Android git-svn-id: http://skia.googlecode.com/svn/trunk@12012 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use SkPathRef gen id for SkPath::getGenerationIDGravatar commit-bot@chromium.org2013-10-29
| | | | | | | | | | R=mtklein@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/49693002 git-svn-id: http://skia.googlecode.com/svn/trunk@12010 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix cubic->quad RR corner regressionGravatar robertphillips@google.com2013-10-20
| | | | | | | | https://codereview.chromium.org/29673002/ git-svn-id: http://skia.googlecode.com/svn/trunk@11870 2bbb7eff-a529-9590-31e7-b0007b416f81
* Disable r11835 (Replace cubic round rect corners with quads) due to ↵Gravatar robertphillips@google.com2013-10-17
| | | | | | performance regression git-svn-id: http://skia.googlecode.com/svn/trunk@11841 2bbb7eff-a529-9590-31e7-b0007b416f81
* Replace cubic round rect corners with quadsGravatar robertphillips@google.com2013-10-17
| | | | | | | | https://codereview.chromium.org/26372006/ git-svn-id: http://skia.googlecode.com/svn/trunk@11835 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-09-28
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@11513 2bbb7eff-a529-9590-31e7-b0007b416f81
* This CL effectively reverts:Gravatar robertphillips@google.com2013-09-27
| | | | | | | | | | | | | r5997 Altered arcTo's canonical points to (usually) be convex (https://codereview.appspot.com/6709051/) r9928 GM (and fix) for drawArc capping issue (https://codereview.chromium.org/18271003/) Instead of pushing some of the on-curve points out to attain convexity, this patch pulls all the off curve points in. R=reed@google.com Review URL: https://codereview.chromium.org/24810002 git-svn-id: http://skia.googlecode.com/svn/trunk@11504 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move bound and isFinite into pathrefGravatar robertphillips@google.com2013-09-26
| | | | | | | | https://codereview.chromium.org/24350006/ git-svn-id: http://skia.googlecode.com/svn/trunk@11467 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
* remove uneeded SK_API declaration.Gravatar djsollen@google.com2013-08-09
| | | | | | | | R=robertphillips@google.com Review URL: https://codereview.chromium.org/22432005 git-svn-id: http://skia.googlecode.com/svn/trunk@10655 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
* Avoid counting verbs twice in SkPath::isEmpty()Gravatar commit-bot@chromium.org2013-08-05
| | | | | | | | | | | | | | | | Remove redundant call to SkPathRef::countVerbs. The intention was probably to count points. Instead, assert that all two-verb paths begin with a 'move' and that if the second verb is a 'line', then the point count is indeed two. BUG=1478 R=bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://chromiumcodereview.appspot.com/22171002 git-svn-id: http://skia.googlecode.com/svn/trunk@10527 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