aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathTest.cpp
Commit message (Collapse)AuthorAge
* 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>
* Mark overridden destructors with 'override' and remove 'virtual'Gravatar Brian Salomon2017-03-22
| | | | | | | | | This silences a new warning in clang 5.0 Change-Id: Ieb5b75a6ffed60107c3fd16075d2ecfd515b55e8 Reviewed-on: https://skia-review.googlesource.com/10006 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* hide trivial helpers on canvasGravatar Mike Reed2017-02-22
| | | | | | | | | BUG=skia: Change-Id: I42d4ca92897bde5bd8e0575a0104b12b83134cef Reviewed-on: https://skia-review.googlesource.com/8852 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Reed <reed@google.com>
* stop using SkScalarMulGravatar Mike Reed2017-02-14
| | | | | | | | | BUG=skia: Change-Id: Ie41d8665a1c62ba8eddc93d8cfefaf64ddc52ff8 Reviewed-on: https://skia-review.googlesource.com/8411 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Reed <reed@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>
* give up on big cubics (for now) and just draw a lineGravatar Mike Reed2017-01-27
| | | | | | | | | BUG=683631, skia:6152 Change-Id: I69aa741af74a37e1d7bed25ad0401535599f6af0 Reviewed-on: https://skia-review.googlesource.com/7659 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Reed <reed@google.com>
* add test for big cubic -- currently disabledGravatar Mike Reed2017-01-26
| | | | | | | | | BUG=skia: Change-Id: Ief11a1e54d427b1241b47f3cfab5b44fb656443a Reviewed-on: https://skia-review.googlesource.com/7607 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* conservativelyContainsRect is assertingGravatar Mike Reed2017-01-24
| | | | | | | | | BUG=skia:6156 Change-Id: Iea571f001e9a4c4e70313c1bd49fb4e3c598869a Reviewed-on: https://skia-review.googlesource.com/7423 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* make SkPath::conservativelyContainsRect consume degenerate segmentsGravatar Lee Salzman2017-01-23
| | | | | | | | | BUG=skia: Change-Id: I3a39318bceaf6c95a50d84961d93af4ba62550e3 Reviewed-on: https://skia-review.googlesource.com/6900 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* SkTypes.h : move SkAutoMalloc into SkAutoMalloc.hGravatar Hal Canary2017-01-11
| | | | | | | | | | | | | | | | * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" Revert "Revert 'SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h'" This reverts commit c456b73fef9589bbdc5eb83eaa83e53c357bb3da. Change-Id: Ie2c1a17c20134b8ceab85a68b3ae3e61c24fbaab Reviewed-on: https://skia-review.googlesource.com/6886 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h"Gravatar Kevin Lubick2017-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a5494f117086d712855e4b6289c58c92d1549bcf. Reason for revert: Broke Google3 Original change's description: > SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h > > * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). > > * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h > > * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" > > Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88 > Reviewed-on: https://skia-review.googlesource.com/4543 > Reviewed-by: Ben Wagner <bungeman@google.com> > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Hal Canary <halcanary@google.com> > TBR=halcanary@google.com,bungeman@google.com,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ie8bd176121c3ee83c110d66c0d0ac65e09bfc9c5 Reviewed-on: https://skia-review.googlesource.com/6884 Commit-Queue: Kevin Lubick <kjlubick@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* SkTypes.h : move SkAutoMalloc into SkAutoMalloc.hGravatar Hal Canary2017-01-11
| | | | | | | | | | | | | | * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88 Reviewed-on: https://skia-review.googlesource.com/4543 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* validate deserialized path verbsGravatar Mike Reed2017-01-03
| | | | | | | | | BUG=676755 Change-Id: Ie9bd70d3a130c53737756587f73c9dce4a6bcb6d Reviewed-on: https://skia-review.googlesource.com/6529 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* dump path fill type with dataGravatar Cary Clark2016-12-16
| | | | | | | | | | | | | | | | | SkPath::dump() and SkPath::dumpHex() dump the fill type in addition to the data so that the original path can be faithfully reconstructed. This may be a small part of why some error cases aren't reproduced. R=reed@google.com BUG=skia:6041 Change-Id: Ice86bf08ea907a6b87ceef182a9316a3c979af0b Reviewed-on: https://skia-review.googlesource.com/6185 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* Add the missing shift to the dyGravatar Yuqian Li2016-11-29
| | | | | | | | | | | | | | This is identical to https://skia-review.googlesource.com/c/5266/ except for the SK_ANALYTIC_AA_GUARD flag. BUG=chromium:668907 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5302 Change-Id: I3fc225a925d21fe615c46a4a0be7fe33c5790766 Reviewed-on: https://skia-review.googlesource.com/5302 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* Use AdditiveBlitter for partial rowsGravatar Yuqian Li2016-11-29
| | | | | | | | | | | | Previously, we forgot to use AdditiveBlitter in two places where partial rows are blitterred. That causes SkAAClip to complain as in skia:6003. BUG=skia:6003 Change-Id: I4f4a896072448bdb3f287a2eb61cb64b1256ea78 Reviewed-on: https://skia-review.googlesource.com/5273 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Compute slope using fSnappedYGravatar Yuqian Li2016-11-29
| | | | | | | | | | | | | | If we use the oldy and dy directly as we did previously, the slope could be very different from (newSnappedX - fSnappedX) / (newSnappedY - fSnappedY) in the updateLine when the edge made a lot of updates with small dy but large dx. That will cause bug skia:5995 BUG=skia:5995 Change-Id: If521976ed87195dfea5961afd58bedb98447c568 Reviewed-on: https://skia-review.googlesource.com/5269 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Add the missing shift to the dy"Gravatar Yuqian Li2016-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit dd13c020793b0a7fb2ac1f22024e9fb91ea483ef. Reason for revert: this breaks the Chromium DEPS roll as we break the layout_tests. I'll add a flag to guard the change in the future and enable the flag while change the layout_tests. Original change's description: > Add the missing shift to the dy > > BUG=chromium:668907 > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5266 > > Change-Id: I6d3e56ffc149fbeac6f7a2df740542abbf84dac8 > Reviewed-on: https://skia-review.googlesource.com/5266 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> > TBR=mtklein@chromium.org,caryclark@google.com,liyuqian@google.com,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ifd5aa50f155c3ebe2f1495cbf3b8dd706211a639 Reviewed-on: https://skia-review.googlesource.com/5286 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com>
* Add the missing shift to the dyGravatar Yuqian Li2016-11-28
| | | | | | | | | | | BUG=chromium:668907 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5266 Change-Id: I6d3e56ffc149fbeac6f7a2df740542abbf84dac8 Reviewed-on: https://skia-review.googlesource.com/5266 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Fix mask overflow caused by edge driftGravatar Yuqian Li2016-11-16
| | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4797 Change-Id: Ica1568b67c1e1ce4aae2bdaba2c5b1f2155d1382 Reviewed-on: https://skia-review.googlesource.com/4797 Reviewed-by: Cary Clark <caryclark@google.com>
* Tighten SkAAClip Bounds by Path BoundsGravatar liyuqian2016-11-11
| | | | | | | | | | | | | This bug chromium:662780 exists after our original fix (https://codereview.chromium.org/2477393002/) because this path (added in unit test) is calling blitAntiRect rather than blitAntiH when the path is drifted across the boundary. (The quadratic edge drifts across the boundary after an update and sets a dX=0 line segment which triggers blitAntiRect.) Note that I didn't assert for the dLeft = dRite = 0 case because the left/right there won't drift after the SkTMin/SkTMax in line 964/966. Theoretically we can revert the relaxation in https://codereview.chromium.org/2477393002/ (that's only a relaxation for analytic AA, not supersampled AA). However, consider that the initial landing of analytic AA is so painful, I decide to revert that relaxation only after our successful landing... BUG=chromium:662780, chromium:662862 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2482193004 Review-Url: https://codereview.chromium.org/2482193004
* Catch width overflowGravatar Yuqian Li2016-11-11
| | | | | | | | | | | BUG=chromium:662730 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4628 Change-Id: Iaf3a30d39fda3166a6f8fc62a30580629418dc88 Reviewed-on: https://skia-review.googlesource.com/4628 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>