Commit Graph

24233 Commits

Author SHA1 Message Date
Brian Salomon
b88894c881 Remove per-format glCheckframebufferStatus checks.
A long time ago we were more aggressive about attempting to make
renderable surfaces that were not required color-renderable than
currently.

Doing this check seems to be tickling a driver bug on some Mali
drivers, discovered while working on
https://skia-review.googlesource.com/c/skia/+/236676/7

Change-Id: I89d5d84ea2d63230b89dff65c7a93789327bbe09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240283
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-10 13:06:47 +00:00
Herb Derby
b831e26be3 Cleanup SkPackedGlyphID
Simplify lengths, positions and masks. The old code used to support
both unicode, and SkGlyphIDs; unicode support is not needed since
unicode->glyphID translation was moved to the typeface. Change the
glyph id field from 24 bits to 16.

Change-Id: I28524870c97a441159c5b00acfc2c43834924c8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240280
Commit-Queue: Herb Derby <herbderby@gmail.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-09-09 21:52:44 +00:00
Brian Osman
9c173c8347 Remove temporary Metal pipeline cache size hack
Landed a Chromium CL to set this in GrContextOptions:
https://chromium-review.googlesource.com/c/chromium/src/+/1790501

Change-Id: I0d328b74eb356768638fb851a4523884456fd543
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240279
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-09 21:11:37 +00:00
Ethan Nicholas
c2d84bfa74 fixed byte/ubyte types in SPIR-V output
Bug: oss-fuzz:15313
Change-Id: Id694413b5c4de41b4e64ed45b732aaa4c52b5f1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240198
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-09 18:53:38 +00:00
Greg Daniel
28d40b2e7a Reland "Add support for direct use of vulkan primary command buffer in render pass."
This reverts commit db53a59cb9.

Reason for revert: Going to reland with the code but the caps flag turned off.

Original change's description:
> Revert "Add support for direct use of vulkan primary command buffer in render pass."
> 
> This reverts commit eedd08576a.
> 
> Reason for revert: This is causing image failures on 5x and s9 which look like driver issues. But going to revert for the weekend and probably reland with those devices behind a flag.
> 
> Original change's description:
> > Add support for direct use of vulkan primary command buffer in render pass.
> > 
> > Change-Id: Icd43965da49963fc9b6ac6c1f7a40be50f2055e8
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239920
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,jvanverth@google.com
> 
> Change-Id: Ia2e0f0d01b5aaf12f7d42584f19ae745bee0765c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239929
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ia0fc279d17f8829ce412955dea88106f8676b1d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240199
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-09-09 15:25:52 +00:00
Ethan Nicholas
73b8376b30 Fixed skslc assertion failure discovered by fuzzer
This particular issue probably wouldn't ever occur in hand-written code, but
such is fuzzing...

Bug: oss-fuzz:17061
Change-Id: Ia5da7b75afef8b49bb19ddb7f1ea8696053c2e54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240197
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-09 14:05:41 +00:00
Brian Osman
e8820d45ce Remove legacy flag: GrContextOptions::fDisallowGLSLBinaryCaching
Subsumed by fShaderCacheStrategy, clients have switched over.

Change-Id: I70b6ade4ccab2f48f2ef9437ae65c78cf458cfe4
Bug: skia:9402
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239928
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-09 13:43:51 +00:00
Mike Reed
78fb80a2b3 share private iterator/helpers for building paths
pre-cl to pave the way for SkPathRaw and pathbuilders

Change-Id: Ieda1230b91353e92b75bc7336fc35bbb4c7abdaa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240196
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-09-09 12:31:51 +00:00
Greg Daniel
db53a59cb9 Revert "Add support for direct use of vulkan primary command buffer in render pass."
This reverts commit eedd08576a.

Reason for revert: This is causing image failures on 5x and s9 which look like driver issues. But going to revert for the weekend and probably reland with those devices behind a flag.

Original change's description:
> Add support for direct use of vulkan primary command buffer in render pass.
> 
> Change-Id: Icd43965da49963fc9b6ac6c1f7a40be50f2055e8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239920
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com

Change-Id: Ia2e0f0d01b5aaf12f7d42584f19ae745bee0765c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239929
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-09-06 20:57:09 +00:00
Greg Daniel
c30f1a936d Move surface wait ops to GrRenderTasks.
Change-Id: Id989a666e67be85af6ed72447696657b8c11aaa5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239443
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-09-06 19:57:26 +00:00
Mike Reed
689188a438 simplify convexity-helper code
Change-Id: I7dd015a1cf76570bc2a6f00601800c46a3bd88a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239926
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-09-06 19:47:42 +00:00
Brian Osman
ed58e004e0 Add support for pre-compiling cached SkSL shaders
The client can do a test run of their application with
a persistent cache set to SkSL mode. They store the key
and data blobs that are produced.

Ship those blobs with the application. At startup, call
GrContext::precompileShader for each key/data pair. This
compiles the shaders, and stores the GL program ID, plus
a small amount of metadata in our runtime program cache.

Caveats:
* Currently only implemented for the GL backend. Other
  backends will require more metadata to do any useful
  amount of work. Metal may need a more drastic workflow
  change, involving offline compilation of the shaders.
* Currently only implemented for cached SkSL (not GLSL
  or program binaries). Supporting other formats again
  requires more metadata, and the cached shaders become
  increasingly specialized to GPU and driver versions.
* Reusing the cached SkSL on different hardware is not
  supported. Many driver workarounds are implemented in
  the SkSL -> GLSL transformation, but some are higher
  level. Limiting device variance by artificially hiding
  extensions may help, but there are no guarantees.

* The 'gltestprecompile' DM config exercises this code
  similarly to 'gltestpersistentcache', ensuring that
  results are visually identical when precompiling, and
  that no cache misses occur after precompiling.

Change-Id: Id314c5d5f5a58fe503a0505a613bd4a540cc3589
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239438
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-06 19:45:09 +00:00
Mike Reed
f6cb6eddec speed-up rotated rects for drawAtlas
Apply the rotation before we init the path, saving the cost of calling
path.transform().

Before

  14/14  MB	1	8.39ms	8.51ms	8.49ms	8.63ms	drawAtlas_colors_rotated
  14/14  MB	1	7.08ms	7.23ms	7.23ms	7.49ms	drawAtlas_rotated

After

  14/14  MB	1	7.74ms	7.87ms	7.84ms	7.93ms	drawAtlas_colors_rotated
  16/16  MB	1	6.28ms	6.59ms	6.51ms	6.63ms	drawAtlas_rotated

Change-Id: Iae117acec8c4f2b5e5810330529951079a13420c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239922
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-09-06 19:42:39 +00:00
Ethan Nicholas
c70027b151 Revert "Revert "switched SkSL interpreter over to threaded code""
This reverts commit cbdc829ff1.

Bug: skia:
Change-Id: Idb7ad413431e6556bc040369df258655c2349ef2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239447
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-06 19:11:10 +00:00
Greg Daniel
eedd08576a Add support for direct use of vulkan primary command buffer in render pass.
Change-Id: Icd43965da49963fc9b6ac6c1f7a40be50f2055e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239920
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-09-06 18:39:40 +00:00
Robert Phillips
aee18c95b1 Cleanup after removal of IORefs from GrSurface
The removal of IORefs from GrSurface makes a lot of other cruft obsolete.

Change-Id: I0e02d680a17dc4f4ec705cb6ee4c294738271e28
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239919
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-06 17:55:45 +00:00
Robert Phillips
d470e1b905 Add kRG_88_SkColorType
Bug: skia:9121

Change-Id: Id2a12a5d607b84ce393d2b58233bf8e23f646059
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235797
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-09-06 17:55:26 +00:00
Mike Reed
7b5abd8a9b don't call mutex if we're unique
Takes the overhead of invoking the Editor down to near 0. This affects
every call to SkPath for adding segments (e.g. moveTo, lineTo).

10% faster for rotated drawAtlas

Change-Id: Ice66fc78042429dc545e597a352195cf1ce54187
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239918
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-06 16:27:05 +00:00
Brian Osman
172bb44f2d Make the size of program/pipeline caches configurable in GrContextOptions
Change-Id: I988fd8cc7e78e2124f20b7d8a815f160bb166756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239756
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-06 14:43:05 +00:00
Mike Reed
43ad1a4e30 use scratch path to save on mallocs in drawAtlas
20% savings on drawAtlas with rotated content

Change-Id: I928de590629c9f1ea41e9053041095922cab3efc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239917
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-09-06 14:26:45 +00:00
Robert Phillips
bf8bf83642 Remove IORefs from GrSurface
Change-Id: Ib52b54acbf91e3993a6791b83c759fa768c3fdd1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236339
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-06 12:41:35 +00:00
Herb Derby
d9401037cd Remove bool for RemoteStrike send
Change-Id: Iae5afc5601786030af74c3af3d760f5a942d30a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237897
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
2019-09-05 22:54:09 +00:00
Mike Reed
8fda88ed6d reverse/restore order of verbs in path to be forward (normal)
As part of this (clean up), also removed support for serialized-paths
older than version-4, which was introduced Feb 2018.

