aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
Commit message (Collapse)AuthorAge
* Add ability for lazy proxy callback to free captured resourcesGravatar Greg Daniel2018-01-17
| | | | | | | | | | | This will be needed for DDLs that get recorded, but then deleted before the proxies actually get instantiated. Bug: skia: Change-Id: I745366fc7a7edbcd43bc617220d3d4997baa8319 Reviewed-on: https://skia-review.googlesource.com/95101 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Add SkAndroidCodec::computeSampledSizeGravatar Leon Scroggins III2018-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: b/63909536 Android's ImageDecoder API takes as input an arbitrary width and height to scale the image to. Internally, this uses SkAndroidCodec to sample, and then (if not a perfect match) scales to the desired size with drawing. computeSampledSize is a modified version of what ImageDecoder currently does to convert from arbitrary dimensions to a sampleSize. Moving it here allows it to be shared by SkAnimatedImage. The modified version also corrects two bugs: - a client using the dimensions returned by getSampledDimensions previously may have resulted in ImageDecoder decoding to a larger size and then scaling it. (example found in tests: dog.jpg is 180 x 180. getSampledDimensions(8) returns 23 x 23, but the old method resulted in using sampleSize of 7 and downscaling the resulting 25 x 25 image.) - recompute the sampleSize based on the size returned by getSampledDimensions. Change-Id: I022040e8bac31c20988903a0452257f7ae902bc7 Reviewed-on: https://skia-review.googlesource.com/94620 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Move resourceProvider accessor to GrContextPriv (take 2)Gravatar Robert Phillips2018-01-16
| | | | | | | | TBR=bsalomon@google.com Change-Id: I3fd46ebfad0d04b8a2bfa6190f81308f3a6be620 Reviewed-on: https://skia-review.googlesource.com/95121 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* detect if the computed rgn bounds is too bigGravatar Mike Reed2018-01-16
| | | | | | | | Bug:801869 Change-Id: I7380bfb86aedc719cf67e20e918ef39d1b143aee Reviewed-on: https://skia-review.googlesource.com/95020 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Use SkAndroidCodec in SkAnimatedImageGravatar Leon Scroggins III2018-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | Bug: b/63909536 Bug: b/63908092 SkAnimatedImage is designed around a specific Android use case, so move it into the android folders. Make SkAnimatedImage hold an SkAndroidCodec (instead of an SkCodec). Expose fCodec so that SkAnimatedImage can animate by using the internal SkCodec. Update the sample to use SkAndroidCodec. Allow webp to decode a scaled down animation. For RestoreBG frames, adjust the frameRect (which is erased) to account for the scaling. Add a test to verify that we decode a webp with a RestoreBG frame successfully. Disable scaling for later frames in other formats (GIF, for now), since the code for erasing a RestoreBG frame is currently unaware of the sampling. Change-Id: I5dd2b86138f2c7f6adcd08dce1bd49040f7dc224 Reviewed-on: https://skia-review.googlesource.com/94621 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
* Revert "Move resourceProvider accessor to GrContextPriv"Gravatar Hal Canary2018-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1f9ed8501b0007846b3032f4bfc38aee98c175a1. Reason for revert: 1. breaking android roll 2. breaking Build-Debian9-Clang-arm-Release-Android_API26 Original change's description: > Move resourceProvider accessor to GrContextPriv > > Change-Id: I5cddd620a7ec4b006b7359864ede58e9d4dd684e > Reviewed-on: https://skia-review.googlesource.com/94340 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I20b2d267c0925f20453b635663654967199a1197 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/94964 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Move resourceProvider accessor to GrContextPrivGravatar Robert Phillips2018-01-16
| | | | | | | | Change-Id: I5cddd620a7ec4b006b7359864ede58e9d4dd684e Reviewed-on: https://skia-review.googlesource.com/94340 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Revert "Added SkSL workaround for devices which cannot safely access ↵Gravatar Brian Osman2018-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gl_FragCoord"" This reverts commit 9d6929cccfc3e64e75e6ef5b37f284b01b68fb28. Reason for revert: Re-landing, backfill reveals none of the red was related to this CL. Original change's description: > Revert "Added SkSL workaround for devices which cannot safely access gl_FragCoord" > > This reverts commit 1001f843a45e95f6df1d44242b6b06c77898e870. > > Reason for revert: Many failures. > > Original change's description: > > Added SkSL workaround for devices which cannot safely access gl_FragCoord > > > > This is the root cause of https://github.com/flutter/flutter/issues/13216 > > I've got a GM that demonstrates the bug, but only in Viewer. > > > > Bug: skia:7410 > > Change-Id: Iaa1f27b10166aa09e4dc5949e5a6ca1bd14c99ac > > Reviewed-on: https://skia-review.googlesource.com/93920 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com > > Change-Id: I2a2edc0a8fa11fe9dac1045dc79ae91106518b02 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:7410 > Reviewed-on: https://skia-review.googlesource.com/94281 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Brian Osman <brianosman@google.com> TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia:7410 Change-Id: Ib22bda7ff25bb7c8630cc6fa6dc809bf628ea853 Reviewed-on: https://skia-review.googlesource.com/94800 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Funnel most proxy creation through GrProxyProviderGravatar Robert Phillips2018-01-16
| | | | | | | | | This is to provide a choke point for DDL to create Lazy Proxies. Change-Id: If178da13bc6447b31b7601810236d34502d9efbd Reviewed-on: https://skia-review.googlesource.com/93303 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Revert "Added SkSL workaround for devices which cannot safely access ↵Gravatar Brian Osman2018-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gl_FragCoord" This reverts commit 1001f843a45e95f6df1d44242b6b06c77898e870. Reason for revert: Many failures. Original change's description: > Added SkSL workaround for devices which cannot safely access gl_FragCoord > > This is the root cause of https://github.com/flutter/flutter/issues/13216 > I've got a GM that demonstrates the bug, but only in Viewer. > > Bug: skia:7410 > Change-Id: Iaa1f27b10166aa09e4dc5949e5a6ca1bd14c99ac > Reviewed-on: https://skia-review.googlesource.com/93920 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Osman <brianosman@google.com> TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com Change-Id: I2a2edc0a8fa11fe9dac1045dc79ae91106518b02 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7410 Reviewed-on: https://skia-review.googlesource.com/94281 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Force BackendTextureImageGenerator to work on only 1 consumer contextGravatar Greg Daniel2018-01-12
| | | | | | | | Bug: skia: Change-Id: I83d3e4af6f20c877c541964fdd489434f6a62b25 Reviewed-on: https://skia-review.googlesource.com/93200 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Updating lazy proxys to support the case where we know a lot more info about ↵Gravatar Greg Daniel2018-01-12
| | | | | | | | | | | | the texture. This is needed for future DDL texture work. Bug: skia: Change-Id: I07e0b9c67509e63b9cac00adc355254d03784df8 Reviewed-on: https://skia-review.googlesource.com/91500 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
* Added SkSL workaround for devices which cannot safely access gl_FragCoordGravatar Brian Osman2018-01-12
| | | | | | | | | | | This is the root cause of https://github.com/flutter/flutter/issues/13216 I've got a GM that demonstrates the bug, but only in Viewer. Bug: skia:7410 Change-Id: Iaa1f27b10166aa09e4dc5949e5a6ca1bd14c99ac Reviewed-on: https://skia-review.googlesource.com/93920 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Bitmap: clearing pixelref keeps rowbytesGravatar Hal Canary2018-01-12
| | | | | | | Change-Id: Ibf8b69adcb4e9df597079a8d9ada75b4a31194e6 Reviewed-on: https://skia-review.googlesource.com/94040 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Enable the GL_EXT_geometry_shader extension where necessaryGravatar Chris Dalton2018-01-11
| | | | | | | | | Bug: skia: Change-Id: I37bfb90efed28748d6c3e53be5c9703c291b036c Reviewed-on: https://skia-review.googlesource.com/93460 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Add valid checks in places we query isTestingOnlyBackendTextureGravatar Greg Daniel2018-01-10
| | | | | | | | Bug: skia:7477 Change-Id: I410427f12c7bb85d11a5e4ed1f09bbd80bbbb54c Reviewed-on: https://skia-review.googlesource.com/93000 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* shrink our 'largest' so that its non-emptyGravatar Mike Reed2018-01-09
| | | | | | | | Bug: skia: Change-Id: Ib12fd9491069440c85d5aa9c9d6d26787f03ef0d Reviewed-on: https://skia-review.googlesource.com/92643 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* GrTessellator: set a cap on quadratic linearization.Gravatar Stephen White2018-01-09
| | | | | | | | | | | | | | | Some pathological cases don't converge to a reasonable number of points when using uniform linearization of quadratic points. Cap them to the maximum which GrPathUtils supports. Add reduced test case from crbug-762369. BUG=762369 Change-Id: Icc744018e5c01a0e0fe2ec00613bdb25e49614e9 Reviewed-on: https://skia-review.googlesource.com/92721 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* make growToInclude privateGravatar Mike Reed2018-01-08
| | | | | | | | | Bug: skia: Change-Id: Id55344ba2f33563d22c2bf4d5829a9a31095a47d Reviewed-on: https://skia-review.googlesource.com/92143 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* move largest apis into privateGravatar Mike Reed2018-01-08
| | | | | | | | | Related to https://skia-review.googlesource.com/c/skia/+/91860 Bug: skia: Change-Id: Ia8fd981b422bbab75541b078277d2e09e1fc9d41 Reviewed-on: https://skia-review.googlesource.com/91940 Reviewed-by: Brian Salomon <bsalomon@google.com>
* Add GrProxyProviderGravatar Robert Phillips2018-01-08
| | | | | | | | | This pulls all the proxy tracking & creation functionality out of the GrResourceCache and GrResourceProvider and consolidates it in the GrProxyProvider. Change-Id: I7256f7c544319a70c1bd93dd5a9ccbe5fa0a544f Reviewed-on: https://skia-review.googlesource.com/91501 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Revert "allow both slash types"Gravatar Cary Clark2018-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7a600416e131b33610b1c96a367b3cb2569f458e. Reason for revert: <speculative revert; may have broken nanobench> Original change's description: > allow both slash types > > Windows allows forwards and backwards slashes > for path directory delimiters. > > R=​halcanary@google.com > > Change-Id: Ie6f1257c98ac8e2468d9297b5dc391fd17f4ae82 > Reviewed-on: https://skia-review.googlesource.com/90821 > Reviewed-by: Hal Canary <halcanary@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=halcanary@google.com,bungeman@google.com,caryclark@google.com,caryclark@skia.org Change-Id: If2eefdc6dbf6b7df0280b005cea12aff4b91cf09 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/91401 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* [sksg] More inval fixesGravatar Florin Malita2018-01-05
| | | | | | | | | | | | | | | | | | | | | | | | Backpedal on node/reval-time-determined damage: nodes cannot control the invalidation order, and shared descendants may be revalidated before a particular ancestor gets to query their state - thus making any decisions based on that invalid. Instead, apply damage suppression at invalidation time, based on node type/traits. Node types which don't generate direct damage are marked as such, and the invalidation logic bubbles damage past them, until it finds a valid damage receiver. Nodes which currently suppress damage: - PaintNode (and subclasses) - GeometryNode (and subclasses) - Matrix TBR= Change-Id: I843e683e64cb6253d8c26d8397c44d02a7d6026f Reviewed-on: https://skia-review.googlesource.com/91421 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* GrTessellator: fix for assert on bevelling.Gravatar Stephen White2018-01-05
| | | | | | | | | | | | With some large values, intersection for bevelling will fail. These should just skip the point, not assert. BUG=798912 Change-Id: Ie5c8cc3c9387055e1e31480321a231f0e6ff153b Reviewed-on: https://skia-review.googlesource.com/91141 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* Enable conditional-uninitialized flagGravatar Kevin Lubick2018-01-05
| | | | | | | | | Bug: skia:7462 Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD Change-Id: I1c0a09984bf28a5c620a89af56040f018bae6310 Reviewed-on: https://skia-review.googlesource.com/90941 Commit-Queue: Kevin Lubick <kjlubick@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* allow both slash typesGravatar Cary Clark2018-01-05
| | | | | | | | | | | | Windows allows forwards and backwards slashes for path directory delimiters. R=halcanary@google.com Change-Id: Ie6f1257c98ac8e2468d9297b5dc391fd17f4ae82 Reviewed-on: https://skia-review.googlesource.com/90821 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* [skotty, sksg] Add layer transform inheritance supportGravatar Florin Malita2018-01-05
| | | | | | | | | | | | | | | | | Split the matrix component of sksg::Transform into its own, free-floating, chainable node. Update the composite transform animator to target matrix nodes instead of transform nodes. Update the layer transform attachment logic to follow "parent" references, and build matrix inheritance chains on the fly. TBR= Change-Id: I017e5e462274c2cc210730e057b3ea2e7de5c0cb Reviewed-on: https://skia-review.googlesource.com/90803 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* [sksg] More inval fiddlingGravatar Florin Malita2018-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | Node subclasses can now control whether their bounds (changes) contribute to damage. Tristate: * Default: The node bounds contribute to damage if the node itself was invalidated, observing hasSelfInval(). This is the default behavior. * ForceSelf: The node bounds contribute to damage, regardless of hasSelfInval(). Used for domain-boundary nodes (e.g. Draw), which gate blocked fragments (e.g. geometry, paint nodes). * BlockSelf: The node bounds do not contribute to damage, regardless of hasSelfInval(). Used for nodes which do not contribute damage directly (e.g. paints, geometry). TBR= Change-Id: I7c941c7ea12e14b008d846ec13108e66e34dbc73 Reviewed-on: https://skia-review.googlesource.com/91104 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* GrTessellator: fix for points which become non-finite on AA stroking.Gravatar Stephen White2018-01-04
| | | | | | | | | | | | | If input points are near-infinite, they may become inf or NaN when stroked. Before converting the results of intersection from double to float, clamp them to the [-FLT_MAX/FLT_MAX] range. BUG=798679 Change-Id: I7d61130dd26147a9b7cfd38aa96567e3867b5c3e Reviewed-on: https://skia-review.googlesource.com/90983 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* Add SkAndroidCodec::MakeFromCodecGravatar Leon Scroggins III2018-01-04
| | | | | | | | | | | | | Bug: b/71578461 Bug: b/63909536 This allows using APIs on SkCodec (e.g. the out-param result on SkCodec::MakeFrom(Stream/Data), getOrigin) when an SkAndroidCodec is ultimately desired without duplicating the APIs on SkAndroidCodec. Change-Id: Ie9803278348acfb3955a795772d6472c15541646 Reviewed-on: https://skia-review.googlesource.com/90844 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Disable SkSG unit test for G3Gravatar Florin Malita2018-01-04
| | | | | | | | | | Speculative fix for G3 rolls. TBR= Change-Id: I937d3b432cdf0c0d654f0976fd683acba39470ef Reviewed-on: https://skia-review.googlesource.com/90405 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Build fix post c75e2401a82640c35b0b5f80a5684d0892904530Gravatar Florin Malita2018-01-04
| | | | | | | | TBR= Change-Id: I3a13fe015bc88029471930d51c741f99f38f0daa Reviewed-on: https://skia-review.googlesource.com/90404 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* [sksg] Refine invalidation logicGravatar Florin Malita2018-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to discriminate between nodes whose bounds updates contribute to the dirty region, and nodes whose bounds changes do not. E.g. animated shape in a group: the animated shape node bounds should yield damage, but the ancestor group bounds should not. To accomplish this, we refine the invalidation state: 1) self invalidation == the node itself was invalidated, and its bounds updates yield damage. 2) descendant invalidation == the node has some (self-)invalidated descendant, but its own bounds are not contributing damage. Also: * hoist the bounding box invalidation logic into the base class (Node::revalidate) and update to respect the states described above. * remove (now-redundant) GeometryNode bbox logic. * update revalidation methods to return the node bbox instead of void TBR= Change-Id: I8023d1793fb501c945a53f2dc2d2983e5b620ade Reviewed-on: https://skia-review.googlesource.com/90581 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* check for irect with overflow width/heightGravatar Mike Reed2018-01-03
| | | | | | | | Bug:798066 Change-Id: Iac324ac5a32fae241a528751c84279ce60ac4baf Reviewed-on: https://skia-review.googlesource.com/90544 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Reed <reed@google.com>
* SkFloatToDecimal moved to src/utilsGravatar Hal Canary2018-01-03
| | | | | | | | | This change stages SkFloatToDecimal() for possible re-use by pdfium. Change-Id: Iedc0c78c8a633f0b0973365d2d8b540b5443590d Reviewed-on: https://skia-review.googlesource.com/90400 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* Make GrShape lazily initialize an original path for gen id change listenersGravatar Brian Salomon2018-01-03
| | | | | | | Change-Id: I3a1cb400190cf18241436b7e655a4a267bb2e22d Reviewed-on: https://skia-review.googlesource.com/90482 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Remove obsolete commentGravatar Brian Osman2018-01-03
| | | | | | | Bug: skia: Change-Id: I2f3471c45018b4439f777a711c7d4d55227f0cd1 Reviewed-on: https://skia-review.googlesource.com/90363 Reviewed-by: Brian Osman <brianosman@google.com>
* Make GrShape recognize horizontal/vertical dashed lines with 0 off intervals ↵Gravatar Brian Salomon2017-12-21
| | | | | | | | | as rrects. Change-Id: Ic29b41911e0185d36093d5352f4494709e8124ba Reviewed-on: https://skia-review.googlesource.com/88428 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* validate text during deserializationGravatar Mike Reed2017-12-21
| | | | | | | | Bug: 796473 Change-Id: I7b6a6c698a5b53c915ef6564852fa51ce7410a3e Reviewed-on: https://skia-review.googlesource.com/88520 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
* GrTessellator: implement straight skeleton, phase 2.Gravatar Stephen White2017-12-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL implements two major changes to the AA tessellating path renderer: 1) Fix inverted edges after stroke and simplify. Instead of detecting and fixing edges which invert on stroking during the stroking pass, we run the full simplify pass on both inner and outer contours, then create edge collapse events for the overlap regions. We then process the edge events in a priority queue and process them in order of decreasing alpha (this is the "edge event" part of the straight skeleton algorithm). By doing it after simplification, we ensure that there's a full-alpha intersection vertex to join the collapse edge to (which may have <1 alpha), so no spurious gradients appear in the rendered path. 2) "Pointy" vertices (defined as those which meet at an acute angle less than 14 degrees) are now properly bevelled off during stroking. This removes antialiasing artifacts which extend beyond the path boundary. Some ancillary changes: The extracted boundaries which are input to stroking have their line equations pre-normalized, and multiplied by winding. This simplifies a lot of code which was performing this computation on the fly. The workaround for the "intruding vertex" problem was removed, since the straight skeleton now moves the intruding vertex before it can cause problems. Bug: 756823 Change-Id: I271ed32be6847da55273b387e8c04bbf9b512b70 Reviewed-on: https://skia-review.googlesource.com/87341 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* add serialprocs to MultiDocument, hide redundant methodsGravatar Mike Reed2017-12-21
| | | | | | | | | Bug: skia: Change-Id: I6521e93af79439bd8c1d2f5130a68492044a2ee9 Reviewed-on: https://skia-review.googlesource.com/87788 Reviewed-by: Wei Li <weili@chromium.org> Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Mike Reed <reed@google.com>
* remove unused willPlayBackBitmaps from pictureGravatar Mike Reed2017-12-20
| | | | | | | | | | | and SkPictureAnalyzer Bug: skia: Change-Id: I394eca648234b1a69e6f9a0a88c407366a33d079 Reviewed-on: https://skia-review.googlesource.com/87791 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Make GrRenderTargetContext::drawPath() use GrShape to identify simplerGravatar Brian Salomon2017-12-20
| | | | | | | | | geometries. Change-Id: I24230efc8bcb60f00c0c855090e3311ad13d7da8 Reviewed-on: https://skia-review.googlesource.com/85962 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Fix Adobe RGB color space in SkiaGravatar Brian Osman2017-12-20
| | | | | | | | | | | | | | | | Our runtime definition of the XYZ matrix was fairly inaccurate. It also didn't round-trip through ICC fixed point correctly. Now, constructing the color space at runtime produces exactly the same matrix as constructing the space from the ICC profile. And the values can then be serialized back to ICC exactly. This eliminates the need for the snapping logic, too. Bug: skia: Change-Id: I69f4a9bfec3eeef153935e21ab3a0630794b1607 Reviewed-on: https://skia-review.googlesource.com/84840 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@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>
* Update SkSurface MakeFromBackend* factories to take an SkColorType.Gravatar Greg Daniel2017-12-19
| | | | | | | | Bug: skia: Change-Id: Ib1b03b1181ec937843eac2e8d8cb03ebe53e32c1 Reviewed-on: https://skia-review.googlesource.com/86760 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* fixed a couple of SkSL ushort issuesGravatar Ethan Nicholas2017-12-19
| | | | | | | | | | | This fixes SkSL omitting the 'u' literal on ushort values, and ushorts can now implicitly coerce to ints. Bug: skia: Change-Id: I21e5dc06d34e09a4fc1aa4d746e6e75c0d2d8c7e Reviewed-on: https://skia-review.googlesource.com/85960 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
* GOOGLE3 -> SK_BUILD_FOR_GOOGLE3Gravatar Mike Klein2017-12-19
| | | | | | | | | | | | | This is more consistent with our other SK_BUILD_FOR_... macros, and less likely to collide with other preprocessor logic. (Luckily, this was defined in public.bzl, so we can do this all in one CL in the Skia repo.) Change-Id: I5f232888288c9c53fad445545d983d0fb0b4add8 Reviewed-on: https://skia-review.googlesource.com/86940 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Add new SkImage factory to create from GrBackendTexture with SkColorTypeGravatar Greg Daniel2017-12-18
| | | | | | | | Bug: skia: Change-Id: I46bdc54b6d9cdacc8f5a06644aa6b110837879f0 Reviewed-on: https://skia-review.googlesource.com/84342 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* remove append_from_srgb()Gravatar Mike Klein2017-12-18
| | | | | | | | | | | It's now no different than append(from_srgb). Bug: skia:7419 Change-Id: I97c59b6987f033ec2f1859db40ca3056b87b370a Reviewed-on: https://skia-review.googlesource.com/86741 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>