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>
Use that to add support for sk_FragCoord in SkRuntimeEffect.
Change-Id: I587ad97057c13ec8a4052c7c20f655eae88786ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298504
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:10370
In android_ndk_windows/create.py, remove the code to remove a directory.
This directory did not exist when I ran the script, leading to an
Exception.
Change-Id: I91aad3ff3738af99d425d334a11b6c60765e1c11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298501
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
With recent fixes many of these tests can be re-enabled, and one is
failing on both GPUs now.
Bug: skia:9935
Change-Id: I75b2b0802a73e326998846285b343e9d3d6980af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298411
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Change-Id: Ic80aa28cd25696a0978d716688d9351935206d41
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298499
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Make shared routines, which will not need to acquire the mutex,
internal so they can be shared by API routines that acquire the mutex.
Change-Id: Ic50d73affdc1e71871ea1eacb12b2e134daff3ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298410
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
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>
This was supposed to go in the previous CL, but patchsets are hard.
Change-Id: I9c479e547bc3f206bb2225ca54b25c52b9483960
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298407
Reviewed-by: Kevin Lubick <kjlubick@google.com>
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>
This is a reland of f58d19a51b
Original change's description:
> Reland "Fill in GrD3DGpu::onUpdateBackendTexture"
>
> This is a reland of 5a967f593c
>
> Original change's description:
> > Fill in GrD3DGpu::onUpdateBackendTexture
> >
> > Change-Id: I83268cf9daf62c0bab831cf5340b85f31cc941b0
> > Bug: skia:9935
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295834
> > Commit-Queue: Jim Van Verth <jvanverth@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
>
> Bug: skia:9935
> Change-Id: I3c1eb65a7a734cc0169cd3d0d77d1d20126107a5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298119
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:9935
Change-Id: I34d9ba973681b53e03eef8b932dfd3a209281f27
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298356
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Functionally this CL changes no behavior--this just reduces the number
of separate GrFragmentProcessor variables we are moving around and
consolidates a few invocations of `addColorFragmentProcessor` into one.
The resultant tree of FPs is unchanged.
The eventual goal is to consolidate all GrPaint-created FPs into the
`paintFP`. In followup CLs, we will continue to thread `paintFP`
further down the function; e.g. `SkColorFilter` should take `paintFP`
as an inputFP.
Change-Id: I47db14b5bc88ab0e25360091b2d40685d9c27df6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298344
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Add SkPDF::AttributeList::appendNodeIdArray so that clients
don't need to re-implement/duplicate NodeIdToString in order to
add attributes that express the relationship between nodes.
Follow-up to:
https://chromium-review.googlesource.com/c/chromium/src/+/2251058
This deletes appendNameArray and appendStringArray since there's
no immediate need for them, but we may add them back if needed.
Bug: chromium:607777
Change-Id: If9b1527f97c7b52bb1bdad3c0828067bb76f25f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297277
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Try to merge change 296417 again with new changes to skottie BUILD in google3
This time, the autoroller shouldn't get upset.
move setupSkiaLibraryBuild call to new lib module
Move shared skottie files we intend to distribute into a library module
Change-Id: I3a86ec611cb38e1940033b60d607fabe6a4b24e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297842
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
All image filters are now implemented entirely on the GPU, so we never
need to read back the contents of a texture-backed special image.
Bug: skia:10202
Change-Id: I9e814d4bccde1e638f7bfc27b140e010ddcbcdb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298138
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This reverts commit 6499e7fb4c.
Reason for revert: G3 roll
Original change's description:
> [skottie] skottie_tool updates
>
> 1) plumb a precomp interceptor to support nested animations, following
> the same naming pattern as viewer and dm
>
> 2) clear background with white instead of transparent, to match other
> tools
>
> TBR=
> Change-Id: Ic1d1f8c6493a3ca98a9b75f5e2aa2230a46f54d9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298139
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@google.com>
TBR=fmalita@chromium.org,fmalita@google.com
Change-Id: Ibd320e9f7f30004e80ff4d2b2012a18703910842
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298337
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
This reverts commit f58d19a51b.
Reason for revert: Still hanging GPU
Original change's description:
> Reland "Fill in GrD3DGpu::onUpdateBackendTexture"
>
> This is a reland of 5a967f593c
>
> Original change's description:
> > Fill in GrD3DGpu::onUpdateBackendTexture
> >
> > Change-Id: I83268cf9daf62c0bab831cf5340b85f31cc941b0
> > Bug: skia:9935
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295834
> > Commit-Queue: Jim Van Verth <jvanverth@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
>
> Bug: skia:9935
> Change-Id: I3c1eb65a7a734cc0169cd3d0d77d1d20126107a5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298119
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=egdaniel@google.com,jvanverth@google.com
Change-Id: I161ccaec1d83d385e73f0633b51577c8ef859364
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298296
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Without this change, the following unit test failures would occur:
StringTest.cpp:425 [String_resize_grow]
StringTest.cpp:435 [String_resize_after_assignment]
StringTest.cpp:438 [String_resize_after_assignment]
StringTest.cpp:444 [String_resize_after_copy_construction]
StringTest.cpp:446 [String_resize_after_copy_construction]
Change-Id: Ib4f63d51604e55d32f1049136b733ee905b72039
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298217
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This is a reland of 5a967f593c
Original change's description:
> Fill in GrD3DGpu::onUpdateBackendTexture
>
> Change-Id: I83268cf9daf62c0bab831cf5340b85f31cc941b0
> Bug: skia:9935
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295834
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:9935
Change-Id: I3c1eb65a7a734cc0169cd3d0d77d1d20126107a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298119
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
1) plumb a precomp interceptor to support nested animations, following
the same naming pattern as viewer and dm
2) clear background with white instead of transparent, to match other
tools
TBR=
Change-Id: Ic1d1f8c6493a3ca98a9b75f5e2aa2230a46f54d9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298139
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Bug: skia:10396
Change-Id: I0c117ab4d95737b76dec5bce16103b9058218fb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297065
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Serialization of typefaces for SK_PICT_TYPEFACE_TAG already have support
for custom serialization via SkSerialProcs.fTypefaceProc. This adds the
mirror side of that, to make use of SkDeserialProcs.fTypefaceProc when
it is provided.
Bug: chromium:1044996
Change-Id: I58f7f43e2668d0ca1d0821551f9ca034975ed199
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297617
Reviewed-by: Alan Screen <awscreen@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This helps to diagnose errors in DM tests.
Change-Id: Ib585e6e78c1d0a03493befe970558e6f9c9731a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298136
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
Implement using fixed size records and stdlib binary search.
1063 bytes object size increase:
before
text data bss dec hex filename
2589 0 0 2589 a1d out/Release/obj/src/utils/libskia.SkParseColor.o
after
text data bss dec hex filename
2112 1540 0 3652 e44 out/Release/obj/src/utils/libskia.SkParseColor.o
Bug: oss-fuzz:23595
Change-Id: Ic875345a05ab0916e0873e35bee6727472a2458c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298068
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>