Change-Id: I2dc74a52bb8bdd7ea0cb2d8a78b644ca783eb31f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239102
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-05 21:14:08 +00:00
Khushal
498a9b2449 Reland: Only send the RemoteStrikes that have pending glyphs.
This reverts commit 94c6647556. The issue
was that we were not clearing the set of locked strikes, if there is no
data to send. As a result the client was assuming strikes are locked
even after they were purged on the service side.

R=herb@google.com

Bug:999682
Change-Id: I767dd0cab81e085123058201dab042628ac4e241
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239343
Auto-Submit: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-09-05 20:39:12 +00:00
Greg Daniel
f0c681e459 Begin renderpasses immediately in GrVkOpsRenderPass.
This change will allow us to easily switch between rendering to a
primary vs secondary command buffer.

Change-Id: Iaa066f24b64a686db41a1554b0d75c185714ef8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239100
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-09-05 20:23:12 +00:00
Michael Ludwig
b6e8922955 Clean up prior backdrop-filter CL
This addresses reviewer comments from https://skia-review.googlesource.com/c/skia/+/239108 that were postponed to get the first CL landed ASAP.

Additionally, removes the now unnecessary applyCTMForBackdrop() function.

Bug: skia:9074
Change-Id: Ibc3ac4a4edd7e5546fa83145346869a68efc33f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239440
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-09-05 19:59:46 +00:00
Greg Daniel
f793de1189 Update some ops to create their buffers in onPrepare.
Need for a follow on change, we need all ops to do all their prep work
which includes creating needed buffers before we start calling
execute on ops. This change updates the few ops that were creating their
buffers in onExecute.

Change-Id: I0f43b0cc35359e1e7ccfb3b159e79bdfe288dcb1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239436
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-09-05 19:43:11 +00:00
Ethan Nicholas
cbdc829ff1 Revert "switched SkSL interpreter over to threaded code"
This reverts commit adecf4b6d5.

Reason for revert: breaking the entire world

Original change's description:
> switched SkSL interpreter over to threaded code
> 
> Bug: skia:
> Change-Id: I2a7b772a874aa920b8509214c25e874020c896ce
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238962
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

TBR=brianosman@google.com,ethannicholas@google.com

Change-Id: I1d5ce9d11b2d94feb29c9bd2f0608526ddea2d99
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239556
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-05 18:06:59 +00:00
Ethan Nicholas
adecf4b6d5 switched SkSL interpreter over to threaded code
Bug: skia:
Change-Id: I2a7b772a874aa920b8509214c25e874020c896ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238962
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-05 17:44:43 +00:00
Michael Ludwig
6d1c0d4196 Avoid use of SkMatrixImageFilter to handle CTM for backdrop filtering
The DrawDeviceWithFilter function used to rely on SkImageFilter's
applyCTMForBackdrop, which would create a new DAG and use an
SkMatrixImageFilter node to account for the transformation. However,
that filter is really meant to perform a transformation prior to the
CTM matrix. Abusing matrix math to instead have it map the backdrop
contents back into the CTM local space grossly inflated the size of the
temporary images needed when under many perspective transforms.

This CL instead takes over control of the CTM decomposition and draws
the backdrop (src) content into a temporary layer directly, and then
feeds that through the image filtering. The code is somewhat cumbersome
to follow because of the combination of coordinate spaces and need to
make everything relative to the top left corner of the images.

When the rest of my image filter refactor is more underway, I believe that
a lot of the coordinate space math and image origin accounting will
be much cleaner, but the overall backdrop filtering strategy would remain
similar to this new implementation.

Bug: skia:9074
Change-Id: Ibd2995e81d2b308c74b2d298da5e38daa74c8677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239108
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-09-05 16:35:18 +00:00
Chris Dalton
d6cda8d1cb Rename GrGLIRect to GrNativeRect
This will allow us to reuse the "setRelativeTo" logic in more places
than GL.

Bug: skia:
Change-Id: Ic67b211d2a1b27535187ddae8e4771f595dc0397
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239414
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-05 15:46:18 +00:00
Chris Dalton
76500e5d0a Clean up GrGLIRect
Renames fLeft/fBottom to fX/fY, removes the GL calls, and adds static
"MakeRelativeTo" methods.

Bug: skia:
Change-Id: I7a09673f29a771a35cc52ec049421591d6077659
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239413
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-09-05 15:37:08 +00:00
Brian Salomon
f0b8bf35a8 Fix profile width check in GrRectBlurEffect.
Previously this code was given a rectangle that was already outset
3 sigma. Thus, the 12 sigma check was correct. However, it is now
given the original rect so the check should be against 6 sigma.

Bug: chromium:995308
Change-Id: Ibd234c6de7ee4e993b174608bbad11209755f8b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239439
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-05 14:37:08 +00:00
Brian Salomon
e736684166 Go back to rect blur profile textures.
It's faster than analytic.

This version of profile texture has better binning and simpler shader
logic than the original. I believe it also avoids some integralization
that led to artifacts in the previous texture implementation.

We oversize the profile for the blur, bin by pow 2 with a 32 texel min
and then rescale the texture coordinates over a 6 sigma range in the
shader. We pre-inset the rect uniform so the texture is always placed
with one end at the rect edge, extending outward.

Bug: chromium:995308
Change-Id: I739db98d4df69de0f5b2f5dda079cf034ba32035
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239119
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-04 17:31:26 +00:00
Florin Malita
8bb6f61d6f [svgcanvas] Refactor clipping
Instead of emitting one fully-resolved clip per primitive, build a
clip hierarchy based on SkClipStack genIDs and SVG groups.

Bug: skia:9344
Change-Id: Ic26c7cd2e268a4cc2f251757f0e9e22475fb9994
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236346
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-09-04 14:36:32 +00:00
Ben Wagner
6be3ea7a7d [pdf] Disable default width calculation.
Unfortunately, poppler does not currently appear to handle DW.

Change-Id: I394f0f28fab194275016ce70f0ae254254c7b3d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238964
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-09-04 00:42:19 +00:00
Brian Osman
a66081d943 Move SkSL caching out of GR_TEST_UTILS, trim persistent cache options
Combines the two boolean options into a single tri-state enum. Old GLSL
option is still present (temporarily) until Chrome is switched over.

Also add a type tag for cached program binaries, so we can safely
detect cache entries of the wrong type.

Change-Id: I0ddeefa9180b27bc2c46e2e7b77e6c9cdf4a730a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238856
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-03 20:18:48 +00:00
Brian Osman
e9d9a3278f Remove GrGLProgram cache stats, remove spurious declarations/includes
Change-Id: I5f3c17fc008a5ec92803000f17d7db65af1b4cfa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238901
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-03 19:12:07 +00:00
Greg Daniel
b20d7e5412 Track all sampled textures in GrOpsTask and pass them to GrOpsRenderPass.
In Vulkan we use this list to set the layout for these surface to be
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL at GrOpsRenderPass creation
instead of at submit. This gets us closer to being able to run with
primary or secondary command buffers.

Change-Id: I6e307485987e2c024ed9ecba3e41f588047c5f07
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238444
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-09-03 18:22:32 +00:00
Ben Wagner
e91f2235bb [pdf] Only compute needed advances.
The previous code computed all advances in the font up front, not just
the ones in the subset. This can take a long time. Instead, only compute
the advances in the subset.

This replaces the previous state machine with slightly easier to
understand look ahead. There is never a need to look ahead more than two
positions, so this isn't too bad.

This also calculates the most common advance width in the subset and
uses it as the default (the default was previously always zero). Other
than ommiting the defaults, this code should produce the equivalent
output to the previous code.

On my local Windows 10 box this reduces Chromium's
IsolateOriginsPrintBrowserTest.PrintIsolatedSubframe test runtime
(standalone) from 20 seconds to 15.

Bug: chromium:996185
Change-Id: I40d8b27ab1344d546de3958b3198b675bda81b76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238596
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-09-03 18:08:02 +00:00
Brian Salomon
7a7ddc447f Add parens to assert
TBR= robertphillips@google.com

Change-Id: Id0d7cee8a9b5f28e28e073928b29055b2efaae1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238858
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-03 16:00:16 +00:00
Greg Daniel
4fe92577c5 Comment out assert in onClear in GrVkOpsRenderPass.
Change-Id: I65d8bf85749ee543e392d406cb2c976199e3856c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238857
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-03 15:44:36 +00:00
Florin Malita
a3d88db57f [svgcanvas] Skip redundant clip-rule attributes
- when nonzero (default)
 - when applied to <rect> (no effect)

