aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkPath.h
Commit message (Collapse)AuthorAge
* allow move/zero-line/close to draw capsGravatar caryclark2016-02-22
| | | | | | | | R=fmalita@chromium.org BUG=skia:4784 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1720953002 Review URL: https://codereview.chromium.org/1720953002
* fix iter to document close correctlyGravatar caryclark2016-02-19
| | | | | | | | R=reed@google.com BUG=skia:4950 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1717623002 Review URL: https://codereview.chromium.org/1717623002
* Move SkTDArray to private.Gravatar bungeman2016-02-18
| | | | | | | TBR=reed Moving to private is good. Review URL: https://codereview.chromium.org/1707213002
* add interp pathGravatar caryclark2016-02-18
| | | | | | | | | | | Add path methods to determine if a pair of paths can be interpolated, and to interpolate them. R=reed@google.com, robertphillips@google.com BUG=skia:4549 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1703943003 Review URL: https://codereview.chromium.org/1703943003
* add last move to serialized pathGravatar caryclark2016-02-17
| | | | | | | | | | | | A deserialized path keeps the last move location so that a subsequent append to the path does not add an unwanted close verb. R=reed@oogle.com BUG=skia:4847 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1702393002 Review URL: https://codereview.chromium.org/1702393002
* Add svg path arctoGravatar caryclark2016-01-23
| | | | | | | | | | | | | The arcto() used by SVG in Chrome and Android is ported here, using conics instead of cubics. The logic is a direct transposition of the WebKit code. The attached GM includes SVG that draws the same as Skia. R=reed@google.com BUG=skia:3959 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1613303002 Review URL: https://codereview.chromium.org/1613303002
* Add SkPath::isLastContourClosed()Gravatar fs2016-01-20
| | | | | | | | | | | | | | Adds a simple method for checking if the last command/verb in the current contour is a 'close'. This will simplify determining "closedness" for blink::Path, and aid in the implementation of algorithms such as: https://drafts.fxtf.org/motion-1/#motion-processing (second item in list) GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1601103006 Review URL: https://codereview.chromium.org/1601103006
* add support for capped hairlinesGravatar caryclark2015-12-09
| | | | | | | | | Extend the ends of hairline and haircurve segments when the paint is set to square or round, and the line or curve is at the start or end of a contour. R=reed@google.com BUG=skia:4599 Review URL: https://codereview.chromium.org/1491843006
* Add an SkPath conic conversion utility.Gravatar fmalita2015-12-01
| | | | | | | | | Expose SkConic::chopIntoQuadsPOW2() as SkPath::ConvertConicToQuads(). BUG=chromium:315277 R=reed@google.com Review URL: https://codereview.chromium.org/1484373002
* add SkPath::isRRectGravatar caryclark2015-11-19
| | | | | | | | | | | Add helper to track when a round rect was added to a path, and then return the SkRRect specification that describes it. Move the implementation for SkPath::RawIter to SkPathRef so it can be used there as well. R=reed@google.com,robertphillips@google.com Review URL: https://codereview.chromium.org/1461763004
* Parametric SkPath oval/rect/rrect starting pointGravatar fmalita2015-11-17
| | | | | | | | | | | Extend the SkPath API to allow specifying the contour starting point. This will allow removing the explicit cubic code from Blink/Path. BUG=chromium:315277 R=reed@google.com,caryclark@google.com Review URL: https://codereview.chromium.org/1452203002
* SkPath::fFirstDirection: seq-cst -> relaxedGravatar mtklein2015-10-07
| | | | | | | | | | | | | | | | | | | We landed this originally with lazily-correct sequentially-consistent memory order. It turns out that's regressed performance, we think particularly when recording paths. We also think there's no need for anything but relaxed memory order here. We should see this chart go down if all goes well: https://perf.skia.org/#4329 There are also Chrome performance charts to watch in the linked bug. BUG=chromium:537700 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot,Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-TSAN No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/1393833003
* Make SkPath fFirstDirection atomic to fix tsan.Gravatar herb2015-09-28
| | | | | | | | | | There is no API change. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/1372103003
* Use static_assert instead of SK_COMPILE_ASSERT.Gravatar bungeman2015-08-20
| | | | | | | Now that static_assert is allowed, there is no need to use a non- standard compile time assertion Review URL: https://codereview.chromium.org/1306443004
* change getBounds to return 0000 iff there are zero pointsGravatar reed2015-07-28
| | | | | | | | | | This is a contract change for SkPath::getBounds(), which formally was defined to return 0,0,0,0 for a 1-point path, regardless of the coordinates of that point. This seems wacky/inconsistent, and was causing other bugs (incorrect bounds) when this was unioned with other rects. Does anyone remember why we defined it this way? BUG=513799 Review URL: https://codereview.chromium.org/1261773002
* Very tiny paths are subsumed by the ConvexicatorGravatar caryclark2015-07-14
| | | | | | | | | | | | | | | and are treated as convex when they are not. Allow the SkPath::Iter to leave degenerate path segments unmolested by passing an additional exact bool to next(). Treat any non-zero length as significant in addPt(). R=reed@google.com,robertphillips@google.com BUG=493450 Review URL: https://codereview.chromium.org/1228383002
* remove SkInstCntGravatar mtklein2015-06-26
| | | | | | | | | | | | | | It's been outclassed by Valgrind and leak sanitizer, and it seems to be causing problems for external folks building Skia. I'm not sure why our own builds seem unaffected. Latest thread: https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0 BUG=skia: Review URL: https://codereview.chromium.org/1217573002
* fix deserialization after FirstDirection change to pathsGravatar reed2015-06-11
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1185453003
* SkPath::Direction serves two masters:Gravatar reed2015-06-10
| | | | | | | | | | | | | - input param to addFoo (e.g. addRect), where only CW or CCW are valid) - output param from computing functions, that sometimes return kUnknown This CL's intent is to split these into distinct enums/features: - Direction (public) loses kUnknown, and is only used for input - FirstDirection (private) is used for computing the first direction we see when analyzing a contour BUG=skia: Review URL: https://codereview.chromium.org/1176953002
* simplify RawIter - don't return a pt in kCloseGravatar reed2015-05-27
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1156893003
* simplify RawIterGravatar reed2015-05-13
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1137783006
* minor fixes to cubics code and overall alignment of how bounds and tops are ↵Gravatar caryclark2015-04-29
| | | | | | | | | | | | computed for all curve types All but 17 extended tests work. A helper function is privately added to SkPath.h to permit a test to modify a given point in a path. BUG=skia:3588 Review URL: https://codereview.chromium.org/1107353004
* change isNestedRect to isNestedFillRectGravatar caryclark2015-04-08
| | | | | | | | | R=reed@google.com, bsalomon@google.com Let isNested(Fill)Rect return true if drawn path describes filled rectangles. Review URL: https://codereview.chromium.org/1073473002
* 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
* 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 android specific srcPath from SkPathGravatar djsollen2015-02-17
| | | | Review URL: https://codereview.chromium.org/926693002
* Expose SkPathRef::unique through SkPath.Gravatar djsollen2015-02-12
| | | | | | | | This allows for the removal of SkPath::mSourcePath on Android as they now have a better indicator of whether or not the path can be used again via the Java API. Review URL: https://codereview.chromium.org/913413004
* share code between arcTo and addArc, update doxGravatar reed2015-01-29
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/863123005
* Simplify SkInstCntGravatar mtklein2015-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code requires fewer macros to use it (just one), has less code in macro definitions, and has simpler synchronization code (just atomic ints, no SkOnce, no SkMutex, etc.) A minor downside, we lose indentation and reverse-ordering in the final report: Leaked SkRefCntBase: 7 Leaked SkFontMgr: 1 Leaked SkWeakRefCnt: 1 Leaked SkTypeface: 1 Leaked SkFlattenable: 3 Leaked SkXfermode: 3 Leaked SkPathRef: 1 Leaked SkPixelRef: 1 Leaked SkMallocPixelRef: 1 becomes Leaked SkXfermode: 3 Leaked SkMallocPixelRef: 1 Leaked SkPixelRef: 1 Leaked SkPathRef: 1 Leaked SkFlattenable: 3 Leaked SkTypeface: 1 Leaked SkWeakRefCnt: 1 Leaked SkFontMgr: 1 Leaked SkRefCntBase: 7 This is motivated by wanting to land https://codereview.chromium.org/806473006/, which makes sure all static use of SkOnce are in global scope. The current implementation of SkInstCnt uses them in function scope, which isn't safe. BUG=skia: No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/841263004
* 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
* 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 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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