aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathTest.cpp
Commit message (Collapse)AuthorAge
* Stop using SkTSwap.Gravatar Ben Wagner2018-06-19
| | | | | | | | | | | | | Use std::swap instead. It does not appear that any external user specializes SkTSwap, but some may still use it. This removes all use in Skia so that SkTSwap can later be removed in a smaller CL. After that the <utility> include can be removed from SkTypes.h. Change-Id: If03d4ee07dbecda961aa9f0dc34d171ef5168753 Reviewed-on: https://skia-review.googlesource.com/135578 Reviewed-by: Hal Canary <halcanary@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Revert "Revert "SkTypes: extract SkTo""Gravatar Hal Canary2018-06-14
| | | | | | | | | | | | | | | | This reverts commit fdcfb8b7c23fbf18f872d2c31d27978235033876. > Original change's description: > > SkTypes: extract SkTo > > > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > > Reviewed-on: https://skia-review.googlesource.com/133620 > > Reviewed-by: Mike Klein <mtklein@google.com> Change-Id: Ida74fbc5c21248a724a5edbf9fae18a33bcb23aa Reviewed-on: https://skia-review.googlesource.com/134506 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkTypes: extract SkTo"Gravatar Hal Canary2018-06-13
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2a2f67592602b18527bc3fd449132d420cd5b62e. Reason for revert: this appears to be what is holding up the Chrome roll. Original change's description: > SkTypes: extract SkTo > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > Reviewed-on: https://skia-review.googlesource.com/133620 > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,halcanary@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae Reviewed-on: https://skia-review.googlesource.com/134504 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkTypes: extract SkToGravatar Hal Canary2018-06-12
| | | | | | Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 Reviewed-on: https://skia-review.googlesource.com/133620 Reviewed-by: Mike Klein <mtklein@google.com>
* 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>
* need conservative bounds for triangles due to SkFixed drift in SkEdgeGravatar Mike Reed2018-06-04
| | | | | | | | | Bug: oss-fuzz:8018 Change-Id: I09456f906b7eb89f74ffd2c484bc6e30e029bfbb Reviewed-on: https://skia-review.googlesource.com/131021 Reviewed-by: Cary Clark <caryclark@google.com> Auto-Submit: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* fix 0.499999f rounding case for trianglesGravatar Mike Reed2018-05-23
| | | | | | | | Bug: skia:7994 Change-Id: I83bb309a2c8fb0bddaf78ba32c0a07537e483900 Reviewed-on: https://skia-review.googlesource.com/129648 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Revert "remove fragile hack in addOval to avoid computing bounds"Gravatar Mike Klein2018-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bc721ba4be626e3ba753f55341a7019d98044102. Reason for revert: I think we'll want to reland with guards for layout tests. https://test-results.appspot.com/data/layout_results/linux_trusty_blink_rel/29630/layout-test-results/results.html Original change's description: > remove fragile hack in addOval to avoid computing bounds > > Bug: skia: > Change-Id: Ide917f54633370f1fce46a115fa923794b981e2e > Reviewed-on: https://skia-review.googlesource.com/129461 > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=mtklein@google.com,reed@google.com Change-Id: Ibadac8bbeca2b162d696e7cca51d580121afe71f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/129442 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* remove fragile hack in addOval to avoid computing boundsGravatar Mike Reed2018-05-21
| | | | | | | | Bug: skia: Change-Id: Ide917f54633370f1fce46a115fa923794b981e2e Reviewed-on: https://skia-review.googlesource.com/129461 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Remove legacy guard flagsGravatar Yuqian Li2018-05-03
| | | | | | | | | Bug: skia: Change-Id: I3b526f2caec6766faea72cdc89550f50e17c71d2 Reviewed-on: https://skia-review.googlesource.com/125746 Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
* path is rect track cornersGravatar Cary Clark2018-04-19
| | | | | | | | | | | | | | | | | | | | This was triggered by an exploit that started the first edge well outside the final rectangle, causing the captured to exceed the correct result. Ivan observes that we really only want the first and third corners to compute the bounds, so remove the tracking code that looks for a valid range of points, and record the corners instead. R=robertphillips@google.com Bug: 824145,skia:7792 Change-Id: If228573d0f05c7158dba8142c144d13834e691ec Reviewed-on: https://skia-review.googlesource.com/122081 Commit-Queue: Cary Clark <caryclark@skia.org> Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Auto-Submit: Cary Clark <caryclark@skia.org>
* fix path is rect flaw exposed by goldGravatar Cary Clark2018-04-18
| | | | | | | | | | | | | | | | | | | One of the path is rect bug fixes changed the behavior of zero-length strokes which showed up as a change in Gold. The bug is if a rect is defined by a series of colinear movetos, the bounds did not work out if the rect started and stopped in the middle of a side. R=robertphillips@google.com Bug: 824145,skia:7792 Change-Id: I226545efeda03dedd928eebc120d2508b428fef0 Reviewed-on: https://skia-review.googlesource.com/122002 Auto-Submit: Cary Clark <caryclark@skia.org> Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
* path is rect diag test is requiredGravatar Cary Clark2018-04-17
| | | | | | | | | | | | | | | Removed a test that appeared to go uncalled; Ivan to the rescue, with a test case proving that it is required. R=robertphillips@google.com Bug: 824145,skia:7792 Change-Id: I7df9688072bd36b7597673148e3fe5dbbf82f5a7 Reviewed-on: https://skia-review.googlesource.com/121883 Commit-Queue: Cary Clark <caryclark@skia.org> Commit-Queue: Robert Phillips <robertphillips@google.com> Auto-Submit: Cary Clark <caryclark@skia.org> Reviewed-by: Robert Phillips <robertphillips@google.com>
* path is rect bug number twelveGravatar Cary Clark2018-04-17
| | | | | | | | | | | | | | | | | | Exposes that final close along a diagonal need not include a close verb if the subsequent verb is move; so we have to check for a diagonal then. The later check for diagonal included a comment that it may not be needed which does appear to be the case. R=robertphillips@google.com Bug: 824145,skia:7792 Change-Id: I17a9414e8b3e69b82c2eda28195696eae4e3d513 Reviewed-on: https://skia-review.googlesource.com/121801 Commit-Queue: Cary Clark <caryclark@skia.org> Commit-Queue: Robert Phillips <robertphillips@google.com> Auto-Submit: Cary Clark <caryclark@skia.org> Reviewed-by: Robert Phillips <robertphillips@google.com>
* yet another path is rect exploitGravatar Cary Clark2018-04-17
| | | | | | | | | | | | | | | This one accumulates the othershoot when all four sides have the same direction, and the final side when closed should cause the overshoot to be ignored. Docs-Preview: https://skia.org/?cl=121787 Bug: 824145,skia:7792 Change-Id: I71ea0fcdd0f03a4fcac224b57220c65c321112f6 Reviewed-on: https://skia-review.googlesource.com/121787 Commit-Queue: Cary Clark <caryclark@skia.org> Commit-Queue: Robert Phillips <robertphillips@google.com> Auto-Submit: Cary Clark <caryclark@skia.org> Reviewed-by: Robert Phillips <robertphillips@google.com>
* a more involved path is rect bugGravatar Cary Clark2018-04-17
| | | | | | | | | | | | | | | | | | This is bug number ten in the series, and is the most interesting. It exploits that the code tracks corners 0, 2, and 3 but not corner 1. Changing the code to track all corners is the biggest so far, and while it (hopefully) simplifies things, the presence of new code may signify more bugs to come. R=robertphillips@google.com Bug: 824145,skia::7792 Change-Id: Ia18e4d80fbed06ae6d9c89dcb4c462c5610213cc Reviewed-on: https://skia-review.googlesource.com/121487 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* path is rect bug number nineGravatar Cary Clark2018-04-13
| | | | | | | | | | | | | | | This variation exploits a sequence which uses a zero length line to note that lines have been recorded, but no rectangle edge has been encountered. R=robertphillips@google.com Docs-Preview: https://skia.org/?cl=121282 Bug: 824145,skia:7792 Change-Id: I652e9482b2867c3d7da30d5f5df2aecbfd0d716d Reviewed-on: https://skia-review.googlesource.com/121282 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
* son of path is rect bugGravatar Cary Clark2018-04-12
| | | | | | | | | | | | | | | | | | | This variation tricks SkPath::isRect by exploiting that the implementation resets the point pointer to process the close verb, and using the reset pointer to walk over a series of points that don't move. In addition to fixing this, rename variables to make the line creation more obvious, since left, right, and friends, are not the left and right. R=robertphillips@google.com Bug: 824145,skia:7792 Change-Id: If8ebbc3eedd270652670d6e111a5bc02e61f0eec Reviewed-on: https://skia-review.googlesource.com/121122 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
* another rect is path fixGravatar Cary Clark2018-04-12
| | | | | | | | | | | | | | | | | | | | | | | | This addresses comment #17 of skbug.com/7792. The bug overshoots the end and exploits that the first point tracked by close isn't the first point in the rectangle. Fixing this slightly regresses the example in comment #14; before it was treated as a filled rect but now it is not; this conservative approach doesn't cause any other regressions. bug7792 in pathfill.cpp verifies that all paths in the bug draw correctly by comparing CPU and GPU. R=robertphillips@google.com Bug: 824145,skia:7792 Change-Id: I55bea023d2ad7456c8c3ebd9d1df95fe34e0a0d4 Reviewed-on: https://skia-review.googlesource.com/120996 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Robert Phillips <robertphillips@google.com>
* more path is rect bugsGravatar Cary Clark2018-04-11
| | | | | | | | | | | | | More edge cases found; clean up the logic a bit to make more clear where the rectangle points start and stop. R=robertphillips@google.com,brianosman@google.com Bug: 824145,skia:7792 Change-Id: Ie24dfd1519f30875f44ffac68e20d777490b00b9 Reviewed-on: https://skia-review.googlesource.com/120422 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* one more path is rect bugGravatar Cary Clark2018-04-10
| | | | | | | | | | | | | | | | Add a check to see that the close path generated line is horizontal or vertical when determining that path is a rect. Also change several tests to defer their initialization to reduce debugging interference. R=brianosman@google.com,robertphillips@google.com Bug: 824145,skia:7792 Change-Id: I4a081ee4ffd3558b499a7a1aede2d6232059715e Reviewed-on: https://skia-review.googlesource.com/120081 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* fix path to rect when missing close verbGravatar Cary Clark2018-04-10
| | | | | | | | | | | R=brianosman@google.com,robertphillips@google.com TBR=reed@google.com Bug: 824145,skia:7792 Change-Id: I24f121cfa7d437c95b94bd917d3c4888a10c519e Reviewed-on: https://skia-review.googlesource.com/119569 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* change path serialization version to 4Gravatar Mike Reed2018-02-21
| | | | | | | | | | | | | | | | New format should be much simpler: - only store public data (e.g. points, verbs, filltype) - deserialize just uses public APIs Refactor reading code to manage different (older) versions, to make it clear (hopefully) what we can delete when we can abandon version 3 support. Bug: skia: Change-Id: I30465f891cba3f044ae1cb2c13c04f04fdc9da78 Reviewed-on: https://skia-review.googlesource.com/109160 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: 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>
* handle paths with degenerate verbsGravatar Mike Reed2018-01-30
| | | | | | | | Bug: skia:7507 Change-Id: I13cedcf8a13f4ce4417ae5c19f7f74d2652724d2 Reviewed-on: https://skia-review.googlesource.com/101760 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Allow printf style var args for messages in REPORTER_ASSERT.Gravatar Brian Salomon2018-01-29
| | | | | | | | | Remove REPORTER_ASSERT_MESSAGE. Change-Id: I6d00715901159c93e22d182fe24aac92b5fdbcf4 Reviewed-on: https://skia-review.googlesource.com/100361 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* check for huge pathsGravatar Mike Reed2018-01-22
| | | | | | | | | Bug:802976 Change-Id: Ibb5930442f75ca8483afc8dfa5869cac98573904 Reviewed-on: https://skia-review.googlesource.com/98440 Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Don't canonicalize empty SkRRects. They stroke differently.Gravatar Brian Salomon2017-12-19
| | | | | | | | | | | | Make insetting greater than width or height collapse to a point/line. SkPath::addRRect() doesn't ignore an empty SkRRect. Change-Id: I933a3419a6d75be534f1d8328faa715772045f67 Reviewed-on: https://skia-review.googlesource.com/85680 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* keep SVG arcs axis aligned with suppressionGravatar Cary Clark2017-12-08
| | | | | | | | | | | | | | another attempt at https://skia-review.googlesource.com/c/skia/+/79423 this time, bracket change with SK_SUPPORT_LEGACY_SVG_ARC_TO to avoid prematurely changing SVG layout test results. R=djsollen@google.com Bug: b:69622768 Change-Id: Ia929f89d4f4292dfead191a381cdb431f743726a Reviewed-on: https://skia-review.googlesource.com/82723 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
* Revert "keep SVG arcs axis aligned"Gravatar Cary Clark2017-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c3823848483eba33c3fa36187de7713e87651c1c. Reason for revert: need to add legacy flag to chrome first Original change's description: > keep SVG arcs axis aligned > > Computing the arc width introduces rounding errors that cause the > arc to exceed 1/4 circle and cause integer anchored arcs to start > outside their marks. A round rect may lose convexity as a result. > > Check if arcTo() inputs are integers and arc is 90 degrees; > if so, output conics which are axis-aligned on integers as well. > > This is triggered when using SVG to represent a round rect. > > Possible future enhancements are recorded in bug.skia.org/7383 > > R=​reed@google.com,djsollen@google.com > Change-Id: I6609456fcefabcda6c9560a044533ecb5cda2d31 > Reviewed-on: https://skia-review.googlesource.com/79423 > Reviewed-by: Derek Sollenberger <djsollen@google.com> > Commit-Queue: Derek Sollenberger <djsollen@google.com> TBR=djsollen@google.com,caryclark@google.com,reed@google.com,caryclark@skia.org Change-Id: Ia503ea62def15322df2b11da30d377a9543d6999 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/81281 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* keep SVG arcs axis alignedGravatar Cary Clark2017-12-06
| | | | | | | | | | | | | | | | | | | Computing the arc width introduces rounding errors that cause the arc to exceed 1/4 circle and cause integer anchored arcs to start outside their marks. A round rect may lose convexity as a result. Check if arcTo() inputs are integers and arc is 90 degrees; if so, output conics which are axis-aligned on integers as well. This is triggered when using SVG to represent a round rect. Possible future enhancements are recorded in bug.skia.org/7383 R=reed@google.com,djsollen@google.com Change-Id: I6609456fcefabcda6c9560a044533ecb5cda2d31 Reviewed-on: https://skia-review.googlesource.com/79423 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* Ignore deserialized path convexity and first direction.Gravatar Brian Salomon2017-11-29
| | | | | | | Change-Id: Ib7bfff6225774b83d9b6e9c5baae254aab17353b Reviewed-on: https://skia-review.googlesource.com/77680 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* skipRect should only work for lines (not quads or cubics)Gravatar Yuqian Li2017-09-18
| | | | | | | | | | | | | | The added unit test shows that we'll trigger SkASSERT failure if we forgot to check that the edges are lines (instead of quads or cubics). Similar to skia:7015, this bug is not triggered in our production because we don't use DAA for convex paths by default. The skipRect is an optimization just for convex paths. Bug: skia:7051 Change-Id: Id87ce2d452ede0db9a48425541f473af19ee0572 Reviewed-on: https://skia-review.googlesource.com/48045 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Revert "Don't ignore degenerates when deciding if a path is convex""Gravatar Brian Osman2017-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f95352322496796ce4c99df9582dbc630fe8a327. Reason for revert: Re-landing now that gold has settled. Original change's description: > Revert "Don't ignore degenerates when deciding if a path is convex" > > This reverts commit 53cd6c4331a2ef21a7c5eb6166c782cd33178a7b. > > Reason for revert: Temporary to limit gold cross-talk with other CLs. > > Original change's description: > > Don't ignore degenerates when deciding if a path is convex > > > > This ensures that a path with a second contour will always be marked > > concave. GrDefaultPathRenderer was incorrectly drawing paths of this type > > (thinking that it could fill them with simple triangulation). > > > > Bug: skia:7020 skia:1460 > > Change-Id: I62bfd72e4c61da427687acf53c552357b57707aa > > Reviewed-on: https://skia-review.googlesource.com/47082 > > Reviewed-by: Cary Clark <caryclark@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,reed@google.com > > Change-Id: Id7d121633faeb8a43dbd334409408ba51db43d68 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:7020 skia:1460 > Reviewed-on: https://skia-review.googlesource.com/47343 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Brian Osman <brianosman@google.com> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,reed@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia:7020 skia:1460 Change-Id: I45ff90a54b66ce9ea068f246d066cc24b310c966 Reviewed-on: https://skia-review.googlesource.com/47820 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Don't ignore degenerates when deciding if a path is convex"Gravatar Brian Osman2017-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 53cd6c4331a2ef21a7c5eb6166c782cd33178a7b. Reason for revert: Temporary to limit gold cross-talk with other CLs. Original change's description: > Don't ignore degenerates when deciding if a path is convex > > This ensures that a path with a second contour will always be marked > concave. GrDefaultPathRenderer was incorrectly drawing paths of this type > (thinking that it could fill them with simple triangulation). > > Bug: skia:7020 skia:1460 > Change-Id: I62bfd72e4c61da427687acf53c552357b57707aa > Reviewed-on: https://skia-review.googlesource.com/47082 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Brian Osman <brianosman@google.com> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,reed@google.com Change-Id: Id7d121633faeb8a43dbd334409408ba51db43d68 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7020 skia:1460 Reviewed-on: https://skia-review.googlesource.com/47343 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Don't ignore degenerates when deciding if a path is convexGravatar Brian Osman2017-09-15
| | | | | | | | | | | | This ensures that a path with a second contour will always be marked concave. GrDefaultPathRenderer was incorrectly drawing paths of this type (thinking that it could fill them with simple triangulation). Bug: skia:7020 skia:1460 Change-Id: I62bfd72e4c61da427687acf53c552357b57707aa Reviewed-on: https://skia-review.googlesource.com/47082 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Add a utility function to save path test code sizeGravatar Yuqian Li2017-09-15
| | | | | | | | Bug: skia: Change-Id: Ie3ec5a57bacaabac544a2b01ab33fd665203031b Reviewed-on: https://skia-review.googlesource.com/46841 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Don't allow iteration through non-finite points.Gravatar Mike Klein2017-09-08
| | | | | | | | | | | Added a unit test too. BUG=chromium:756563 Change-Id: Ic77a89b4a98d1a553877af9807a3d3bdcd077bb9 Reviewed-on: https://skia-review.googlesource.com/44420 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Fix SkASSERT for convex paths with DAAGravatar Yuqian Li2017-09-07
| | | | | | | | | | | | | | As DAA does not chop edges at Y extrema, it's valid for convex edges to have only one edge (e.g., a single cubic edge with the valley shape \_/). This wasn't an issue for production because DAA is never called for convex paths by default. Bug=skia:7015 Change-Id: Iac79801d6a24188970ef6f7bf723494a25d92a1e Reviewed-on: https://skia-review.googlesource.com/42942 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Convert Windows CRLF newlines back to unix onesGravatar Yuqian Li2017-09-06
| | | | | | | | | | | | | | | | The newlines got accidentally converted to CRLF in https://skia-review.googlesource.com/c/skia/+/39521 This CL simply runs dos2unix to convert them back. There are probably more files affected by 39521, but these 3 files are the major ones that got thousands of newlines converted. Bug: skia: Change-Id: I0aab5c9e2ab3d491bfe746d6b2db19532a89d654 Reviewed-on: https://skia-review.googlesource.com/42921 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Convert NULL and 0 to nullptr.Gravatar Ben Wagner2017-08-28
| | | | | | | | | | | | | | This was created by looking at warnings produced by clang's -Wzero-as-null-pointer-constant. This updates most issues in Skia code. However, there are places where GL and Vulkan want pointer values which are explicitly 0, external headers which use NULL directly, and possibly more uses in un-compiled sources (for other platforms). Change-Id: Id22fbac04d5c53497a53d734f0896b4f06fe8345 Reviewed-on: https://skia-review.googlesource.com/39521 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* tiny concave path point fixGravatar Cary Clark2017-08-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tiny path added to PathTest.cpp has tinier cross products (e.g. 1e-12) so appears to be a series of unbending lines as far as getConvexity is concerned. This point fix looks for paths that do not bend left or right or go backwards, but do have a bounds, and calls them concave. A better fix may be to consider empty and degenerate paths to be concave instead of convex; I don't know if anyone relies on the existing behavior. Another better fix may be to change the math to compute the path turns even though the numbers are very small; on the surface, very difficult. R=bsalomon@google.com,reed@google.com Bug:755839 Change-Id: Ie2280f3f0b95fecab2899f5fc579fd39258e0647 Reviewed-on: https://skia-review.googlesource.com/38720 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* Guard AA change to wait for rebaselinesGravatar Yuqian Li2017-08-11
| | | | | | | | | | | | | | We use SK_SUPPORT_LEGACY_DELTA_AA to guard the golden image change. Such flag is defined for Android, Chrome, and Google3 so our auto-rollers should all be OK. TBR: bungeman@google.com Bug: skia:6947 Change-Id: Ic2705e82f4f7f15ec08499254dce75b93d41727e Reviewed-on: https://skia-review.googlesource.com/33762 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Don't store clipped x which could break edge orderGravatar Yuqian Li2017-08-11
| | | | | | | | | | | | | | We only need to clip a temporary x to ensure that we don't blit beyond clip. Storing such clipped x is problematic because it may make our edges unsorted. The added unit test would fail without this fix. Bug: skia:6947 Change-Id: I6c21d7c7c097e50fef18ab151921d6c07c089318 Reviewed-on: https://skia-review.googlesource.com/33420 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Don't compare against uninit edge in SkPath::conservativelyContainsRectGravatar Brian Salomon2017-08-08
| | | | | | | | | Bug: chromium:752478 Change-Id: Ic281f06b300329ea9823b3eb76cc56b7a43fd2a5 Reviewed-on: https://skia-review.googlesource.com/31520 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Fix SkPathRef deserialization malloc crash""Gravatar Mike Reed2017-07-27
| | | | | | | | | | | | | | | | This reverts commit a4ce4b1f6bef22e7ca5c7a952197fc2bc70923fc. Fix SkPathRef deserialization malloc crash If the path says it has more points/verbs/etc than the buffer could be holding, then resetToSize could try to allocate something huge and crash. Bug: skia: Change-Id: I23b8870e9f74386aca89fb8f9a60d3b452044094 Reviewed-on: https://skia-review.googlesource.com/26805 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Revert "Fix SkPathRef deserialization malloc crash"Gravatar Mike Reed2017-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit df6660f64e4d915de7471c3daa67f9b68037ff3f. Reason for revert: crashing dm on android and windows Original change's description: > Fix SkPathRef deserialization malloc crash > > If the path says it has more points/verbs/etc than the buffer could > be holding, then resetToSize could try to allocate something huge > and crash. > > Change-Id: I40e8db87e4f61abb23217281ab0365c6af222fa3 > Reviewed-on: https://skia-review.googlesource.com/24802 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=bungeman@google.com,reed@google.com,enne@chromium.org Change-Id: I06fa89c05b785652b097ae04e7ebc001a7c176b2 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/26944 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Fix SkPathRef deserialization malloc crashGravatar Adrienne Walker2017-07-26
| | | | | | | | | | | If the path says it has more points/verbs/etc than the buffer could be holding, then resetToSize could try to allocate something huge and crash. Change-Id: I40e8db87e4f61abb23217281ab0365c6af222fa3 Reviewed-on: https://skia-review.googlesource.com/24802 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* fix drawDRRect for fuzzerGravatar Cary Clark2017-04-12
| | | | | | | | | | make assert abort instead Bug: skia:6450 Change-Id: I23ff51124fa8f069f2c7e5260f800017d7475d46 Reviewed-on: https://skia-review.googlesource.com/13197 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
* SkSize can be aggregate-initializedGravatar Hal Canary2017-04-11
| | | | | | | | | | | | Previosly, SkSize had a base class, which prevented it. Also removes unused SkISize::clampNegToZero() and SkSize::clampNegToZero(). Change-Id: I7b93b42f6f6381c66e294bbedee99ad53c6c3436 Reviewed-on: https://skia-review.googlesource.com/13187 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>