TBR=
Bug: skia:9344
Change-Id: I1162c4a9c93177fc5c1eadde8901eb888d16bfc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236342
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Florin Malita <fmalita@chromium.org>
2019-09-03 15:31:16 +00:00
Robert Phillips
cf39f375d1 Remove maxCount resource cache limit
Change-Id: I0f1064c8433d69e24ca3d5b970c99d539dc1dadd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238442
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-03 14:59:51 +00:00
Brian Salomon
beb7f525c8 Make GrSurfaceProxy constructors take arg that determines participation in
GrResourceAllocator.

Removes LazyInstantiationType. All callbacks can be invoked one time (if successful).
Lazy callbacks indicate whether their lifetime should be extended, which is used by
promise image proxy callbacks.

Promise image proxies are no longer deinstantiated at the end of flush and
GrDeinstantiateProxyTracker is removed. They will be instantiated the first time
they are encountered in GrResourceAllocator::addInterval (without actually adding
an interval) and then remain instantiated.

Also removes some "helper" versions of proxy factory functions that took fewer
params. They weren't much used outside of test code and as the total number of params
has grown their relative utility has diminished. We could consider a params struct
or radically simpler helpers that take only a few params if desired.

Change-Id: Ic6b09e7b807b66cb9fcbb7a67ae0f9faf345485f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238216
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-03 14:58:41 +00:00
Khushal Sagar
94c6647556 Revert "Only send the RemoteStrikes that have pending glyphs."
This reverts commit 3783375c4d.

Reason for revert: Glyph cache miss issues are back with this change (landed in 78.0.3898.0) : https://crash.corp.google.com/browse?q=product_name%3D%22Chrome%22+AND+expanded_custom_data.ChromeCrashProto.channel+IN+%28%22canary%22%29+AND+expanded_custom_data.ChromeCrashProto.magic_signature_1.name%3D%22%5BDump+without+crash%5D+SkScalerContextProxy%3A%3AgenerateMetrics%22

Original change's description:
> Only send the RemoteStrikes that have pending glyphs.
> 
> Count the number of strikes in fRemoteStrikesToSend that have
> glyphs to send. The strike may not have glyphs to send, because they
> were sent previously. Then, send the strikes that have glyphs to send.
> Keep the bool in the serialization which indicates that strike
> has glyphs and should always be true now. The bool will be removed in the next CL.
> 
> Change-Id: I8b75d1bda574fd71adfd21cb20ff912340fc2e33
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237815
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>

TBR=herb@google.com,khushalsagar@chromium.org,khushalsagar@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I910734d9db570784b73e108d7b5abedd2efc5ad7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238778
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
2019-09-03 00:55:44 +00:00
Michael Ludwig
0a1e9efa39 Don't use AA convex path renderer if direction can't be determined
Without the changes to GrShape and GrAAConvexPathRenderer, this new GM
would not draw the red circle at the center when using Ganesh. Raster
drew the red circle. The difference came about because they checked
convexity after transforming by the view matrix, and Ganesh checked
before.

With this particular path construction and the very large scale factor
on the CTM, the convexity calculator in local space computed small
enough edge vectors that it thought the contour backtracked on itself
instead of winding in a consistent direction.

The GrAAConvexPathRenderer would claim it could draw the convex path,
but later when actually preparing to draw, it would do nothing if it
turned out the convex path didn't have a direction. This CL updates it
so that the convex path renderer's canDraw() function matches what it
is actually able to draw.

There is the separate issue of the convexity/direction checking
precision.

Bug: chromium:996140
Change-Id: I6f2af2d9ba6752663d97c8573deb2d767a3f1245
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238121
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-09-02 01:57:03 +00:00
Andy Weiss
8ef18d359b Override operator delete for GrCCPathCache::Key
GrCCPathCache::Key allocates extra space for a buffer in Make but using sized
delete will then lead to UB as operator delete is not implemented.

This change overrides the delete operator to force the unsized variant
which gets rid of the UB at the cost of not taking advantage of sized
delete. Once P0722R1 is available to safely compute the full size of
the object inside delete, this code can change to use sized delete.

c.f. https://bugs.chromium.org/p/skia/issues/detail?id=6384
and http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0722r1.html

Change-Id: Id92edc71374be6880aa362e625bb9a5d20e07ac0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238116
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-30 20:08:21 +00:00
Greg Daniel
15ecdf94fd Just skip uninstantiated GrOps instead of delete them on flush.
Change-Id: I4e1755872979b635ad993cfba6b17d7b79ee2c54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238179
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-30 20:01:41 +00:00
Chris Dalton
4ece96d76d Reland "Initiate MSAA resolves during DAG generation"
This is a reland of 804f6a0fe7

Original change's description:
> Initiate MSAA resolves during DAG generation
> 
> Adds an "fIsMSAADirty" flag to GrRenderTargetProxy and switches to
> resolving MSAA in GrTextureResolveRenderTask. This completes our push
> to resolve textures outside of render passes.
> 
> For the time being, we only store a dirty flag on the proxy and still
> rely on the GrRenderTarget itself to track the actual dirty rect. This
> will be followed by a CL that moves the dirty rect out of
> GrRenderTarget and into the proxy.
> 
> Bug: skia:
> Change-Id: I21219a58028bdb4590940210e565133093cd34b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235672
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: skia:
Change-Id: I805b3af1404eb7919ae937cff3dfa97921e32c69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237482
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-30 17:54:10 +00:00
Ethan Nicholas
095f5b4de8 .fp files now support user-defined functions
Bug: skia:
Change-Id: I9903f4c7751474a066b52b1feab39b58a9cb7af2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238439
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-08-30 17:50:45 +00:00
Ethan Nicholas
e7a6bad7a3 removed dead code from SkSLPipelineStateCodeGenerator
Bug: skia:
Change-Id: Ie33391a9ef70eb7210a205c98b63fdc333295be8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238437
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-08-30 17:49:05 +00:00
Chris Dalton
a43e2d284b Don't assert mips actually need resolve during texResolveRenderTask
Too many exceptions can arise during flush in which the mips won't
actually be marked dirty: Failed to flush GL state, Ops that don't
actually issue any draws, etc. Since the DAG can't and shouldn't
predict these rare exceptions, we just remove the assert.

Bug: skia:
Change-Id: I41cd802f226388fca3762736f15b529efb69a3a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238166
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-08-30 16:17:33 +00:00
Ethan Nicholas
d4efe685dd SkSL sample() now permits specification of coordinates
Bug: skia:
Change-Id: I16073008ac852f1864bd1d2bd38087a5b661d05a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232581
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-08-30 15:29:13 +00:00
Stephen White
e264131289 Dawn: Implement RenderPipeline caching (optimization).
Implement RenderPipeline caching. This moves creation of all pipeline-
related objects from GrDawnGpuCommandBuffer.cpp to GrDawnProgramBuilder.

Change-Id: I42797750877b655ee19347406946302b296f3758
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236917
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-08-29 19:54:33 +00:00
Greg Daniel
d72dd4dfdc Fix updating of current task index in GrResourceAllocator
Bug: chromium:996610
Change-Id: Ibb133e0ab4c1250189b69b60418d8c553c9645e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238117
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-29 19:04:02 +00:00
Brian Salomon
a036f0d54e Make GrSurfaceProxy derive from GrNonAtomicRef and remove GrIORefProxy.
Also, expose GrNonAtomicRef's ref count. Since it's non-atomic and not
thread-safe it seems fine.

Change-Id: I5cf48e60d32094354955b2614cfeebbb4c1ecf2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238059
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-29 19:03:33 +00:00
Stephen White
d729e2d64a Dawn: submit all command buffers in a single call.
All command buffers are now appended to a single vector, and submitted
submitted in onFinishFlush() in a single submit.

In order to do this, implement a centralized command encoder for copies.
This command encoder is used for buffer-to-buffer, buffer-to-texture and
texture-to-buffer copies.

Change-Id: If1092ae4edbe03c995d4cb80e0dc124516d63dad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235826
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-08-29 18:45:05 +00:00
Herb Derby
3783375c4d Only send the RemoteStrikes that have pending glyphs.
Count the number of strikes in fRemoteStrikesToSend that have
glyphs to send. The strike may not have glyphs to send, because they
were sent previously. Then, send the strikes that have glyphs to send.
Keep the bool in the serialization which indicates that strike
has glyphs and should always be true now. The bool will be removed in the next CL.

Change-Id: I8b75d1bda574fd71adfd21cb20ff912340fc2e33
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237815
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
2019-08-29 17:02:02 +00:00
Brian Osman
ca8b07cf8a Reland "Pin the GLSL version to be no larger than the GL version"
Updated to fix a bug with the different version numbering between
GL and GLSL.

This reverts commit 0042cb0c87.

Change-Id: I5ae9bb77bd46eac47b05e340b491f8a8671ef5a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238057
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-29 14:57:42 +00:00
Michael Ludwig
a4b448831c Reland "Calculate draw bounds in drawEdgeAAImageSet"
This reverts commit a5fa56e910.

Reason for revert: Fixes bound calculation to transform fDstRect by each entry's pre-view matrix
if needed.

