There seems to be some inconsistency across specs, but GLuint* is the
correct type to use for this array.
TBR=bsalomon@google.com
Bug: skia:10419
Change-Id: I4106b98278850e30e748746159ea4efc05688c0c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302433
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
SkFontData can be phased out now that there is the public
SkFontParameters and SkFontArguments and supporting methods implemented
on all SkTypefaces. After this change onMakeFontData can be moved to the
FreeType backed typeface as an implementation detail.
Change-Id: I26c41ecbbe9d3c6a5bd401e908fef67d325e1770
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299442
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Since exposing subRunList, there is no reason to have the additional API
call for getting the head of the list.
Change-Id: Ib4bf8b7b89484154ad8d576bb5397810628f1a11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302258
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Herb Derby <herb@google.com>
GrContext is going away. These #includes have been letting it slip in
where it shouldn't.
Change-Id: Idbf24aeba4454d272ad3ebc8ea0d75ae4d9e6e10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301978
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Move the only method into it's call site. The regenerate call will
be moved to SubRun in the next CL. The regenerate call will need
different implementations for the different types of SubRun.
Change-Id: I5396790211ea26cb96b23e823bd2c41c6c5cbaa5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302268
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
https://skia-review.googlesource.com/c/skia/+/301920 broke the macos
build by not including the gpu/gl references back in for macos. This
makes the same changes as that CL for the mac.
Change-Id: Iad75355f505ee2942724aa721d3a7753c10ba06e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302329
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Guruji Panda <guruji@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This will allow Flutter to avoid some usages of SkCodec
and have consistent EXIF handling for multi-frame formats
that support EXIF.
Change-Id: I80daee9b00777d88d0a960cc0f0d76da6680e257
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302270
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Dan Field <dnfield@google.com>
Fixes flickering help text
Change-Id: I61159e6946125e9e2ce7be3f8f8f6103473855be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302266
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Empty text blobs can be the result of a singular matrix, or glyphs that
result in empty rects. If the initial matrix is singular, then we
need to regenerate, otherwise keep the cached empty GrTextBlob to
go fast.
We assume that if the text blob is empty, and the initial matrix is not
maps rect to rects, then the matrix is singular.
Bug: skia:10483
Change-Id: I3bea8abe667d3a2435437ad11198ce7553687133
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302296
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Move drawing text as paths to the SubRun in anticipation of producing
a virtual draw() interface.
Change-Id: Iba9f948a8036a955a0205a098279825a72dc95c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302261
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reduces our code size by reusing existing components to perform
the same blend, and generates a shader that should be conceptually
equivalent (although it gives the inliner a bit more work to do).
Change-Id: Ie2203f7613503476fa9d045aba58d9ef39f3ea26
Bug: skia:10457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302264
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reduces our code size by reusing existing components to perform
the same blend, and generates a shader that should be conceptually
equivalent (although it gives the inliner a bit more work to do).
Change-Id: Ie81e8b82d9b9c441533760d4e9f7e149bc0d969d
Bug: skia:10457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302262
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Bug: oss-fuzz:24070
Change-Id: I310e3793e6099f23f93c5feed8dfcd596cecbda7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302257
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
As soon as I started migrating Chrome, this function showed its
public usefulness. It'll keep coming up over and over again.
Change-Id: Ic6fd08af9b64a4c3287e7fedc9cd0e29bbaf837d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302259
Commit-Queue: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
ConstColorProcessor contained three separate InputModes with their own
unique behaviors, but every (non-test) call site simply hardcoded one of
the InputModes.
This change also allows the actual const-color processor to remove the
inputFP entirely; it is never sampled.
The GM slide has been split into three separate slides as well.
Change-Id: I2b77f4eab4d655f06e3704fb6fde8d4f8c70a075
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301987
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
The previous implementation invoked SkPaintToGrPaint to create a
base-layer GrFragmentProcessor, and then manually poked an extra
GrFragmentProcessor onto the GrPaint's color processor stack. This
approach is not compatible with a world where a GrPaint is only allowed
a single GrFragmentProcessor.
Redesigned the test to use a different approach. We now manually create
the base-layer processor, and then create a second ConstColorProcessor
which uses the base layer as an input processor. This composite FP is
then drawn using `sk_gpu_test::test_ops`.
Change-Id: I8a2781549ba3d5aee85a520b9b34a70c0e66093a
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301986
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
First move if_then_else() specializations inline using a
quasi-constexpr-if approach, letting them operate on any types of the
right vector and lane size. We can't use constexpr-if per se because
this header is sometimes used in C++14 contexts.
Then, add AVX specialization for 8x32-bit types.
SkVM's interpreter uses if_then_else() on three i32x16, and these
changes allow that to vectorize ideally, as two vblendvps instructions.
Change-Id: I8355c47975c736c1fbc32b1f8ceddb772978d271
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302080
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This is part of a larger effort to force users to provide a context
when manipulating GPU images which may be shared, instead of having
images themselves retain powerful context pointers.
Chrome flag landed in Chrome CL 2292800
Bug: skia:10466
Change-Id: Ic530a2c5eb1f4399db899d243ea944760fdf2055
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300707
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This is left over from the GrTextTarget removal.
Change-Id: I371031af5f51187f98aedc4de7dbe6a967d97798
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302256
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
If we're to remove GrContext all uses must go!
Change-Id: I487a973004c4f080fc5802128770b417d54628e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301981
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Makes editing shaders (in the SkSL or Particles slides) tolerable.
Previously, every intermediate state (that didn't compile) would force
you to stop and click back in the code window.
Change-Id: Ibc12b8d697a6b5073e24020daa143a4047a5da31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301984
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
When SubRun is sub classable, makeAtlasTextOp will be part of
the virtual API.
Change-Id: Ib316bca200de38c5aba64e0bef5fa43966e6f13a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301983
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
I was poking through the skvm interpreter and happened to be in Debug
-O1 mode, and noticed that the assembly was filled with the asserts that
these lambdas exist to introduce.
First, I noticed they could be cut down to one condition to check,
SkASSERT((unsigned)thing < (unsigned)limit);
but then I realized, hey, this is what ASAN is for... just drop them!
This cleans up the assembly and emphasizes the more important asserts.
Change-Id: I1e0e69035775887bbf6fb62ca78b4a5721c24504
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302032
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
The fuzzer detected a bug in our handling of null child processors.
Rather than attempt to further tweak a hand-rolled effect, it seemed
more productive to convert it into a full-fledged .fp file. This
provides a very high degree of confidence that the basics are done
properly, for a relatively low amount of effort.
Contrast calculation has also been optimized slightly. The original
shader calculated (1+c/1-c) separately for every pixel. This is now done
once, in Make(). Also, if contrast adjustment is set to zero, the
contrast block is fully omitted.
Change-Id: I2af4708536b249e03c3ebede9b10fc1125eadb7b
Bug: oss-fuzz:24039
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301942
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
The op creation is no self contained, which means that it handles
taking the clip. For random op testing, this means that some times
no op is created for blobs that are entirely off screen. This
results in a nullptr op. The random op test has been adjust accordingly.
Change-Id: I619ffb315b7ad7c834b3e85d7120fe2cdb90c56a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301583
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Null children are becoming more common, so this centralizes the logic
that's currently handled via code-gen and manual checks.
Change-Id: Id8f4f4219b02690c2071ac29b36926dd50da23e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301979
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
I spent a little time working on adding the --dylib JIT
mode to Windows where we'd shell out to Clang to make a .dll,
but then I remembered this VTune JIT API.
That dylib approach is nice for working with a wide range
of tools (perf, Instruments, gdb, etc.), but when your only
need is Vtune, this API is actually the best option. You
get your profiler aware of your JIT'd code with way less
overhead than the shell-then-dlopen approach.
If we need to expand to more tools I'll go make the dylib
mode work, but I think this is good enough to make me happy
on Windows for now.
This should look really similar to
https://skia-review.googlesource.com/c/skia/+/255124.
Change-Id: I9e283cdf9bdfeb11c647a2315a7916dc68ef73c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301935
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
onWrapCompressedBackendTexture and onCreateCompressedBackendTexture can
use their non-compressed equivalents, with the addition of a read-only
parameter.
Change-Id: Ia9955fb378597e9460b0a439036154f3952e2057
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301977
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>
This reverts commit 73923522fd.
Reason for revert: breaks Perf-Debian10-EMCC-GCE-CPU-AVX2-wasm-Release-All-Puppeteer_RenderSKP perhaps?
Original change's description:
> Enable effects deserialization except for npm build
>
> Enable skia picture effect deserialization in all flavours of build
> except for "npm" variant. If you don't have effect deserialzation enabled
> then when you try to deserialize a skp into SkPicture using canavskit
> it will simply ignore all the shaders/ effects.
>
> On npm build effects are still being dropped if you use skia picture
> this is being done intentially to not increase the size of canvaskit wasm and
> js files.
>
> https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!searchin/skia-discuss/gradient$20canvaskit%7Csort:date/skia-discuss/hiCxK-VkK4o/i9zO-tm7AQAJ
>
> Change-Id: Iff27f829cd72d23cafaddeade5c37de412f9ce19
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301676
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
TBR=kjlubick@google.com,sunilmur@amazon.com
Change-Id: Ic14bcdbe16761971d685fc088666d02af99b31fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302021
Reviewed-by: Kevin Lubick <kjlubick@google.com>
The .fp effect has support for passing values to a child processor.
Runtime effects do not support passing a color to a processor, which is
needed to properly implement `ArithmeticImageFilterImpl` without relying
on multiple `addColorFragmentProcesor` calls and/or `RunInSeries`.
Change-Id: I47446897f857ce849a8e734ab81ee7aec80734e7
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301657
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This CL is working towards replacing GrContext with the GrDirectContext/
GrRecordingContext pair.
Change-Id: Id4488e1280d76a16c37d58bd8d29fb7f8dde6b1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301940
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Observed semantics:
-- operates on cubic Bezier path representation
-- moves vertices towards the shape center, and control points in the
opposite direction, based on the specified amount
-- the center is determined as the vertex average
-- the amount is specified as a fraction of the transition to center
(0 -> noop, 1 -> fully collapesed to center)
-- negative and extranormal amount values are allowed
(invert direction/extrapolate)
TBR=
Change-Id: I7da81a5fe5cffd0e50bd94e6b448565b0b04ed86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301582
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
This is another step towards replacing GrContext with the
GrDirectContext/GrRecordingContext pair.
Change-Id: I9336799a299e181fd56759f37dfed3da5da5d022
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301856
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Fuchsia platform supports only vulkan. So exclude all gl files and
add vulkan files for building Skia on Fuchsia.
(relanding with build fix)
Change-Id: Id2ba6cb2d25f6a8c52515ef11b88d830a610903d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301920
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>