Change-Id: If07ded029ddfe4c1d3cc1a6f206f9aca75fbb8bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295568
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Switch it to use std::string (not SkSL::String). Along these lines,
remove SkSL::String's operator SkString, and instead add an explicit
SkString constructor from std::string.
Other changes aren't strictly necessary, but I wanted to clean up some
of the other SkSL vs. Skia code barriers. VS (since 2015) has had
vsnprintf that conforms to the C99 standard, the only difference with
_vsnprintf is a different (nonstandard) return value for overflowing
calls. Remove the special-case (the only use of SKSL_BUILD_FOR_WIN).
Change-Id: I8826af10c8e78a8d935c601d00b8ae9ba0640041
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298816
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This should be the bulk of the work. The next part is getting it to live
in a common place, and wiring up the callbacks properly.
The callback points are fPurgeMore and fMessageBusID.
Change-Id: Ibabe285ace8a0b6531572b755a6c4f7bd41b1f6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298400
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This removes the kMixed type of SkSL::SampleMatrix. All analysis of FP
sampling due to parent-child relationships is tracked in flags on
GrFragmentProcessor now.
The sample strategy is tracked as follows:
- An FP marks itself as using the local coordinate builtin directly (automatically done for .fp code based on reference to sk_TransformedCoords2D[0]).
- This state propagates up the parent towards the root, marking FPs as using coordinates indirectly. We stop the propagation when we hit a parent FP that explicitly samples the child because it becomes the source of the child's coordinates.
- If that parent references its local coordinates directly, that kicks off its own upwards propagation.
- Being sampled explicitly propagates down to all children, and effectively disables vertex-shader evaluation of transforms.
- A variable matrix automatically marks this flag as well, since it's essentially a shortcut to (matrix expression) * coords.
- The matrix type also propagates down, but right now that's only for whether or not there's perspective.
- This doesn't affect FS coord evaluation since each FP applies its action independently.
- But for VS-promoted transforms, the child's varying may inherit perspective (or other more general matrix types) from the parent and switch from a float2 to a float3.
- A SampleMatrix no longer tracks a base or owner, GrFragmentProcessor exposes its parent FP. An FP's sample matrix is always owned by its immediate parent.
- This means that you can have a hierarchy from root to leaf like: [uniform, none, none, uses local coords], and that leaf will have a SampleMatrix of kNone type. However, because of parent tracking, the coordinate generation can walk up to the root and detect the proper transform expression it needs to produce, and automatically de-duplicate across children.
Currently, all FP's that are explicitly sampled have a signature of (color, float2 coord). FP's that don't use local coords, or whose coords are promoted to a varying have a signature of (color).
- In this case, the shader builder either updates args.fLocalCoords to point to the varying directly, or adds a float2 local to the function body that includes the perspective divide.
GrFragmentProcessor automatically pretends it has an identity coord transform if the FP is marked as referencing the local coord builtin. This allows these FPs to still be processed as part of GrGLSLGeometryProcessor::collectTransforms, but removes the need for FP implementations to declare an identity GrCoordTransform.
- To test this theory, GrTextureEffect and GrSkSLFP no longer have coord transforms explicitly.
- Later CLs can trivially remove them from a lot of the other effects.
- The coord generation should not change because it detects in both cases that the coord transform matrices were identity.
GrGLSLGeometryProcessor's collectTransforms and emitTransformCode has been completely overhauled to recurse up an FP's parent pointers and collect the expressions that affect the result. It de-duplicates expressions between siblings, and is able to produce a single varying for the base local coord (either when there are no intervening transforms, or the root FP needs an explicit coordinate to start off with).
This also adds the fp_sample_chaining GM from Brian, with a few more configurations to fill out the cells.
Bug: skia:10396
Change-Id: I86acc0c34c9f29d6371b34370bee9a18c2acf1c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297868
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit 4621428b04.
Reason for revert: It was not blocking the Chrome roll
Original change's description:
> Revert "Ignore calls to freeGpuResources on abandoned contexts"
>
> This reverts commit ebea6d0133.
>
> Reason for revert: Let's see if this is blocking the Chrome roll
>
> Original change's description:
> > Ignore calls to freeGpuResources on abandoned contexts
> >
> > GPU resources are freed during abandonment and so public calls to this
> > method should be ignored.
> >
> > Bug: skia:10421
> > Change-Id: I18eb3fbd85cc95c1f2663e109237e5e271a95604
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298346
> > Auto-Submit: Adlai Holler <adlai@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,adlai@google.com
>
> Change-Id: Ia49dae6d45deec8a628396fa43499f902691b1d3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10421
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298702
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=robertphillips@google.com,adlai@google.com
# Not skipping CQ checks because this is a reland.
Bug: skia:10421
Change-Id: Ifd169493bdf9d2164519948542fe5e00a63dc7b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298996
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Bug: skia:10207
Change-Id: Ie87d78b12874fb87697fe22856b4a83b9f28dda8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287818
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This value is used to determine if construction of the Sizes succeeded.
At some point, early returns were added to the constructor, causing
serialization code to use an uninitialized value if any of those early
returns triggered.
Bug: oss-fuzz:23697
Change-Id: I65479e30fd6fdf5d5f43dc1ea1247e18d546fa12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298850
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This is a minor optimization for GrTessellatePathOp.cpp.
Bug: skia:10419
Change-Id: Ie9173f0827981aa254075820bee862f13a0ea333
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298902
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This should have been removed already. Everybody can just use
GrTessellationPathRenderer::kMaxResolveLevel instead.
Bug: skia:10419
Change-Id: If38e499ce6f74a7b052219c2cac2a402d3d05d8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298901
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This is a reland of 3b6b747842
Original change's description:
> simplify freeAll
>
> Change-Id: Ie0c396ee0f92bc16933a137270fc1601faf177f5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298403
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
Change-Id: I6cd3f1b4e29682b9bdf555a8046f482890dc8498
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298848
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
1496de215a..6ef0387d58
2020-06-25 syoussefi@chromium.org Vulkan: Fix mipmap generation discarding levels above max
2020-06-25 jdarpinian@chromium.org Fix readBuffer validation
2020-06-24 cclao@google.com Vulkan: Batch vkUpdateDescriptorSets calls
2020-06-24 ianelliott@google.com Vulkan: Fix glBlitFramebuffer() for pre-rotation
2020-06-24 cwallez@chromium.org Suppress TextureTest failure on NVIDIA Shield.
2020-06-24 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from 839704450200 to fbb9dc2cf1af (1 revision)
2020-06-24 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 9167e1e22a46 to eb0a25a189b7 (3 revisions)
2020-06-24 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Loader from 7e8789fe571a to a173c025f8fe (1 revision)
2020-06-24 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from 76ddcca9f3a4 to 45c73d999ed8 (14 revisions)
2020-06-24 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 36b5bb701da9 to 7a1af5878594 (4 revisions)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC lovisolo@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md
Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Bug: None
Tbr: lovisolo@google.com
Test: Test: angle_deqp_gles3_tests --gtest_filter=dEQP.GLES3/functional_fbo_invalidate_\*Test: Test: angle_end2end_tests --gtest_filter=*EGLPreRotationLargeSurfaceTest.OrientedWindowWithBlitFramebuffer
Change-Id: I28aacf7f48178e7374dc2394f82b46af7f240032
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298878
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
This reverts commit f075414d63.
Reason for revert: blocking Chrome roll
Original change's description:
> Be more consistent about calling release procs in SkImage factories
>
> I will follow this up with a Chrome-side CL to fix the call sites of the following factories:
> MakeFromCompressedTexture
> MakeFromTexture
> MakeFromYUVATexturesCopyWithExternalBackend
> MakeFromYUVTexturesCopyWithExternalBackend
> MakeFromNV12TexturesCopyWithExternalBackend
>
> Here is the Chrome-side CL: https://chromium-review.googlesource.com/c/chromium/src/+/2264598/ (Skia's SkImage::Make* factories now guarantee cleanup)
>
> Bug: 1097484
> Change-Id: I65e6ce30c3dd906e2bfede6c8202d7fab5832da3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298751
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
Change-Id: I306e3beb60461c89cc1980f6c7f3ad4900a34c76
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1097484
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298847
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:10424
Change-Id: Ic329b7de3a02034541094cd7b0cb4e458631e26f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298556
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Test now passes.
Change-Id: Iddc4cf3c34655fcc5b25ff3e168f9d637ea3079e
Bug: skia:9123
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298747
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
I will follow this up with a Chrome-side CL to fix the call sites of the following factories:
MakeFromCompressedTexture
MakeFromTexture
MakeFromYUVATexturesCopyWithExternalBackend
MakeFromYUVTexturesCopyWithExternalBackend
MakeFromNV12TexturesCopyWithExternalBackend
Here is the Chrome-side CL: https://chromium-review.googlesource.com/c/chromium/src/+/2264598/ (Skia's SkImage::Make* factories now guarantee cleanup)
Bug: 1097484
Change-Id: I65e6ce30c3dd906e2bfede6c8202d7fab5832da3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298751
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 8ee607cbc1.
Reason for revert: proto extension number collision blocking roll into google
Original change's description:
> Implement Skottie vs Lottie perf tool
>
> Add PerfActivity to Skottie demo app, which can render
> with both Lottie and Skottie players. Create bash script, which
> runs 15 lottie files with both renderers, runs perfetto and
> outputs performance metrics in json files.
>
> Test: ran run_perf.sh and it outpus perf metrics
> Change-Id: Ibc29d3a9dc7bfe79002bf91472e93883d746c03d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296276
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>
TBR=djsollen@google.com,hcm@google.com,stani@google.com
Change-Id: I2de7feadf8ac2a5690c26e4e07b231af62502655
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298680
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
First one worked for me locally, second one should work for bots.
Change-Id: Ib22e3507b910089a2516fab8dd41dfbc22d5862f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298822
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
This reverts commit 7d7cd2b178.
Reason for revert: breaking chrome roll
Original change's description:
> Make glPatchParameteri required when tessellation is supported
>
> Chrome started wrangling this entrypoint in the following CL:
>
> https://chromium-review.googlesource.com/c/chromium/src/+/2253344
>
> Change-Id: Ief4dfb1ddca8d86e0c09dfdc443e01830cb4de20
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298405
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=kjlubick@google.com,csmartdalton@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I569f2a16de156c5b2e819cb2a45ea942ca2cdec7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298819
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This reverts commit 9716414e93.
Reason for revert: clipRRect elision seems to trigger precision issues on Nexus5x, see https://chrome-gpu-gold.skia.org/search?fdiffmax=-1&fref=false&frgbamax=255&frgbamin=0&head=true&include=false&issue=2264837&limit=50&master=false&match=name&metric=combined&neg=false&offset=0&pos=false&query=source_type%3Dchrome-gpu&sort=desc&unt=true
Original change's description:
> Simplify GrClip API
>
> Removes quickContains(SkRect), quickContains(SkRRect), and isRRect().
> Replaces these three functions with preApply() that conservatively
> determines the clip effect up to a single rrect intersection. The major
> motivation for this is the new GrClipStack implementation. preApply()
> and apply() will be able to reuse much more code compared to separating
> the preApply functionality across the older three functions that were
> removed. Additionally, preApply is able to convey more information for
> less work, since it can usually determine being skipped or unclipped while
> determining if the clip is a single rrect.
>
> As part of using this API, the attemptQuadOptimiziation and the equivalent
> rrect optimization are overhauled. Hopefully legibility is improved, and
> the rrect case is now applied outside of the android framework (but with
> tighter AA requirements).
>
> Bug: skia:10205
> Change-Id: I33249dd75a28a611495f87b211cb7ec74ebb7ba4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298506
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
Change-Id: I850cbf92eea9cf5f2db5528a93251f02dbd6fee2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10205
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298753
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
When building application from command line, ensure that your
out file has the args:
ndk="[absolute path to ndk]"
ndk_api="[specific ndk api number]"
Then run:
platform_tools/android/bin/android_build_app -C out/[out dir] [application name]
Change-Id: Ib380e99bf2dc2e6c136388a0653e380c21e180ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298679
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Don't append the RTHeight uniform if we're writing a sksl_synthetic_uniforms block.
Bug: skia:10418
Change-Id: I21600225be837bb60b878e53353be4d40454f475
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298557
Commit-Queue: Stephen White <senorblanco@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Change-Id: I713ebf481dda5264feb3c813f63c6cbe27fd18a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298749
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
SkSpecialImage::MakeFromImage now always produces a GPU-backed
result, if a recording context is passed in. This ensures that
all nodes (including SkImageSource) remain on the GPU, or go
directly there if we've got a GPU-backed skif::Context.
Bug: skia:9825
Bug: skia:10202
Change-Id: If65109d4e97855081998a30ca08947a21a3611c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298678
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: Ia449e2cfd8b1153e7ab1cd7ad1916550aecf55ef
Bug: skia:10428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298744
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Add PerfActivity to Skottie demo app, which can render
with both Lottie and Skottie players. Create bash script, which
runs 15 lottie files with both renderers, runs perfetto and
outputs performance metrics in json files.
Test: ran run_perf.sh and it outpus perf metrics
Change-Id: Ibc29d3a9dc7bfe79002bf91472e93883d746c03d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296276
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
Bug: skia:10370
Change-Id: Iae6515b7e78c7660b4fb9fe32fd969ba563c4517
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298741
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Surfaces to client whether GrContext has seen a GL_OUT_MEMORY,
VK_ERROR_OUT_OF_HOST_MEMORY, or VK_ERROR_OUT_OF_DEVICE_MEMORY error.
Bug: chromium:1093997
Change-Id: I8e9799a0f7d8a74df056629d7d1d07c0d0a0fe30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298216
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: Ia19063f13e74d7dc2f1ead1fad20ad6828a3648d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298742
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
MakeResult will be needed when migrating `asFragmentProcessor` calls.
However, the typename previously could not be forward-declared because
it was a type buried inside a class. Also, the name `MakeResult` seems
too tightly-coupled to the `Make` functions.
The type has been renamed to `GrFPResult` and moved out of
GrFragmentProcessor to allow `asFragmentProcessor` to use it without
actually #including GrFragmentProcessor.
Change-Id: Ic2c701b943aa64e0f922827b60084e58c67bfb8d
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298740
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
I have a more complete fix in the works but this should unblock fm users.
Change-Id: I0af40f801f7d6d8c02b077b2e6b8ff2b875a4ad8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298707
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Removes quickContains(SkRect), quickContains(SkRRect), and isRRect().
Replaces these three functions with preApply() that conservatively
determines the clip effect up to a single rrect intersection. The major
motivation for this is the new GrClipStack implementation. preApply()
and apply() will be able to reuse much more code compared to separating
the preApply functionality across the older three functions that were
removed. Additionally, preApply is able to convey more information for
less work, since it can usually determine being skipped or unclipped while
determining if the clip is a single rrect.
As part of using this API, the attemptQuadOptimiziation and the equivalent
rrect optimization are overhauled. Hopefully legibility is improved, and
the rrect case is now applied outside of the android framework (but with
tighter AA requirements).
Bug: skia:10205
Change-Id: I33249dd75a28a611495f87b211cb7ec74ebb7ba4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298506
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Change-Id: I92b12cba7dbb14c07174a77befd9dfddaec629af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298636
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Change-Id: Id2542457a361963d7052674bc875a66bd59b48d9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298676
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This reverts commit ebea6d0133.
Reason for revert: Let's see if this is blocking the Chrome roll
Original change's description:
> Ignore calls to freeGpuResources on abandoned contexts
>
> GPU resources are freed during abandonment and so public calls to this
> method should be ignored.
>
> Bug: skia:10421
> Change-Id: I18eb3fbd85cc95c1f2663e109237e5e271a95604
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298346
> Auto-Submit: Adlai Holler <adlai@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=robertphillips@google.com,adlai@google.com
Change-Id: Ia49dae6d45deec8a628396fa43499f902691b1d3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10421
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298702
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit d34528c357.
Reason for revert: A handful of bad GM results. Going to try a better version.
Original change's description:
> Remove SkSpecialImage::makeTextureImage
>
> Tweak how SkImageSource works, so that all nodes now remain on the GPU,
> or go directly there if we've got a GPU-backed skif::Context.
>
> Bug: skia:9825
> Bug: skia:10202
> Change-Id: I35471fd41a00a0a9859eff04c26382e9d2d88a7b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298347
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
TBR=robertphillips@google.com,brianosman@google.com,michaelludwig@google.com
Change-Id: I05c884fb3dd1c590def8f400f5090f0381ba67da
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9825, skia:10202
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298716
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:9935
Change-Id: Ibbe25c629988f134b02f337c333a9cfc5c75a7a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298677
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
https://skia-review.googlesource.com/c/skia/+/297896 draws
several paths with over 1000 points (one has ~250k) and
was pretty slow. We already had a way to provide a flat(ish)
array of all the verbs, points and weights mushed together
(although that should be cleaned up to prefer taking a 1d
array).
This adds an additional way to provide multiple verbs,
points, (and optionally weights, if conics are used) to CanvasKit.
This makes things dramatically faster because of batch copying
the values between JS and WASM (or using Malloc).
Additionally, the above CL revealed a need to be able to
use a subsection of a Malloc'd array efficiently. Thus,
I added subarray as a method of the Malloc object, which
can be used effectively as a pointer (i.e. no copying).
Change-Id: I2c1d26b25118fb9949e878b1b519d93efcfa5019
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297841
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>