Original change's description:
> Revert "Calculate draw bounds in drawEdgeAAImageSet"
>
> This reverts commit 977b50a7e0.
>
> Reason for revert: Likely broke skia_renderer bots, https://test-results.appspot.com/data/layout_results/linux-rel/177320/vulkan_swiftshader_blink_web_tests%20%28with%20patch%29/layout-test-results/results.html
>
> Original change's description:
> > Calculate draw bounds in drawEdgeAAImageSet
> >
> > This will allow SkiaRenderer to provide image filters on the SkPaint
> > instead of using an explicit saveLayer, where they must calculate the
> > draw bounds. Once SkiaRenderer provides filters that way, they will
> > automatically take advantage of any implicit layer optimizations we can
> > add down the road.
> >
> > Bug: skia:9283
> > Change-Id: I87adef336a08210d4d015e36c907e893a973947d
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237477
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
>
> Change-Id: I99d90f7beae89b509c35649dcfcdf392a47b3415
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:9283
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237596
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

Change-Id: I1cba1e70d32abe7cd2ad3cfe478960a3670e79ca
Bug: skia:9283
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237900
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
2019-08-28 21:05:30 +00:00
Michael Ludwig
ac3521262b Reland "Combine snapBackImage and snapSpecial"
This reverts commit fd849a537a.

Reason for revert: Magnifier filter fixed, layout tests shouldn't break on this change anymore.

Original change's description:
> Revert "Combine snapBackImage and snapSpecial"
> 
> This reverts commit 45739aa1d8.
> 
> Reason for revert: Looks like the magnifier filter doesn't handle subset origins correctly either, not caught by our tests, but does in layout tests.
> 
> Original change's description:
> > Combine snapBackImage and snapSpecial
> > 
> > Previously, snapBackImage always made a copy since that is required for
> > its use in saveBehind(). Backdrop filters also used snapBackImage because
> > it relied on its subset SkIRect argument to avoid using the entire
> > layer as input to the backdrop filter. The regular snapSpecial() originally
> > did not take a subset at all. The GPU implementations of snapSpecial()
> > and snapBackImage() were very similar. This merges them into a single call
> > that takes a subset SkIRect and a boolean to control if the copy is required.
> > 
> > Only saveBehind() requires that the copy is made, due to how it bypasses
> > the regular copy-on-write behavior managed by SkCanvas and SkSurface. The
> > no-argument saveSpecial() is still provided, but it is defined to just snap
> > the bounds of the device.
> > 
> > Flutter noticed a fairly serious performance regression on iOS that went
> > back to this CL: 08b260c27b. It was determined that the only significant change in
> > behavior that was active given their minimum working example was switching
> > from snapSpecial() to snapBackImage(). Hopefully moving to a snapSpecial that
> > takes a subset, but doesn't copy when there is a texture already available
> > will restore the performance.
> > 
> > Bug: skia:9283, https://github.com/flutter/flutter/issues/36352, https://github.com/flutter/flutter/issues/37541, https://github.com/flutter/flutter/issues/36064
> > Change-Id: I448f8886347a1e0f4da8f61279744bb9254f7752
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237127
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> 
> TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
> 
> Change-Id: I7fd897da8a50b2fc0079e2aed9b6ad4bed6d3879
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:9283, https://github.com/flutter/flutter/issues/36352, https://github.com/flutter/flutter/issues/37541, https://github.com/flutter/flutter/issues/36064
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237616
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com

Change-Id: Ieeb7e8c3b3261d9e900fea6e83a5726b4b6c86cd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9283, https://github.com/flutter/flutter/issues/36352, https://github.com/flutter/flutter/issues/37541, https://github.com/flutter/flutter/issues/36064
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237904
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-28 21:03:12 +00:00
Brian Osman
0042cb0c87 Revert "Pin the GLSL version to be no larger than the GL version"
This reverts commit 63655b5a21.

Reason for revert: Seems to be happening on more devices than is expected.

Original change's description:
> Pin the GLSL version to be no larger than the GL version
> 
> Some Adreno 308 devices have a driver bug where the GLSL version is
> higher than the GL version, and attempting to use shaders with that
> version triggers an error.
> 
> Change-Id: I5c8996e9771983e547ec75e57b04e2584507727f
> Bug: https://github.com/flutter/flutter/issues/36130
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237898
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,brianosman@google.com

Change-Id: I4df2a01ae5228aa4edb56b35aa7f28807886282a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/flutter/flutter/issues/36130
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237903
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-28 20:46:08 +00:00
Michael Ludwig
9c853fa54a Fix non-zero special-image subsets in magnifier filter
This will let us re-land https://skia-review.googlesource.com/c/skia/+/237127
which makes non-zero subsets much more common. Confirmed that this CL and
the linked CL will now pass the CC unittests that caught the original failure.

Change-Id: Ic0393a574b2c19d92421a5deece81ab2ed70fc97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237899
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-28 20:35:29 +00:00
Michael Ludwig
6c580f3cc1 Revert "Fix flutter roll"
This reverts commit 7be971fa3a.

Reason for revert: Flutter has been updated to new API, these patches
should not be necessary.

Original change's description:
> Fix flutter roll
>
> Flutter extends from the SkCanvasVirtualEnforcer, so the prior change
> to onDrawEdgeAAQuad to accept an SkColor4f instead of SkColor broke
> their build, the flutter roller, and--transitively--the G3 roller.
>
> This keeps the old onDrawEdgeAAQuad around as a no-op so their
> canvas_spy class can extend from it.
>
> TBR=bsalomon@google.com, stani@google.com
>
> Bug: skia:
> Change-Id: I3798ec60a21e90c3d3f5d59f19f7dbe62e37cbec
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237590
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,stani@google.com,michaelludwig@google.com

Change-Id: I2946043dbddfdfc8c853e68853a8a349db0b5ab1
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237901
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-08-28 19:50:56 +00:00
Leon Scroggins III
0e68f44212 SkAnimatedImage: Update HEIF duration
Bug: 139815242
Test: Manual

HEIF does not know the correct duration for a frame until it has been
decoded. Update the frame time after decoding.

Change-Id: I6c4d1f27ea927b27d4c435e6aca94d57126e1146
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237876
Reviewed-by: Chong Zhang <chz@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-08-28 19:49:06 +00:00
Jim Van Verth
066ceb15b6 Implement fences and semaphores for Metal.
GrFence is implemented by a single MTLSharedEvent where we increase the
value with each new invocation. GrSemaphore uses a MTLEvent (the
assumption here is that we are signaling and waiting on the same device)
with an associated value that defaults to 1. For generating a large
number of GrSemaphores at once it should be possible to use the same
MTLEvent but with different assigned values.

Bug: skia:8243
Change-Id: Ic7de2d9d295fbe51e67bc7c3c4354257cb0774d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233416
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-08-28 19:38:56 +00:00
Brian Osman
63655b5a21 Pin the GLSL version to be no larger than the GL version
Some Adreno 308 devices have a driver bug where the GLSL version is
higher than the GL version, and attempting to use shaders with that
version triggers an error.

Change-Id: I5c8996e9771983e547ec75e57b04e2584507727f
Bug: https://github.com/flutter/flutter/issues/36130
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237898
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-28 18:37:55 +00:00
Brian Salomon
76556a39ea Alpha8 support cleanup in GrGLCaps.
*Never renderable in ES but always texturable
*glTexStorage2D validity based on GL_EXT_texture_storage extension
*Move workarounds to workaround setup code

Change-Id: Id2b59ed8c65c88fea9e5cb671d34651dfb9b6a11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237814
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-28 18:26:36 +00:00
Andy Weiss
ecd03db1e8 Override operator delete for GrCpuBuffer
GrCpuBuffer allocates extra space for a buffer in Make but using sized
delete will then lead to UB as operator delete is not implemented.

This change overrides the delete operator to force the unsized variant
which gets rid of the UB at the cost of not taking advantage of sized
delete. Once P0722R1 is available to safely compute the full size of
the object inside delete, this code can change to use sized delete.

c.f. https://bugs.chromium.org/p/skia/issues/detail?id=6384
and http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0722r1.html

Change-Id: I8f9172c35d17a5acee777d802dfdb25f031868b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237847
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-28 16:25:25 +00:00
Herb Derby
a4c7883c56 Cleanups around fRemoteGlyphStateMap
* Rename fRemoteGlyphStateMap -> fDescTorRemoteStrike
* Move map operations to be local
* Other cleanups

Change-Id: Ia5c4309e849d018903623f70595ae7238ceaec8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237496
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-08-28 13:56:35 +00:00
Michael Ludwig
7be971fa3a Fix flutter roll
Flutter extends from the SkCanvasVirtualEnforcer, so the prior change
to onDrawEdgeAAQuad to accept an SkColor4f instead of SkColor broke
their build, the flutter roller, and--transitively--the G3 roller.

This keeps the old onDrawEdgeAAQuad around as a no-op so their
canvas_spy class can extend from it.

