aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPathPriv.h
Commit message (Collapse)AuthorAge
* Make the SkPathRef GenIDChangeListener ref countedGravatar Chris Dalton2018-06-08
| | | | | | | | Bug: skia: Change-Id: I2780e3fc76153373b4efca6059ded82f4f749325 Reviewed-on: https://skia-review.googlesource.com/133502 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Revert "Revert "reject large paths to avoid potential float overflows""Gravatar Mike Reed2018-05-11
| | | | | | | | | | | | | This reverts commit b8f0709aac43cfdefdbf3a307f8c2ecfc0c55d27. Attempted fix: update the iData before we return. Bug: oss-fuzz:8131 Change-Id: If60b8b45df4dcb1deecc18f58cb09644aaa3231d Reviewed-on: https://skia-review.googlesource.com/127501 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "reject large paths to avoid potential float overflows"Gravatar Mike Reed2018-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b35002d323134e2a441ce2f912a305cd9b3bd321. Reason for revert: crashing in threadedraster, may need to clean up the initonce payload if I early exit Original change's description: > reject large paths to avoid potential float overflows > > I think this change can catch a host of potential fuzzer issues up-front, > rather than adding finite tests in lots and lots of places down-stream. > > Bug: oss-fuzz:8131 > Change-Id: I421aa72c6ca3df57b40dd32b805d6c847d8e8d29 > Reviewed-on: https://skia-review.googlesource.com/127388 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=mtklein@google.com,jvanverth@google.com,bsalomon@google.com,caryclark@google.com,csmartdalton@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com Change-Id: I12ff8664113ba5a36ee91cbe2000d7d445d4bc7e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: oss-fuzz:8131 Reviewed-on: https://skia-review.googlesource.com/127580 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* reject large paths to avoid potential float overflowsGravatar Mike Reed2018-05-11
| | | | | | | | | | | I think this change can catch a host of potential fuzzer issues up-front, rather than adding finite tests in lots and lots of places down-stream. Bug: oss-fuzz:8131 Change-Id: I421aa72c6ca3df57b40dd32b805d6c847d8e8d29 Reviewed-on: https://skia-review.googlesource.com/127388 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Reland "Revert "Add arcs as a specialized geometry to GrShape."""Gravatar Brian Salomon2018-04-26
| | | | | | | | | | This reverts commit 580aee2fa4a57bf8208498fbc23acea04e16e092. Bug: skia:7794 Change-Id: I9c2b923859c826dff58c22c529dc4e2ab4d0f186 Reviewed-on: https://skia-review.googlesource.com/124042 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Reland "Revert "Add arcs as a specialized geometry to GrShape.""Gravatar Brian Salomon2018-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8a98bc96748d1bdaf9c2d8cfa0b672e3a035973d. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Revert "Add arcs as a specialized geometry to GrShape."" > > This reverts commit af88ec37124846a0168a4ab061bf10cc6030c2d6. > > Bug: skia:7794 > Change-Id: I2d0e1d7b4e025481241d823b09f5de5d0f1a13eb > Reviewed-on: https://skia-review.googlesource.com/123627 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: Ib09a533600028b76a69b455c952f3dd12b39bdba No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7794 Reviewed-on: https://skia-review.googlesource.com/123780 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Add arcs as a specialized geometry to GrShape.""Gravatar Brian Salomon2018-04-25
| | | | | | | | | | This reverts commit af88ec37124846a0168a4ab061bf10cc6030c2d6. Bug: skia:7794 Change-Id: I2d0e1d7b4e025481241d823b09f5de5d0f1a13eb Reviewed-on: https://skia-review.googlesource.com/123627 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Add arcs as a specialized geometry to GrShape."Gravatar Mike Klein2018-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 255bcf57ffd9db368cd66ca9697549efd799153e. Reason for revert: layout and scuba image diffs Original change's description: > Add arcs as a specialized geometry to GrShape. > > BUG: skia:7794 > > Change-Id: I484693711f48e55631732a0f4ee97e2848dec89d > Reviewed-on: https://skia-review.googlesource.com/122900 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: I9293b8fbb535d940bca5fc30a95908416b9eb7a7 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/123362 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Add arcs as a specialized geometry to GrShape.Gravatar Brian Salomon2018-04-23
| | | | | | | | | BUG: skia:7794 Change-Id: I484693711f48e55631732a0f4ee97e2848dec89d Reviewed-on: https://skia-review.googlesource.com/122900 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* check for non-finite values output by clipperGravatar Mike Reed2018-04-12
| | | | | | | | | | Bug: oss-fuzz:7452 Change-Id: Id1b9bd1ad9245f32d69b7ce97544955fcde5670f Reviewed-on: https://skia-review.googlesource.com/121102 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Reland "Add private fIsBadForDAA bit to SkPath"Gravatar Yuqian Li2018-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ed5e069dbb0b2ef49e22b9d17af3875e3682cd61. Reason for revert: add the guard flag Original change's description: > Revert "Add private fIsBadForDAA bit to SkPath" > > This reverts commit 54aefc74103a5c1810a7cc074746915c78ab3132. > > Reason for revert: Forget the guard flag. Pixel tests would fail. > > Original change's description: > > Add private fIsBadForDAA bit to SkPath > > > > Bug: chromium:821353 > > Change-Id: Ic6585e76df692bb1853d0990d75f0e8d1dee22f4 > > Reviewed-on: https://skia-review.googlesource.com/120201 > > Commit-Queue: Yuqian Li <liyuqian@google.com> > > Reviewed-by: Mike Reed <reed@google.com> > > TBR=caryclark@google.com,liyuqian@google.com,reed@google.com > > Change-Id: I2fe7cfcc3a80a51415f72d656da95a894a3240a4 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: chromium:821353 > Reviewed-on: https://skia-review.googlesource.com/120505 > Reviewed-by: Yuqian Li <liyuqian@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=caryclark@google.com,liyuqian@google.com,reed@google.com Change-Id: Iebf7caf9ca74f305dec25b1b6512e93cb41cc8ec No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:821353 Reviewed-on: https://skia-review.googlesource.com/120620 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com>
* Revert "Add private fIsBadForDAA bit to SkPath"Gravatar Yuqian Li2018-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 54aefc74103a5c1810a7cc074746915c78ab3132. Reason for revert: Forget the guard flag. Pixel tests would fail. Original change's description: > Add private fIsBadForDAA bit to SkPath > > Bug: chromium:821353 > Change-Id: Ic6585e76df692bb1853d0990d75f0e8d1dee22f4 > Reviewed-on: https://skia-review.googlesource.com/120201 > Commit-Queue: Yuqian Li <liyuqian@google.com> > Reviewed-by: Mike Reed <reed@google.com> TBR=caryclark@google.com,liyuqian@google.com,reed@google.com Change-Id: I2fe7cfcc3a80a51415f72d656da95a894a3240a4 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:821353 Reviewed-on: https://skia-review.googlesource.com/120505 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Add private fIsBadForDAA bit to SkPathGravatar Yuqian Li2018-04-11
| | | | | | | | Bug: chromium:821353 Change-Id: Ic6585e76df692bb1853d0990d75f0e8d1dee22f4 Reviewed-on: https://skia-review.googlesource.com/120201 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Mike Reed <reed@google.com>
* hide complex versions of isOval and isRRectGravatar Mike Reed2018-02-20
| | | | | | | | Bug: skia: Change-Id: I9fa899d409470f424fdfbef5b0c3bb528bcce40e Reviewed-on: https://skia-review.googlesource.com/108660 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Setup CCPR testing with GrMockContextGravatar Chris Dalton2017-11-06
| | | | | | | | | | | Beefs up the mock context to be able to support CCPR, sets up a framework for testing CCPR with the mock context, and adds a new test. Bug: skia: Change-Id: If95f92726f7b1a7f52ad04ca8126551f58ea8032 Reviewed-on: https://skia-review.googlesource.com/67980 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* make kPathRefGenIDBitCnt privateGravatar Cary Clark2017-09-14
| | | | | | | | | | | | | | | kPathRefGenIDBitCnt is used only by SkPath.cpp and SkPathRef.cpp. Curiously, there's no existing private declarations shared by SkPath and SkPathRef, so I added kPathRefGenIDBitCnt to SkPathPriv.h as the go-between. If there's an existing convention I overlooked, please let me know. R=reed@google.com,djsollen@google.com Bug: skia: 6898 Change-Id: I929d780c3b4a10e5cf78e7176a7516abf912508e Reviewed-on: https://skia-review.googlesource.com/46560 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
* Add a verbs iterator to SkPathPrivGravatar Chris Dalton2017-06-17
| | | | | | | | Bug: skia: Change-Id: If846eeac2722b67a80266f01ede7ef03ef027ac8 Reviewed-on: https://skia-review.googlesource.com/20027 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* expose new tight-bounds method on SkPathGravatar Mike Reed2017-02-03
| | | | | | | | | BUG=skia: Change-Id: Ie50df49c1758af203042a84dc2cd505046373d2c Reviewed-on: https://skia-review.googlesource.com/7996 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* experimental tight-boundsGravatar Mike Reed2017-02-03
| | | | | | | | | | | | | not sure about api -- perhaps it could just return the bounds, and make them 0,0,0,0 if the path is empty -- the caller can trivially know if the path is empty themselves. BUG=skia: Change-Id: I2dbb861e8d981b27c5a6833643977f5bd6802217 Reviewed-on: https://skia-review.googlesource.com/7989 Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Make GrShape compute keys for short paths from path data instead of using ↵Gravatar bsalomon2016-09-21
| | | | | | | | the gen id. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2357643002 Review-Url: https://codereview.chromium.org/2357643002
* Respecify SkCanvas::drawArc, consolidate conversion to SkPath, add GM for ↵Gravatar bsalomon2016-08-25
| | | | | | | | | | oddball drawArcs Allows the arc to wind more than 360 degrees when useCenter is true, specs that nothing draws if the oval is empty or the sweep angle is 0. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2281653002 Review-Url: https://codereview.chromium.org/2281653002
* Add SkPathPriv::IsSimpleClosedRectGravatar bsalomon2016-06-01
| | | | | | | | This function looks for "simple" rect paths. Simple here means begins and ends at a corner and is closed (either manually or with a close verb). Unlike SkPath::isRect this returns the starting point index (using the same start indexing scheme as SkPath::addRect). GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2017313002 Review-Url: https://codereview.chromium.org/2017313002
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* Fix for GrAALinearizingConvexPathRenderer incorrectly drawing non-convex pathsGravatar ethannicholas2015-12-15
| | | | | | BUG=552080 Review URL: https://codereview.chromium.org/1522973002
* Implement caching of filled paths in the tessellated path renderer.Gravatar senorblanco2015-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | Paths are cached as tessellated triangle meshes in vertex buffers on the GPU. Stroked paths are not (yet) cached. Paths containing no curved segments (linear paths) are reused at all scales. Paths containing curved segments are reused within a scale tolerance threshold. In order to invalidate the cache when an SkPath is changed or deleted, this required implementing genID change notification in SkPath. This is modelled almost exactly on SkPixelRef::GenIDChangeListener. However, It does not currently implement the check for unique genIDs, so notifiers will fire when the first instance of an SkPathRef using a given genID is destroyed. Another caveat is that you cannot successfully add a change notifier to an empty path, since it uses the "canonical" empty path which is never modified or destroyed. For this reason, we prevent adding listeners to it. BUG=skia:4121,skia:4122, 497403 DOCS_PREVIEW= https://skia.org/?cl=1114353004 Committed: https://skia.googlesource.com/skia/+/468dfa72eb6694145487be17876804dfca3b7adb Review URL: https://codereview.chromium.org/1114353004
* Revert "Implement caching of filled paths in the tessellated path renderer."Gravatar mtklein2015-08-04
| | | | | | | | | | | | | | | | | | This reverts commit 468dfa72eb6694145487be17876804dfca3b7adb. This CL caused signficant GM diffs. Revert "Fix resource cache test." This reverts commit b001c41ed37d2018d38ce787b412ed741585d75d. Revert "Fix SkData leaks at GrResourceKey::setCustomData() call sites." This reverts commit c369348aa596d7be05c9ce0ca5d349e5d1903789. These CLs depend on the first one. BUG=skia: TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/1260363007
* Implement caching of filled paths in the tessellated path renderer.Gravatar senorblanco2015-08-03
| | | | | | | | | | | | | | | | | | | | | | | Paths are cached as tessellated triangle meshes in vertex buffers on the GPU. Stroked paths are not (yet) cached. Paths containing no curved segments (linear paths) are reused at all scales. Paths containing curved segments are reused within a scale tolerance threshold. In order to invalidate the cache when an SkPath is changed or deleted, this required implementing genID change notification in SkPath. This is modelled almost exactly on SkPixelRef::GenIDChangeListener. However, It does not currently implement the check for unique genIDs, so notifiers will fire when the first instance of an SkPathRef using a given genID is destroyed. Another caveat is that you cannot successfully add a change notifier to an empty path, since it uses the "canonical" empty path which is never modified or destroyed. For this reason, we prevent adding listeners to it. BUG=skia:4121,skia:4122, 497403 DOCS_PREVIEW= https://skia.org/?cl=1114353004 Review URL: https://codereview.chromium.org/1114353004
* Revert "Move headers with no dependencies."Gravatar Mike Klein2015-07-29
| | | | | | | | | | | This reverts commit 117842223bd13325b6da26110d80e0590c1a742b. No good: https://uberchromegw.corp.google.com/i/client.skia/builders/Mac%20Builder/builds/3465/steps/compile/logs/stdio BUG=skia:4126 Review URL: https://codereview.chromium.org/1262173002 .
* Move headers with no dependencies.Gravatar mtklein2015-07-29
| | | | | | | | | | | | | | | C.f. https://codereview.chromium.org/1261013003/ BUG=skia:4126 Will follow up with two more CLs if this works: - one moving SkRecords.h - one moving SkMiniRecorder.h No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/1266593002
* Revert "Move the rest of src headers used by include to include/private."Gravatar Mike Klein2015-07-28
| | | | | | | | | | | | This reverts commit d12e6ffa5cc1c1af47bf73c7c127d8d7f7443058. Our Chrome roll canaries are failing with the dreaded Ninja-says-there's-more-work-to-do message. I will break this up smaller (if possible) and try again tomorrow. BUG=skia:4126 Review URL: https://codereview.chromium.org/1258293004 .
* Move the rest of src headers used by include to include/private.Gravatar mtklein2015-07-28
| | | | | | | | | | | | | $ git grep "../../src/" | grep include now returns nothing. BUG=skia:4126 No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/1261013003
* Revert "Move headers used by headers in include/ to include/private."Gravatar Mike Klein2015-07-01
| | | | | | | | This reverts commit 928e16565f3e69cd6661e9ad300ac17e3f33c0c8. BUG=skia: Review URL: https://codereview.chromium.org/1213093004.
* Move headers used by headers in include/ to include/private.Gravatar mtklein2015-07-01
| | | | | | | | | | | Some of this is transitive, like SkRecords.h used by SkMiniRecorder.h used by (public) SkPictureRecorder.h. BUG=skia: Committed: https://skia.googlesource.com/skia/+/a89f55198bdc58f0b6f6196907ab25a6afc1a661 Review URL: https://codereview.chromium.org/1217293004
* Revert "Move headers used by headers in include/ to include/private."Gravatar jvanverth2015-07-01
| | | | | | | | | | | | | This reverts commit a89f55198bdc58f0b6f6196907ab25a6afc1a661. Reason: breaking the roll. TBR=mtklein@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1216033008
* Move headers used by headers in include/ to include/private.Gravatar mtklein2015-07-01
| | | | | | | | | Some of this is transitive, like SkRecords.h used by SkMiniRecorder.h used by (public) SkPictureRecorder.h. BUG=skia: Review URL: https://codereview.chromium.org/1217293004
* Revert of Revert of added stroking support to ↵Gravatar fmalita2015-06-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GrAALinearizingConvexPathRenderer (patchset #1 id:1 of https://codereview.chromium.org/1212833002/) Reason for revert: Manual roll is in: https://codereview.chromium.org/1212373002 Let's re-land this. Original issue's description: > Revert of added stroking support to GrAALinearizingConvexPathRenderer (patchset #6 id:100001 of https://codereview.chromium.org/1180903006/) > > Reason for revert: > speculative revert to try to fix DEPS roll (layouttests) > > Original issue's description: > > added stroking support to GrAALinearizingConvexPathRenderer > > > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/2436f191e6602953b32a51cf50f2d7a4e2af90fd > > TBR=bsalomon@google.com,robertphillips@google.com,ethannicholas@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/9730f4a663534009d216c2f6d834bd534dd44a3d TBR=bsalomon@google.com,robertphillips@google.com,ethannicholas@google.com,reed@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1209003004
* Revert of added stroking support to GrAALinearizingConvexPathRenderer ↵Gravatar reed2015-06-26
| | | | | | | | | | | | | | | | | | | | | | (patchset #6 id:100001 of https://codereview.chromium.org/1180903006/) Reason for revert: speculative revert to try to fix DEPS roll (layouttests) Original issue's description: > added stroking support to GrAALinearizingConvexPathRenderer > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/2436f191e6602953b32a51cf50f2d7a4e2af90fd TBR=bsalomon@google.com,robertphillips@google.com,ethannicholas@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1212833002
* added stroking support to GrAALinearizingConvexPathRendererGravatar ethannicholas2015-06-25
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1180903006
* 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