aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPath.cpp
Commit message (Collapse)AuthorAge
* remove SK_SUPPORT_LEGACY_ARCTO_QUADS codeGravatar reed2015-03-20
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1023103004
* Remove SK_SUPPORT_LEGACY_ADDOVALGravatar fmalita2015-03-09
| | | | | | | | | The flad has been retired from Chromium. BUG=chromium:458898 R=reed@google.com Review URL: https://codereview.chromium.org/994533002
* add double precision convex testGravatar caryclark2015-03-02
| | | | | | BUG=389050 Review URL: https://codereview.chromium.org/975523002
* treat backwards quads as not convexGravatar caryclark2015-03-02
| | | | | | | | | | If a quad, cubic, or conic goes back on itself, assume it's not convex. In a future CL, we could check to see if the curve is linear so that linear curves are treated the same as lines. BUG=skia:3469 Review URL: https://codereview.chromium.org/971773002
* 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
* Reset conicWeights in SkPath::consumeDegenerateSegments when rewinding to ↵Gravatar robertphillips2015-02-23
| | | | | | | | | | | | last Move op Without this patch the iterator can end up running off the end of the conic weights if there is a mixture of degenerate and non-degenerate ops Note: we might want to suppress the generation of degenerate conics and lines in SkPath::addRRect BUG=459897 Review URL: https://codereview.chromium.org/954453003
* add gm for path-arcs, and catch degenerate arc in conic-caseGravatar reed2015-02-17
| | | | | | BUG=skia:3428 Review URL: https://codereview.chromium.org/931183002
* Remove SK_SUPPORT_LEGACY_ADDRRECTGravatar fmalita2015-02-17
| | | | | | | | | The flag is no longer used in Chromium. BUG=458898 R=reed@google.com,robertphillips@google.com Review URL: https://codereview.chromium.org/929173002
* Remove android specific srcPath from SkPathGravatar djsollen2015-02-17
| | | | Review URL: https://codereview.chromium.org/926693002
* use conics for arcToGravatar reed2015-02-09
| | | | | | | | guarded by SK_SUPPORT_LEGACY_ARCTO_QUADS BUG=skia: Review URL: https://codereview.chromium.org/892703002
* share code between arcTo and addArc, update doxGravatar reed2015-01-29
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/863123005
* reorg some path routines, preparing to switch arcs to conicsGravatar reed2015-01-29
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/887783002
* use conics for ovals and roundrectsGravatar reed2015-01-06
| | | | | | | | | This reverts commit e3b61eb7997d12c5f9b844dd3af1847492d9f411. BUG=skia: TBR= Review URL: https://codereview.chromium.org/834303002
* Revert of use conics for ovals and roundrects (patchset #1 id:1 of ↵Gravatar reed2015-01-06
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/817283005/) Reason for revert: need fix in edgebuilder+aa Original issue's description: > use conics for ovals and roundrects > > adapted from https://codereview.chromium.org/831313002/ > > BUG=skia: > TBR= > > Committed: https://skia.googlesource.com/skia/+/2bf1c4d58b84c73c6421edcb25e3afb4971da200 TBR=reed@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/840573002
* use conics for ovals and roundrectsGravatar reed2015-01-05
| | | | | | | | | adapted from https://codereview.chromium.org/831313002/ BUG=skia: TBR= Review URL: https://codereview.chromium.org/817283005
* Remove SkPath::asRectGravatar robertphillips2015-01-05
| | | | | | | | | | AFAICT the asRect entry point is not needed. Greg: GPU Reed: API Cary: Path Review URL: https://codereview.chromium.org/833193002
* Cleanup isRect variantsGravatar robertphillips2015-01-05
| | | | Review URL: https://codereview.chromium.org/832083002
* Update stroke path to use rect returned from isRect (to fix trailing moveTo bug)Gravatar robertphillips2014-12-29
| | | | | | | | | | This basically recreates what was done in: https://codereview.chromium.org/16950021/ (add rect-output parameter to isRect, allowing us to return the correct bounds even if a rectagular path has a trailing moveTo) with the addition of GM representation BUG=skia:247770 Review URL: https://codereview.chromium.org/834503002
* Fix bound returned by SkPath::isRect when the path contains a trailing moveToGravatar robertphillips2014-12-29
| | | | | | | | | | | | | | | | | | Oddly enough this was fixed in: https://codereview.chromium.org/16950021/ (add rect-output parameter to isRect, allowing us to return the correct bounds even if a rectagular path has a trailing moveTo) but was reverted here: https://skia.googlesource.com/skia/+/8fd160350ca5f57fbb1b2e03383c5778414a9b48 since it appeared to be crashing Chrome's trybots. I think it just fell through the cracks after that. If this sticks I will land a follow on patch for the stroke issue reported in the original bug (crbug.com/247770). BUG=247770,445368 Review URL: https://codereview.chromium.org/834483002
* use conics for addRRectGravatar reed2014-12-17
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/792493005
* use conicsGravatar reed2014-12-17
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/455043002
* Fix rrects that are large enough that we lose/gain a bit when we add the ↵Gravatar reed2014-12-15
| | | | | | | | | | radius to a bounds coordinate. add test that triggers assert in addRRect BUG=skia:3239 Review URL: https://codereview.chromium.org/803153003
* add dumpHex option to rect and rrect, to match pathGravatar reed2014-12-15
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/801383002
* change SkPoint::setLength to set itself to (0,0) if it starting length is ↵Gravatar reed2014-12-09
| | | | | | | | | degenerate. BUG=skia:3203 TBR=caryclark Review URL: https://codereview.chromium.org/785933003
* add convexity logic and tests for scalar max, Inf, and NaNGravatar caryclark2014-12-08
| | | | | | | | | | PathOps relies on isConvex() only returning true for trivially convex paths. The old logic also returns true if the paths that contain NaNs and Infinities. Return kUnknown_Convexity instead in those cases and in cases where the convexity logic computes intermediaries that overflow. Review URL: https://codereview.chromium.org/784593002
* Fix yet another convexicator issueGravatar robertphillips2014-11-17
| | | | | | | | | | | | | | | | This CL fixes the case where a bad initial vector (i.e., nearly zero) managed to short circuit all of the convexicator's logic. The initial bad vector would become the last vector and then never get displaced. The history of this is: https://codereview.chromium.org/298973004/ Switched the convexicator to not advance the last vector when the cross product wasn't significant https://codereview.chromium.org/573763002/ Fixed a bug (crbug.com/412640) wherein a zero area path was being incorrectly categorized as convex b.c. opposite but equal vectors were not signaling concavity. BUG=433683 Review URL: https://codereview.chromium.org/727283003
* Set temporary paths volatile so we don't cache them.Gravatar jvanverth2014-10-24
| | | | | | | | | | Any path that is generated frame-to-frame should not be rendered by using the DistanceFieldPathRenderer, because generating the initial distance field, uploading it and rendering it takes longer than the SoftwarePathRenderer. BUG=skia:2935 Review URL: https://codereview.chromium.org/677463002
* add float equivalent in dumpHex output as commentGravatar caryclark2014-10-23
| | | | | | R=reed@google.com,bsalomon@google.com Review URL: https://codereview.chromium.org/676803002
* Fix convexicator bugGravatar robertphillips2014-09-16
| | | | | | | | | BUG=crbug.com/412640 R=caryclark@google.com, bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/573763002
* 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
* 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