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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
*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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
<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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>