TBR=bsalomon@google.com, stani@google.com

Bug: skia:
Change-Id: I3798ec60a21e90c3d3f5d59f19f7dbe62e37cbec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237590
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-28 02:33:22 +00:00
Michael Ludwig
fd849a537a Revert "Combine snapBackImage and snapSpecial"
This reverts commit 45739aa1d8.

Reason for revert: Looks like the magnifier filter doesn't handle subset origins correctly either, not caught by our tests, but does in layout tests.

Original change's description:
> Combine snapBackImage and snapSpecial
> 
> Previously, snapBackImage always made a copy since that is required for
> its use in saveBehind(). Backdrop filters also used snapBackImage because
> it relied on its subset SkIRect argument to avoid using the entire
> layer as input to the backdrop filter. The regular snapSpecial() originally
> did not take a subset at all. The GPU implementations of snapSpecial()
> and snapBackImage() were very similar. This merges them into a single call
> that takes a subset SkIRect and a boolean to control if the copy is required.
> 
> Only saveBehind() requires that the copy is made, due to how it bypasses
> the regular copy-on-write behavior managed by SkCanvas and SkSurface. The
> no-argument saveSpecial() is still provided, but it is defined to just snap
> the bounds of the device.
> 
> Flutter noticed a fairly serious performance regression on iOS that went
> back to this CL: 08b260c27b. It was determined that the only significant change in
> behavior that was active given their minimum working example was switching
> from snapSpecial() to snapBackImage(). Hopefully moving to a snapSpecial that
> takes a subset, but doesn't copy when there is a texture already available
> will restore the performance.
> 
> Bug: skia:9283, https://github.com/flutter/flutter/issues/36352, https://github.com/flutter/flutter/issues/37541, https://github.com/flutter/flutter/issues/36064
> Change-Id: I448f8886347a1e0f4da8f61279744bb9254f7752
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237127
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com

Change-Id: I7fd897da8a50b2fc0079e2aed9b6ad4bed6d3879
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9283, https://github.com/flutter/flutter/issues/36352, https://github.com/flutter/flutter/issues/37541, https://github.com/flutter/flutter/issues/36064
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237616
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-27 23:56:54 +00:00
Michael Ludwig
a595f86428 Add Color4f variant for DrawEdgeAAQuad
Bug: chromium:795132,chromium:985500
Change-Id: Idbb4d45b29d2c0d0fd54b05b807086ecf0b8cf26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237492
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-27 23:22:32 +00:00
Michael Ludwig
a5fa56e910 Revert "Calculate draw bounds in drawEdgeAAImageSet"
This reverts commit 977b50a7e0.

Reason for revert: Likely broke skia_renderer bots, https://test-results.appspot.com/data/layout_results/linux-rel/177320/vulkan_swiftshader_blink_web_tests%20%28with%20patch%29/layout-test-results/results.html

Original change's description:
> Calculate draw bounds in drawEdgeAAImageSet
> 
> This will allow SkiaRenderer to provide image filters on the SkPaint
> instead of using an explicit saveLayer, where they must calculate the
> draw bounds. Once SkiaRenderer provides filters that way, they will
> automatically take advantage of any implicit layer optimizations we can
> add down the road.
> 
> Bug: skia:9283
> Change-Id: I87adef336a08210d4d015e36c907e893a973947d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237477
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

Change-Id: I99d90f7beae89b509c35649dcfcdf392a47b3415
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9283
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237596
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-27 22:40:34 +00:00
Michael Ludwig
45739aa1d8 Combine snapBackImage and snapSpecial
Previously, snapBackImage always made a copy since that is required for
its use in saveBehind(). Backdrop filters also used snapBackImage because
it relied on its subset SkIRect argument to avoid using the entire
layer as input to the backdrop filter. The regular snapSpecial() originally
did not take a subset at all. The GPU implementations of snapSpecial()
and snapBackImage() were very similar. This merges them into a single call
that takes a subset SkIRect and a boolean to control if the copy is required.

Only saveBehind() requires that the copy is made, due to how it bypasses
the regular copy-on-write behavior managed by SkCanvas and SkSurface. The
no-argument saveSpecial() is still provided, but it is defined to just snap
the bounds of the device.

Flutter noticed a fairly serious performance regression on iOS that went
back to this CL: 08b260c27b. It was determined that the only significant change in
behavior that was active given their minimum working example was switching
from snapSpecial() to snapBackImage(). Hopefully moving to a snapSpecial that
takes a subset, but doesn't copy when there is a texture already available
will restore the performance.

Bug: skia:9283, https://github.com/flutter/flutter/issues/36352, https://github.com/flutter/flutter/issues/37541, https://github.com/flutter/flutter/issues/36064
Change-Id: I448f8886347a1e0f4da8f61279744bb9254f7752
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237127
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-08-27 21:06:31 +00:00
Herb Derby
81578856e9 Check RemoteStrike pointer is still valid to send
Check to make sure that the RemoteStrike pointer from
RemoteStrikesToSend is still in the RemoteGlyphStateMap
in debug mode.

Change-Id: Id992a5190a161499792247c9f6dd0d46a4552db0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237489
Auto-Submit: Herb Derby <herb@google.com>
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
2019-08-27 20:15:59 +00:00
Ben Wagner
c17de1d2b7 Add a way to disable baseline snapping.
Skia has traditionally snapped horizontal and vertical baslines to
pixels as a kind of baseline hinting. This is a feature which cannot
reliably be implemented from the outside and tends to make static text
better looking by ensuring the baselines are consistent. However, with
animation like scrolling or flying and resizing text the animation
suffers. Allow the user to disable the baseline snapping.

Change-Id: I6ee1c12a07242d10c08ae4b75c73e4e28c860790
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237124
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-08-27 19:54:29 +00:00
Greg Daniel
dcf9ca1820 Have visitProxies take a GrTexutreProxy instead of GrSurfaceProxy.
Change-Id: Ic1508d7909c90298fdb906391f981505c3ed497e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237485
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-08-27 19:07:27 +00:00
Michael Ludwig
977b50a7e0 Calculate draw bounds in drawEdgeAAImageSet
This will allow SkiaRenderer to provide image filters on the SkPaint
instead of using an explicit saveLayer, where they must calculate the
draw bounds. Once SkiaRenderer provides filters that way, they will
automatically take advantage of any implicit layer optimizations we can
add down the road.

Bug: skia:9283
Change-Id: I87adef336a08210d4d015e36c907e893a973947d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237477
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-27 18:35:18 +00:00
Chris Dalton
6aeb8e84df Add renderTasks to the DAG before calling addDependency
This makes sure the dependent task is already in the DAG before a
textureResolveRenderTask calls "addBeforeLast".

Bug: skia:
Change-Id: Ib276d41c386fd3d5a237212d60d7bf67a662e419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237257
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-08-27 18:24:27 +00:00
Greg Daniel
674ee74e88 Make sure we use clear load op on GrOpsTask as often as possible.
With this change we are also removing the code in the Gr*OpsRenderPass which
will dynamically change the load op for given clear calls. The load is is
set at creation time.

Change-Id: I19f0f37bb38f790b11052953106e0492e6f9fc87
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237425
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-08-27 17:47:21 +00:00
Michael Ludwig
ea6fb83931 Fix subset errors in blur, matrix, and morphology filters
Encountered these errors previously, but did not recognize their cause
(see negative marked GM_imagemakewithfilter_crop results on gold). They
came up again when working on fixing snapBackImage() to avoid a copy,
which increased the likelihood of an input image with non-zero origin.

These changes fix the matrix convolution and morphology errors in that
GM so that it now matches the non-crop cases. These had been special
because the last row in that GM didn't require calling applyCropRectAndPad,
so it actually processed an image with a non-zero origin.

The blur fix was discovered when evaluating a blur with a sufficiently
large enough sigma that it needed to be decimated over multiple iterations.
In that case, the second iteration uses a new input proxy so it shouldn't
offset the source coordinates any more.

Change-Id: I7d51025140342c93ca798ca0708c8675ab411beb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237125
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-27 17:05:47 +00:00
Mike Klein
334a642b20 remove unused sk_sp comparison operators
These unused comparison operators are the only users of
<functional> in SkRefCnt.h, for std::less.  <functional>
is an expensive header to compile, and SkRefCnt.h is popular,
so it helps to cut dependencies like this.

Mostly we just need to add #include <functional> in a few
places that were picking it up via SkRefCnt.h.

In SkPixmapPriv.h, it looked simpler to template the argument,
since everything was inline anyway.

Change-Id: I7c125bb26a04199847357c729a1b178256c6ef8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236942
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-08-27 14:52:01 +00:00
Michael Ludwig
e2cbd947b7 Fix long line
Change-Id: Ib7796c8a8455bf3454a7982fa9cd7e624160c4e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237126
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-27 14:36:01 +00:00
Michael Ludwig
f010089975 Revert "gpu: Update GrGLCaps usage of fTextureRectangle with chromium."
This reverts commit c43ab22a8c.

