Commit Graph

5509 Commits

Author SHA1 Message Date
Robert Phillips
777707be84 Move GrSurfaceProxy::MakeLazy to GrProxyProvider::createLazy
This is pretty much a straight up move of the GrSurfaceProxy code with some plumbing to get the ProxyProvider in the right places.

Change-Id: I63cecb242dada503f97dbd1c0ce7ede75323100d
Reviewed-on: https://skia-review.googlesource.com/94200
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-01-17 17:04:26 +00:00
Greg Daniel
e728f676d6 Update to GrBackendTexutreImageGenerator to support lazy texture proxies
Bug: skia:
Change-Id: I7cce869894e274250f49328550a0ae2d8e04de74
Reviewed-on: https://skia-review.googlesource.com/95022
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-01-17 16:27:17 +00:00
Greg Daniel
94a6ce84ec Add ability for lazy proxy callback to free captured resources
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>
2018-01-17 14:58:26 +00:00
Leon Scroggins III
07a722cdcf Add SkAndroidCodec::computeSampledSize
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>
2018-01-16 21:23:08 +00:00
Robert Phillips
6be756b673 Move resourceProvider accessor to GrContextPriv (take 2)
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>
2018-01-16 20:53:28 +00:00
Mike Reed
0ec7dc7a1b detect if the computed rgn bounds is too big
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>
2018-01-16 20:41:14 +00:00
Leon Scroggins III
42ee284567 Use SkAndroidCodec in SkAnimatedImage
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>
2018-01-16 20:36:09 +00:00
Hal Canary
be46e24d57 Revert "Move resourceProvider accessor to GrContextPriv"
This reverts commit 1f9ed8501b.

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>
2018-01-16 18:33:14 +00:00
Robert Phillips
1f9ed8501b 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>
2018-01-16 17:02:45 +00:00
Brian Osman
cd3261ac65 Revert "Revert "Added SkSL workaround for devices which cannot safely access gl_FragCoord""
This reverts commit 9d6929cccf.

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 1001f843a4.
> 
> 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>
2018-01-16 14:12:31 +00:00
Robert Phillips
0bd24dc41f Funnel most proxy creation through GrProxyProvider
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>
2018-01-16 13:28:43 +00:00
Brian Osman
9d6929cccf Revert "Added SkSL workaround for devices which cannot safely access gl_FragCoord"
This reverts commit 1001f843a4.

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>
2018-01-12 20:21:13 +00:00
Greg Daniel
966db9e4ee Force BackendTextureImageGenerator to work on only 1 consumer context
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>
2018-01-12 19:41:13 +00:00
Greg Daniel
65fa8ca85e Updating lazy proxys to support the case where we know a lot more info about 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>
2018-01-12 19:36:08 +00:00
Brian Osman
1001f843a4 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>
2018-01-12 19:26:00 +00:00
Hal Canary
cff9ab7d98 Bitmap: clearing pixelref keeps rowbytes
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>
2018-01-12 19:15:49 +00:00
Chris Dalton
8fd7955d03 Enable the GL_EXT_geometry_shader extension where necessary
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>
2018-01-11 19:27:39 +00:00
Greg Daniel
5366e59e88 Add valid checks in places we query isTestingOnlyBackendTexture
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>
2018-01-10 17:56:20 +00:00
Mike Reed
f581777217 shrink our 'largest' so that its non-empty
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>
2018-01-09 21:57:58 +00:00
Stephen White
e40c3610e4 GrTessellator: set a cap on quadratic linearization.
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>
2018-01-09 18:49:37 +00:00
Mike Reed
185ffe916e make growToInclude private
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>
2018-01-08 22:32:51 +00:00
Mike Reed
274218ef01 move largest apis into private
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>
2018-01-08 20:42:27 +00:00
Robert Phillips
1afd4cdb08 Add GrProxyProvider
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>
2018-01-08 19:05:31 +00:00
Cary Clark
5ef4ebf3c4 Revert "allow both slash types"
This reverts commit 7a600416e1.

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>
2018-01-05 18:21:55 +00:00
Florin Malita
c14f144484 [sksg] More inval fixes
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>
2018-01-05 18:08:31 +00:00
Stephen White
f470b7ecf0 GrTessellator: fix for assert on bevelling.
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>
2018-01-05 18:08:30 +00:00
Kevin Lubick
4284613cfe Enable conditional-uninitialized flag
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>
2018-01-05 18:03:25 +00:00
Cary Clark
7a600416e1 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>
2018-01-05 17:53:15 +00:00
Florin Malita
18eafd922d [skotty, sksg] Add layer transform inheritance support
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>
2018-01-05 03:29:04 +00:00
Florin Malita
0ebf4192f1 [sksg] More inval fiddling
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>
2018-01-05 00:42:14 +00:00
Stephen White
94b7e54256 GrTessellator: fix for points which become non-finite on AA stroking.
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>
2018-01-04 21:36:06 +00:00
Leon Scroggins III
7397d7ade8 Add SkAndroidCodec::MakeFromCodec
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>
2018-01-04 21:36:04 +00:00
Florin Malita
f4f3f0fb29 Disable SkSG unit test for G3
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>
2018-01-04 05:17:30 +00:00
Florin Malita
67cd9b273f Build fix post c75e2401a8
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>
2018-01-04 01:37:30 +00:00
Florin Malita
c75e2401a8 [sksg] Refine invalidation logic
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>
2018-01-04 00:59:20 +00:00
Mike Reed
9fc53624a0 check for irect with overflow width/height
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>
2018-01-03 21:01:54 +00:00
Hal Canary
3c36ef6be9 SkFloatToDecimal moved to src/utils
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>
2018-01-03 19:59:31 +00:00
Brian Salomon
da6d072030 Make GrShape lazily initialize an original path for gen id change listeners
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>
2018-01-03 19:29:19 +00:00
Brian Osman
d9852cd27a Remove obsolete comment
Bug: skia:
Change-Id: I2f3471c45018b4439f777a711c7d4d55227f0cd1
Reviewed-on: https://skia-review.googlesource.com/90363
Reviewed-by: Brian Osman <brianosman@google.com>
2018-01-03 16:10:39 +00:00
Brian Salomon
72f78c3701 Make GrShape recognize horizontal/vertical dashed lines with 0 off intervals 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>
2017-12-21 22:45:15 +00:00
Mike Reed
889d521d87 validate text during deserialization
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>
2017-12-21 21:06:44 +00:00
Stephen White
e260c46bbf GrTessellator: implement straight skeleton, phase 2.
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>
2017-12-21 20:51:27 +00:00
Mike Reed
47fdf6c85e add serialprocs to MultiDocument, hide redundant methods
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>
2017-12-21 12:36:30 +00:00
Mike Reed
b60c5ebf04 remove unused willPlayBackBitmaps from picture
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>
2017-12-20 20:27:06 +00:00
Brian Salomon
2fad74a0fd Make GrRenderTargetContext::drawPath() use GrShape to identify simpler
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>
2017-12-20 18:47:36 +00:00
Brian Osman
a12f795f4a Fix Adobe RGB color space in Skia
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>
2017-12-20 14:09:34 +00:00
Brian Salomon
0a241ce808 Don't canonicalize empty SkRRects. They stroke differently.
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>
2017-12-19 21:10:36 +00:00
Greg Daniel
faa095e984 Update SkSurface MakeFromBackend* factories to take an SkColorType.
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>
2017-12-19 18:41:36 +00:00
Ethan Nicholas
58d5648816 fixed a couple of SkSL ushort issues
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>
2017-12-19 14:58:56 +00:00
Mike Klein
6613cc5186 GOOGLE3 -> SK_BUILD_FOR_GOOGLE3
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>
2017-12-19 14:42:16 +00:00