Add a PixelFormat struct and use it to load/gather_unorm(). This handles
loading all pixel formats that are unorm and can fit in 32 bits, with
float and larger formats to follow. That means this adds SkVMBlitter
support for reading A8, G8, 4444, R8G8, A16_unorm, and R16G16_unorm.
Next step will do the same for stores, allowing arbitrary destinations.
Change-Id: Iabbf6171ee6d5abb44cf131eda6647980767c396
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302252
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
-Adds main comment
-Simplify constructor
-Avoid running trivial destructors (maybe compilers would know to remove the entire loop, but this helps make that clearer).
Change-Id: I3825ef21c0d74933df54ca4f532492e5c997f0e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302642
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This is a reland of 36132b2aea
Original change's description:
> rename MakePath to Make
>
> Change-Id: Ibdee0835308401fce99ff9e4d98486c4808f84a2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302683
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
Change-Id: I36c1c0625af8e9afff34d891995ca7aff8f169bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302896
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Change-Id: Icb34f14d1103a7849813d4b80e7733ba9b743a99
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302638
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
With this change if a backend Gr*Gpu wants to using staging buffers
they just add a generic GrStagingBufferManager member object. This
object can be used to get slices of upload buffers. Then they just need
to implement the virtual for taking ownership of buffers during submit.
We rely on our GrResourceCache to handle caching and reuse of these
buffers.
This change allows us to remove all other virtuals on GrGpu around
managing staging buffers.
Change-Id: I5db9a3c52133978ea89d6c0de440f434fbf91a51
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300226
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Stephen White <senorblanco@google.com>
This reverts commit a56da9ee92.
Reason for revert: UBSAN complains in Vulkan OOPRDDL mode
Original change's description:
> Add a direct context arg to makeColorTypeAndColorSpace
>
> This is part of a larger effort to de-power SkImage and force users to
> specify the GPU context for all new images.
>
> Staging flag landed in Chrome CL 2296632.
>
> Bug: skia:10466
> Change-Id: I6b7bbec10369f7d8ee884dd1bcc234d332c30a6c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302290
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
Change-Id: Ide36bed6966d3d92ad6b8d05f897d22d287b40b1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10466
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302824
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
This reverts commit 36132b2aea.
Reason for revert: Draws so wrong.
Original change's description:
> rename MakePath to Make
>
> Change-Id: Ibdee0835308401fce99ff9e4d98486c4808f84a2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302683
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
TBR=herb@google.com,robertphillips@google.com
Change-Id: I6af8bca927fd791b6b5020b0ac14660e206f640c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302776
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This reverts commit 380fba6e4b.
Reason for revert: try to fix android-pie-arm64-rel for chrome roll
Original change's description:
> remove support for serialized pictures before aug 2019
>
> Change-Id: I9b2a2dbac4110665e06882b9cbbc6f59e6bc0c21
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302397
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=bungeman@google.com,rmistry@google.com,fmalita@chromium.org,reed@google.com,michaelludwig@google.com
Change-Id: Iad0c262b1aaa966cfdb2756737b2460247f830dd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302679
Reviewed-by: Mike Reed <reed@google.com>
This is part of a larger effort to de-power SkImage and force users to
specify the GPU context for all new images.
Staging flag landed in Chrome CL 2296632.
Bug: skia:10466
Change-Id: I6b7bbec10369f7d8ee884dd1bcc234d332c30a6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302290
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
C++ algorithms have largely standardized on a [begin, end) half-open
range, as seen in standard library containers. SkTQSort now adheres to
this model, and takes vec.begin() and vec.end() as its inputs.
To avoid confusion between inclusive and half-open ranges inside the
implementation, internal helper functions now take "left" and "count"
arguments instead of "left"/"right" or "begin"/"end". This avoids any
ambiguity.
(Although performance was not the main goal, this CL appears to
slightly improve our sorting benchmark on my machine.)
Change-Id: I5e96b6730be96cf23d001ee0915c69764b2c024a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302579
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Two related things:
1) SkRuntimeEffect will allow null child shaders when calling
makeshader. This will produce a GrSkSLFP with null FP children.
Fix some code that assumed that children were non-null.
2) Change the input color passed to any children to be the SkSLFP's
input color, rather than the default (white). This lets nullptr
children in runtime effect have the desired behavior (they are the
paint color or similar, depending on context).
Change-Id: Iabffc50b0a893a56403c5240f32a5da6a88d81f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301980
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:10371
Change-Id: I3e5c8b34b7b80fff492de11ec769b33e2be3671c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302577
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Move PathGlyph to GrPathSubRun, and make the array for the path
data directly in the alloc instead of in a vector.
Change-Id: I861cb934e356f526f96e593d25019b00451f77b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302640
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Also don't overwrite YUVA planes unless all succeed.
Removes an unnecessary use case of GrSamplerState::Filter::kMipMap as
the single caller was always assuming mip mapping is in use.
Bug: skia:10344
Change-Id: I2309a364c8ba244f2a220f415835348d0d79ef35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302641
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Split bicubic into separate functions.
Removes usage of null GrSamplerState::Filter to indicate bicubic.
Bug: skia:10344
Change-Id: Ife649ba84afe3a06d7d8fb0d46677ce96fc264dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302636
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
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>