Reason for revert: crbug.com/998038

Original change's description:
> gpu: Update GrGLCaps usage of fTextureRectangle with chromium.
> 
> R=​bsalomon@google.com
> 
> Bug:900706
> Change-Id: I0ca0062f12f905c47e9f096acf675b93f131e390
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234990
> Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,khushalsagar@chromium.org

Change-Id: Iebdaed117229987f23ec1b1ad48ec6719972ad95
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 900706
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237431
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-27 14:30:12 +00:00
Mike Klein
48e08aa973 <ostream> -> <iosfwd>
<ostream> is one of the more expensive headers to include
and that's amplified by SkRefCnt.h's popularity.

We've been including <ostream> for sk_sp's operator<<.  That's only
used by Chromium and while we could just sprinkle in a bunch of .get()
calls and remove operator<<, when I started going through and actually
doing that I got the feeling I was making things pointlessly harder to
read and write, and wanted to find a way to make it actually work.

My next instinct was to template it without mentioning ostreams,

    template <typename OS, typename T>
    auto operator<<(OS& os, const sk_sp<T>& sp) -> decltype(os << sp.get()) {
        return os << sp.get();
    }

but that makes this operator<< ambiguous with some other templated operator<<
in GTest.  They got in first, so they win...

So ultimately, switch <ostream> to <iosfwd>.   Anyone using our
operator<<() presumably has <ostream> included already, and the #include
cost for <iosfwd> is small enough that I don't think we'll mind keeping
this around indefinitely.

To repro, look at before/after of -ftime-trace:

    ~/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang++ -I. -Os -c src/core/SkCanvas.cpp -ftime-trace

I have tested locally that Chromium builds with this change.

Change-Id: I9decc2e65b5cc8fd07d8106a5eff81901aedd7d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237190
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-08-27 13:08:56 +00:00
Khushal
c43ab22a8c gpu: Update GrGLCaps usage of fTextureRectangle with chromium.
R=bsalomon@google.com

Bug:900706
Change-Id: I0ca0062f12f905c47e9f096acf675b93f131e390
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234990
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-27 03:12:24 +00:00
Herb Derby
30cd12e814 Track RemoteStrikes to send using pointers instead of descriptors
This reduces the number of map lookups that need to happen.

Change-Id: I068819f2576bf644a5c3550d48e69413e19179d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237217
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2019-08-26 22:10:20 +00:00
Chris Dalton
6f31cc3882 Revert "Initiate MSAA resolves during DAG generation"
This reverts commit 804f6a0fe7.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Initiate MSAA resolves during DAG generation
> 
> Adds an "fIsMSAADirty" flag to GrRenderTargetProxy and switches to
> resolving MSAA in GrTextureResolveRenderTask. This completes our push
> to resolve textures outside of render passes.
> 
> For the time being, we only store a dirty flag on the proxy and still
> rely on the GrRenderTarget itself to track the actual dirty rect. This
> will be followed by a CL that moves the dirty rect out of
> GrRenderTarget and into the proxy.
> 
> Bug: skia:
> Change-Id: I21219a58028bdb4590940210e565133093cd34b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235672
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,csmartdalton@google.com

Change-Id: Ife557caa840edfb64cbcafc272dc3012cfb43702
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237242
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-08-26 20:18:57 +00:00
Stephen White
ef2dc90172 Dawn: update for GrGpuCommandBuffer -> GrOpsRenderPass change.
Change-Id: Ifbe4bcd40bcf316868d23c2edf73b2371c6cb312
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237119
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-08-26 20:05:55 +00:00
Michael Ludwig
14c4486244 Make image filter virtuals private where possible
Trivial protected virtuals that never need to be called by subclasses,
but represent configurable policy for SkImageFilter_Base can be made
private virtuals.

Also mark many of the other protected functions as deprecated to help
show what the planned API surface will be for SkImageFilter_Base.

Bug: skia:9295
Change-Id: I3955c3cee1ee7426edd79b12e36a751bc14b87af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234656
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-26 19:19:31 +00:00
Chong Zhang
ea68eacd1a heif: Update to actual frame duration when the frame is decoded
bug: 139815242
test: test some 25fps files, and with local logs, duration should
      show 40ms instead of the default 33ms.

Change-Id: Ibd10bda17634b1337349bfc9f69757f569d35972
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237205
Commit-Queue: Chong Zhang <chz@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Chong Zhang <chz@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2019-08-26 18:56:21 +00:00
Chris Dalton
804f6a0fe7 Initiate MSAA resolves during DAG generation
Adds an "fIsMSAADirty" flag to GrRenderTargetProxy and switches to
resolving MSAA in GrTextureResolveRenderTask. This completes our push
to resolve textures outside of render passes.

For the time being, we only store a dirty flag on the proxy and still
rely on the GrRenderTarget itself to track the actual dirty rect. This
will be followed by a CL that moves the dirty rect out of
GrRenderTarget and into the proxy.

Bug: skia:
Change-Id: I21219a58028bdb4590940210e565133093cd34b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235672
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-26 18:36:53 +00:00
Ben Wagner
11eae3d233 Basic changes to get XPS drawing text.
Basic maintenance to get basic things working. Most of the motivation is
to use better ownership and iteration patterns.

Change-Id: If8ffe0c7b2bddd55259ac8fa119fc9e233b9249d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236616
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-08-26 16:20:44 +00:00
Michael Ludwig
ea07123fed Define Usage and image+origin wrapper for image filters
Bug: skia:9282
Change-Id: I4f00c8a608ab4ce9557228d162c205bcc2002a3c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234583
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-26 15:50:14 +00:00
Greg Daniel
2d41d0d363 Remove GrGpuTextureCommandBuffer class and rename to GrOpsRenderPass.
Change-Id: Ia6e666a7bb986bb3dc769d25919580bca17b4748
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236556
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-26 15:34:14 +00:00
Mike Reed
3012cbaa20 remove unneeded noemptycheck variants of intersect
The existing intersect logic already fails if either argument is empty,
without performing any extra checks.

Change-Id: I4cc4f1e63af7efbed4e1084284c1607c104ff361
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237142
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-26 15:03:44 +00:00
Herb Derby
ff379423c1 Rename SkGlyphCacheState -> RemoteStrike
Change-Id: I30a7fe759d367d518f3de78043b43ca4738a1ccb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237143
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-08-26 14:59:44 +00:00
Mike Reed
92b33354dd more rect api simplifications
set --> setLTRB
set(pts, count) --> setBounds

Bug: skia:9328
Change-Id: I807c0598a8b23b2f721db118ec41c1607114205a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237038
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-08-25 10:12:57 +00:00
Stephen White
e8a2c8053d Dawn: update to recent GrGpu/CopySurface changes.
Move all GrSurface copying to GrDawnGpu (refactoring
getDawnTextureFromSurface out of existing code).

Change-Id: I7d18530f6c32d224db1af2719d9d8fc59e755451
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236916
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-23 19:44:28 +00:00
Greg Daniel
9313874349 Rename GrContextOption fReduceOpListSplitting to fReduceOpsTaskSplitting.
Change-Id: Ieba56fa4c4926fc0a118d84950fa1eb78a48a29e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236576
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2019-08-23 18:43:27 +00:00
Mike Klein
359f61b101 track SkNoPixelsDevice's origin
Today we do a fairly decent job of tracking device bounds as an SkIRect,
with a little more of that plumbed through here, but that gets foiled in
SkNoPixelsDevice's constructor where we only look at bounds.width() and
bounds.height().

I think the idea was to follow the usual constraint that a "base" layer
has an origin at (0,0) and only temporary "save" layers on top might be
offset, but for a device without any pixels it's pretty reasonable for
the base layer to be offset too.

This makes picture_cull_rect draw correctly in serialize-8888 mode.

Bug: skia:9334
Change-Id: I845e74779bb21cbfd4051b0ef07381e684176eac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236859
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-08-23 17:52:18 +00:00
Mike Reed
9ea6315692 remove redundant rect methods
Bug: skia:9328
Change-Id: Idc20e125a4a4725c88e291b49e33cc56805836ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235832
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-08-23 17:49:27 +00:00
Stephen White
b7eaedcfcc Dawn: implement a ring buffer for uniform uploads.
GrDawnGpu vends ring buffer slices out of a persistent (larger) buffer.

GrDawnProgramDataManager::setData() now returns a BindGroup containing
the (possibly new) UBO bindings, as well as the texture and sampler
bindings.
Change-Id: Id6694d6f44a815cfbffe4293779bf9bf558a2365
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235866
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-08-23 17:42:47 +00:00
Chris Dalton
c4b4735a09 Don't pass around renderTargetContexts from onFlush callbacks
The drawing manager was just grabbing an opsTask off of these contexts
anyway. Instead, the onFlushResourceProvider can just snag an opsTask
off the renderTargetContext and populate the drawing manager's list of
onFlushRenderTasks.

