Add API for GrSubRun.
Make sure the API presented by GrSubRun works. Use the original
implementation as the first subclass. It's named SkAtlasSubRun for now
even though it handles both path and atlas drawing. The next subclass
will be pulling out paths.
Change-Id: Id9b2feaa2c9ad9214736ff4a9f577d1de4d4212d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302582
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Change-Id: Ib6c065bda7d801f985d11c11fba121ece805f758
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300199
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Stephen White <senorblanco@google.com>
These tiny adapter classes aren't needed, since all of our clients have
support for lambdas.
Change-Id: Ibf22b1fd0adb3707db570432c50720df9c9329e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302581
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
SkTypeface_FreeType uses SkFontData and makeFontData as a way to lazily
create FT_Face objects. Other SkTypeface types do not need this, so
remove it.
Change-Id: I2f2f829deac9f7f6aac06f9ce84f856922d8a861
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299443
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
BufferCopyView's offset/bytesPerRow/rowsPerImage were deprecated in
favour of the aggregated TextureDataLayout member.
Bug: skia:10497
Change-Id: I89c508c1ba9dd8a25222469cdef23549a93cd9a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302580
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
Implements GrD3DGpu::onCreateCompressedTexture and fixes
GrD3DGpu::onUpdateBackendTexture. D3D expects row data for texture
uploads to be aligned to 256 bytes, so any compressed data for smaller
textures needs to be unpacked to this row pitch.
Also uses the non-compressed routines to implement
onUpdateCompressedBackendTexture and onWrapCompressedBackendTexture.
Change-Id: I20fe4a64fa9b14231590f031ef6fdfadff5de256
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302396
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
We now rely on GrTextureEffect and GrBicbicEffect
to determine if shader-based tiling is required.
GrTextureProducer is still responsible for noticing that
the proxy is approximate because GrTextureEffect doesn't
consider that in its basic Make() factory (as opposed to
MakeSubset()).
Change-Id: I8e1aeb9edbcfa73ea0bf80b5256ee1ca21fe9c81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301985
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This simplifies things like ConstantOutputForConstantInput and
invokeChild. It also removes the need for child indices: generated
FPs now directly refer to their children by slot number.
Change-Id: I69bbb042d5d72d21b999256f969c467702d0774d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302436
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Change-Id: If51be35205b40c4a22979a4b49b031126af1dde7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302500
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
In order to stage the transition from GrContext to GrDirectContext, both
of them will have to have the factories for a while.
This CL also removes all internal uses of the old (GrContext) factories.
Change-Id: Ibe1edd0818ea23a0d54257c55f35f12526047ef3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302263
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 70474c1cb0.
Reason for revert: bot build failure
Original change's description:
> Remove custom SkSort algorithms.
>
> SortBench shows that SkTQSort and SkTHeapSort are inferior to std::sort.
> The difference is small on randomized inputs, but quite significant for
> semi-ordered inputs (forward/backward/repeated). There doesn't seem to
> to be any compelling advantage to SkTQSort.
>
> Nanobench results: https://screenshot.googleplex.com/9JOLV1d6Z0u
>
> (These performance numbers are from an optimized build my local machine;
> it's possible that we might see different results on the test bots.)
>
> Change-Id: Iaf19563041547eae7de2953be249129108f093b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302295
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,brianosman@google.com,johnstiles@google.com
Change-Id: I1126dd4cda95716dac225ad32d5b0e5cf3f09421
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302447
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
SortBench shows that SkTQSort and SkTHeapSort are inferior to std::sort.
The difference is small on randomized inputs, but quite significant for
semi-ordered inputs (forward/backward/repeated). There doesn't seem to
to be any compelling advantage to SkTQSort.
Nanobench results: https://screenshot.googleplex.com/9JOLV1d6Z0u
(These performance numbers are from an optimized build my local machine;
it's possible that we might see different results on the test bots.)
Change-Id: Iaf19563041547eae7de2953be249129108f093b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302295
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Change-Id: I6f4409e9e8c6d4a6d71bc41e57dce7417d7788f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302440
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
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>