Bug: skia:
Change-Id: I3bdb48176364bbd6e5a34fab437c45ed77d6687f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236760
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-23 17:34:16 +00:00
Mike Reed
0f15d7373b optimize verts
Take advantage of the new virtual on SkShaderBase : appendStagesWithUpdater

If our shader supports that, we can draw each triangle without having to
recreate the entire pipeline/blitter.

This change produces 3 different loops:

tricolor only : uses private backdoor to update colors per triangle
has updater   : uses updater to update ctm per triangle
general       : rebuilds pipeline/blitter on each triangle

In a follow-up, we may be able to plumb updater through to other shaders
(other than image), which would have us land in the updater case more
often.

Before
    728.09  	verts_textures_colors	8888
    167.48 ?	verts_colors	8888
    510.17  	verts_textures	8888

After
    729.61  	verts_textures_colors	8888
    168.80  	verts_colors	8888
    219.58  	verts_textures	8888

Change-Id: I87a6e6dc23dfba3377d6f9a54818fe6b8d349018
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235801
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-08-23 15:34:19 +00:00
Herb Derby
5e8f7c449c Revert "Don't send strike with no pending glyphs"
This reverts commit 9e081d164c.

Reason for revert: Spike in cache misses: chromium:996636

BUG=chromium:996636

Original change's description:
> Don't send strike with no pending glyphs
>
> This changes tracks the strikes to send as a set of pointers
> to SkGlyphCacheState instead of as descriptors. This removes a descriptor
> lookup allowing rapid calculation of the actual number of strikes to send.
> Knowing the number of strikes with changes allows us to remove sending a boolean
> if strike has no pending glyphs.
>
> Change-Id: Id173336e238daebc19564248a818eb9dbdbe6db6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235827
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=mtklein@google.com,herb@google.com,khushalsagar@chromium.org,khushalsagar@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I0e0c8877be8d08be4b62a029005889068b6e4cc3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236351
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-08-22 21:11:57 +00:00
Greg Daniel
f41b2bd449 Reland "Merge GrOpList and GrRTOpList and rename to GrOpsTask."
This reverts commit f21bf9e50b.

Reason for revert: relanding with infra fix

Original change's description:
> Revert "Merge GrOpList and GrRTOpList and rename to GrOpsTask."
>
> This reverts commit 2a5954140b.
>
> Reason for revert: breaking everything
>
> Original change's description:
> > Merge GrOpList and GrRTOpList and rename to GrOpsTask.
> >
> > Change-Id: I8f4f2218a30fd0541a8f79f7bb9850f9500cd243
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236343
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: I27840ea0343e8e6b388556afb7bd2e76386d611d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236349
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Ibd3a06e4a91dbb1f225dcc8d17d0db3967b6f85f
No-Presubmit: true
No-Tree-Checks: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236350
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-08-22 20:52:09 +00:00
Greg Daniel
f21bf9e50b Revert "Merge GrOpList and GrRTOpList and rename to GrOpsTask."
This reverts commit 2a5954140b.

Reason for revert: breaking everything

Original change's description:
> Merge GrOpList and GrRTOpList and rename to GrOpsTask.
> 
> Change-Id: I8f4f2218a30fd0541a8f79f7bb9850f9500cd243
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236343
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: I27840ea0343e8e6b388556afb7bd2e76386d611d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236349
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-08-22 20:12:38 +00:00
Greg Daniel
2a5954140b Merge GrOpList and GrRTOpList and rename to GrOpsTask.
Change-Id: I8f4f2218a30fd0541a8f79f7bb9850f9500cd243
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236343
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-22 19:33:01 +00:00
Florin Malita
3f412f9fe2 [svgcanvas] Named colors support
Use color shorthands instead of rgb(x,y,z).

Change-Id: Id77d466debe74b90f9b35cbe1dfd1d38718e8d29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236341
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-08-22 18:10:50 +00:00
Greg Daniel
5abfff229c Delete unused GrTextureOpList.
In a follow up CL I will be merging GrRenderTargetOpList and GrOpList
since we no longer have need for that separation.

Change-Id: I267ead3beeceaece504968ca69165c425d38f761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236337
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-08-22 18:06:22 +00:00
Chris Dalton
2243c7b33b Don't perform dst reads on MSAA targets that require manual resolve
This kind of defeats the purpose of the original intent, which was to
read from the dst without doing a copy. If the target requires a
manual resolve, then we will do an internal copy anyway to resolve
MSAA. And furthermore, we end up resolving the entire render target as
opposed to just copying the op's bounds.

Bug: skia:
Change-Id: I1b4048dc6536853d2c0168c355040f1c3b142736
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236182
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-08-22 17:33:50 +00:00
Leon Scroggins III
2b39cbe861 Remove SK_LEGACY_HEIF_API
Bug: b/78868457
Bug: b/120414514

No longer needed, now that Android has switched over to the new API.

Change-Id: Idd2f2e843311aee11fb8d053e0ad3ccf98e429e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236340
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Chong Zhang <chz@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-08-22 16:28:29 +00:00
Brian Osman
068af9e416 Revert "Temporary Lua hook to measure impact of conservative convexity"
This reverts commit e67133b8e5.

Removing testing code that's no longer needed.

Change-Id: I27bc5c77d1bc1b928d5cdb89daf82ab5fd3878c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236338
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-22 15:07:20 +00:00
Herb Derby
31316e1655 Only send font metrics if not already sent.
Add a field to the SkGlyphCacheState to track if the FontMetrics have
been sent.

BUG=chromium:881505

Change-Id: I8223249d95d68677cf23a1da37d7c04ce5cc8263
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236216
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2019-08-22 03:38:58 +00:00
Brian Salomon
57f211b56a SK_API in src/gpu cleanup
Change-Id: I14d6f7ef06c3cfcefd0813dd5013e4185b12d8cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235804
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-22 02:00:07 +00:00
Florin Malita
49d140dbad [svgcanvas] Add flag to suppress newlines and tabs in XML
Bug: skia:9343
Change-Id: Id82f998ac57fc787aeb4435a6907047ea680d2fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236157
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-08-21 20:17:37 +00:00
Herb Derby
9e081d164c Don't send strike with no pending glyphs
This changes tracks the strikes to send as a set of pointers
to SkGlyphCacheState instead of as descriptors. This removes a descriptor
lookup allowing rapid calculation of the actual number of strikes to send.
Knowing the number of strikes with changes allows us to remove sending a boolean
if strike has no pending glyphs.

Change-Id: Id173336e238daebc19564248a818eb9dbdbe6db6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235827
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2019-08-21 19:22:29 +00:00
Brian Osman
7e16b58b5a SkRuntimeShaderMaker -> SkRuntimeShaderFactory
This refactor makes it work like the runtime color filter, where inputs
can be updated without generating a new shader key every time.

Change-Id: Ic1762aebae96fd8b7a8a74fb200bc02ec08cc029
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235798
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-21 18:22:33 +00:00
Greg Daniel
e227fe4e53 Move CopyOps to CopyRenderTask.
This also means copies are no longer part of OpList or GpuCommandBuffer.

Change-Id: I234de2c93ca13e069d7e4423a3c8b292be2eb500
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235831
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-21 18:22:23 +00:00
Chris Dalton
aa3cbb81b7 Mark mipmaps dirty from makeClosed() rather than opList constructors
Bug: skia:
Change-Id: Ia90877399777134e735ac6328fff629748ef49d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235158
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-21 17:43:33 +00:00
Robert Phillips
e1efd38cf0 Remove GrPendingIOResource
AFAICT these three remaining uses of GrPendingIOResource were just real-ref placeholders (i.e., they just added 1 pending read and then held on to the GrPendingIOResource until object destruction).

Change-Id: Iba6bb199477d846d079999f09794422e240c675a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235458
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-21 17:29:43 +00:00
Chris Dalton
30eea6c87c Convert GrManyDependentsMipMappedTest to a mock gpu test
This allows us to test with fReduceOpListSplitting both enabled and
disabled.

This CL also requires adding basic mipmap support to GrMockGpu.

Bug: skia:
Change-Id: I97ba912a9e5f3b90756c027ac19c003c99c15902
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235996
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-21 16:55:23 +00:00
Florin Malita
05bab9a29d [svgcanvas] Don't emit default fill and stroke attributes
Default fill: "black".

Default stroke: "none".

Change-Id: I8069f8c4a852cf43e281b6fdcdc58062637c984b
Bug: skia:9344
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235829
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-08-21 16:43:03 +00:00
Brian Salomon
af696501c6 Fix sk_sp<> for incomplete type build issue
Change-Id: I211b7bc1e6d9dcdb1c74f6b6d28cd67674c059b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235830
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-21 16:21:23 +00:00
Ben Wagner
cd111cdcc5 Simplify gdi handle use with gdi fonts.
More than anything else, this gets rid of a few 'goto's.

Change-Id: Ica28d5653f2ad8fb77d11141e2ae1831787efdfa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235099
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-08-21 16:06:25 +00:00
Brian Salomon
bf6b9795f6 GrSurfaceContext not ref counted.
Also don't specify redundant width/height to SkGpuDevice.

Change-Id: I389df5c4b073c2c05632ba6b7c95b02a22dfaf98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235824
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-21 15:31:23 +00:00
Brian Osman
4be31e2605 Conservatively consider any path with tiny edges to be concave
These are numerically unstable. We've had various complex solutions in
the past (fall back to doubles, additional checks like this one), but
this solution is safer and simpler.

Change-Id: Ibe57a155a2aa604e20960f415b9dc3546ae859a9
Bug: chromium:993330
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235861
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-21 14:47:37 +00:00
Robert Phillips
80bff5b3a2 Remove GrProxyPendingIO
Change-Id: I9cf40f0518673206c6304e3f386dd75c9a44f269
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235865
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-21 12:09:54 +00:00
Herb Derby
362a1e0fab Move SK_API from the class to the methods
Change-Id: Ifd49e6cc8c9900b98125e59cf2e69aa4e28c25e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235864
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-08-21 10:20:09 +00:00
Ben Wagner
0b9801eadc Use void(void*) instead of decltype with sk_free.
Unfortunately, boringssl also declares a function named sk_free making
decltype give an error since the function is overloaded if both Skia and
BoringSSL headers are included in the same TU (as happens in ChromeOS
builds). In theory one can use decltype and specify which overload to
use, but this is far more verbose than just specifying the type.

Change-Id: I7dfefbce0a75c7ff6791b58287f26f2cc47c8eca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235828
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-08-20 22:28:42 +00:00
Stephen White
7a2930a108 Dawn: moar textures.
Implement onWrapRenderableBackendTexture(). This required render target
support in GrDawnTexture::Wrap().
Implement onWrapBackendRenderTarget().
Implement [create|delete]TestingOnlyBackendRenderTarget().
Implement deleteTestingOnlyBackendTexture(), isTestingOnlyBackendTexture().
Implement render target support in createTestingOnlyBackendRenderTarget().
Fix GrDawnGpu::onReadPixels() for the render target case.

Change-Id: I0f987d6dc08acc791cacc592d3ccf2568ca0f976
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235098
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-08-20 21:40:27 +00:00
Herb Derby
aa3820a912 Remove using Settings for SkTextBlobCacheDiffCanvas
This is change 2/2. Remove the unused Settings structure.

Chrome change:
https://chromium-review.googlesource.com/c/chromium/src/+/1758438

Part 1:
https://skia-review.googlesource.com/c/skia/+/235102

Change-Id: Ib5d2ed1a18ae904c7d1eeffc18b5c69ab04c5f92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235858
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-08-20 21:03:26 +00:00
Christopher Cameron
450ba0a2b2 Increase GrMtlPipelineState caches size by 8x
Users with the Finch trial enabled are seeing slow tab switches due
to MTLRenderPipelineStates being rebuilt.

Bug: chromium:974219 chromium: 988964
Change-Id: I83adf06b7174e9f11a38da421f66a3921d17dbcf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235878
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Christopher Cameron <ccameron@chromium.org>
2019-08-20 20:58:35 +00:00
Ben Wagner
723a877d0c Make SkFunctionWrapper a better wrapper.
SkFunctionWrapper was made to be a simple abstraction over existing
resource release functions which generally follow a specific pattern of
returning void and taking a pointer to the underlying type. However,
this has been observed to be an unnecessary limit. This makes it more
generic while also making the call sites a little less brittle.

This change also uncovered an issue in msvc v19.20 to v19.22, see
https://developercommunity.visualstudio.com/content/problem/698192/in-templateusing-decltype-is-void.html
To work around this, several otherwise redundant '&' are used.

There was an attempt to take references to functions instead of pointers
to functions which greatly simplifies the intermediate wrappers.
However, that uncovered another issue in msvc, see
https://developercommunity.visualstudio.com/content/problem/699878/function-to-pointer.html

Change-Id: I54ab945ed9d9cfd0204d4d6650c2fde47cc9e175
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235105
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-08-20 20:31:36 +00:00
Florin Malita
6f1ff9fca1 Faster SkPathEdgeIter
nanobench -m pathiter_edge -q --samples 1000

Before:

    micros   	bench
      7.32 !	pathiter_edge	nonrendering
After:

    micros   	bench
      2.94 !	pathiter_edge	nonrendering


Change-Id: Ic548ad270589ecced855ba101ad241109c0f16ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235800
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-08-20 20:23:25 +00:00
Herb Derby
7ea9bd0a8e Increase the on stack array to reduce memory allocation
Chrome perf is showing a regression in memory. This will
make fewer memory allocations.

BUG=chromium:995743

Change-Id: I8dcc0c4bbee26464df008ec723bf1977e699e790
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235859
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-08-20 19:01:35 +00:00
Greg Daniel
bbfec9db84 Move transferFrom commands from GrOp and into GrRenderTask.
These Ops don't need to go through the GrGpuCommandBuffer.

Change-Id: Ifa9c7d801c97c225989d2542709c89f36ddfdc5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235799
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-20 15:23:03 +00:00
Hal Canary
f8586bdba7 SkBitmap: simplify setPixels()
Change-Id: Ie0b1f3efd4739acce9da96a20352e5aec73697de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235020
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-08-20 14:43:19 +00:00
Brian Salomon
5331e2a3f8 GrRectBlurEffect: approximate piecewise cubic with quintic.
Mali 400 and Quadro P1000 both have ~48% reduction.



Change-Id: Ib61a51355fa3202029dd87d483acb1027f17a7df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235679
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-08-20 13:24:38 +00:00
Mike Reed
5f152f0745 add path-edger; lightweight Iter for edges
4.07  	pathiter_edge	nonrendering
      6.74  	pathiter_raw	nonrendering
      9.16  	pathiter_iter	nonrendering

Change-Id: Id711b342fbac6b4efd62ce918cf440b04973545c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235476
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-19 21:58:37 +00:00
Herb Derby
154340ba14 Use bulk API for bitmap glyph drawing
Using prepareForDrawing was overkill for this bitmap drawing, and it
can use the simpler bulk api. Additionally, simplify  prepareForDrawing
by removing the handle of the bitmap special case.

Change-Id: I09b2d71de28a1a50590265594aaf94593f001336
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235597
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-08-19 21:20:06 +00:00
Chris Dalton
0d6f77537a Add GrvkGpuRTCommandBuffer::appendSampledTexture
This separates the non-msaa-non-mipmap stuff out of
prepareSampledImage. It will be followed immediately by a CL that
finishes moving msaa resolve into a GrRenderTask and then deletes
prepareSampledImage.

Also, we no long call sk_ref_sp when adding the dstTexture. It appears
than many things have changed at this point, and this extra ref no
longer has any effect.

Bug: skia:
Change-Id: I0e390c57ab31f3aeaaa2aa99396b42fd7b1b000d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235652
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-08-19 20:19:07 +00:00
Brian Osman
e67133b8e5 Temporary Lua hook to measure impact of conservative convexity
Change-Id: I3be1a4d402a3a7adc6a28d716302d3c9f9316b14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235676
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-19 19:45:37 +00:00
Robert Phillips
eb3eb98eb6 Add textureReleaseProc and releaseContext to SkImage factory functions
Specifically:
 MakeFromYUVATexturesCopyWithExternalBackend
 MakeFromNV12TexturesCopyWithExternalBackend

Change-Id: I41c16eb87e1a8fe9ec1fb4b7e6995e07374bb62c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235600
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-19 19:08:07 +00:00
Chris Dalton
3f7932e733 Add kRequiresManualMSAAResolve to GrInternalSurfaceFlags
We will use this flag to check whether a proxy needs manual msaa
resolve, and if so, install a render task to do just that when it is
dirty and about to be read from.

For the time being, we are leaving GrRenderTarget::getResovleType in
place. This will allow us to assert that requiresManualMSAAResolve
works as expected. Long term, we plan to delete the former in favor of
the latter.

Bug: skia:
Change-Id: I155fa2a6d876edd339232c7c8208015d5da2c8ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234436
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-19 15:04:30 +00:00
Greg Daniel
f8221786d0 Remove incorrect metal assert.
Change-Id: I89d5ba22c4f07c88efe7c79c9a51352f3393fb57
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235596
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-19 13:50:59 +00:00
Mike Reed
9318a6cfbc build custom blitter for drawAtlas
- add uniform_color_dst stage
- add stageupdate option for shaders

More cases we could try to handle in the future:
- perspective (not hard)
- mipmaps (plumbing is there, need to re-call bitmapstate helper)

Before

  10025.60  	drawAtlas_3	8888
   6636.06  	drawAtlas_2	8888

After

   3566.18  	drawAtlas_3	8888
   2585.83 ?	drawAtlas_2	8888

Change-Id: I656231324c0390029f6d08941c4f9d11ccdb8e87
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233061
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-08-17 01:48:28 +00:00