This initial portion of the API should be ready to go. Follow on CLs will add the other entry points.
Change-Id: Ia9c708046ba08b16f9a71558e2bf2c38279abe5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
To fully switch over we need the entry point that uploads data but most of the old call
sites can be switched over now.
Change-Id: I362b1dfde7d88bf8d3f8f90155f53d9ac442a329
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214300
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is just a start. If we like it we can make it more public.
The general idea is to make it easier for clients to fill in the yuvaIndices array for the more esoteric YUV formats (e.g., YUY2).
Change-Id: Ie5684f52c0b2681f00a6b146476e46c71303a4e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214182
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This intended to bring this API more into line with the proposed GrBackendObject API with an eye towards replacing the former with the latter.
TBR=bsalomon@google.com
Change-Id: I4367f03fb10fff788749f21c4843060111a6df1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213220
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This almost gets gms to be iwyu clean. The last bit is around gm.cpp
and the tracing framework and its use of atomic. Will also need a way
of keeping things from regressing, which is difficult due to needing to
do this outside-in.
Change-Id: I1393531e99da8b0f1a29f55c53c86d53f459af7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211593
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
... but keep the apis for now
Bug: skia:4872
Bug: skia:9012
Change-Id: I3a9b0c9194be6897c0e59b7edd972b7218168183
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211343
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Current strategy: everything from the top
Things to look at first are the manual changes:
- added tools/rewrite_includes.py
- removed -Idirectives from BUILD.gn
- various compile.sh simplifications
- tweak tools/embed_resources.py
- update gn/find_headers.py to write paths from the top
- update gn/gn_to_bp.py SkUserConfig.h layout
so that #include "include/config/SkUserConfig.h" always
gets the header we want.
No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
This helps avoid flattening of YUV/A images when drawn with a strict src
rect constraint. SkiaRenderer almost always provides a strict constraint
for their YUV videos.
This adds a GM that replicates the issue in skbug:8959, and adds a GM to
the wacky_yuv set that checks domain clamping across all of the different
formats.
Bug: 8959
Change-Id: I53f531a94f3b63f81d8c3cbe22d868e3356aeabd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207020
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Idea: transition callers to this, so we can later typedef SkColorFilter
and SkShader to the same thing.
Bug: skia:8937
Change-Id: I000c882e11622091aa44c141aa6ddd1216414f46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206685
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Previously calling SkImage::alphaType(), for example, woult call
the virtual SkImage_Base::onImageInfo() which would construct
and return a temporary SkImageInfo. This often meant ref-ing a
SkColorSpace.
Change-Id: I54975a6b20dea5bc84739068df0c81c022a12067
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202711
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This is probably the last wacky YUV format that is easy for us to support.
Change-Id: Id9a4ba595f4e9893e9bd91ac937e08bf1d8559ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/177621
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
sk_tool_utils doesn't really fit the naming convention
the rest of code under tools/ tends to use.
Change-Id: I45326a174101c6eb4b6149e9c742f658f2fd23b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202313
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This utility color space just maps Y to R, U to G and V to B when flattening or accessing the YUV planes. Clients can then add a colorFilter to directly manipulate the YUV values.
This cannot land in Skia until the following CL lands in Chrome:
https://chromium-review.googlesource.com/c/chromium/src/+/1506004 (Update usage of Skia's SkYUVColorSpace enum to allow the addition of a new value)
Change-Id: Id9403ebbd009b45281d4d53fca52f68692d6c69f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198160
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is a reland of f5efa78902
Original change's description:
> Add a GpuGM class for GPU-only tests
>
> Bug: skia:8731
> Change-Id: Ic81f21621c0183bb356601eb663fa1ee334bca55
> Reviewed-on: https://skia-review.googlesource.com/c/189134
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=mtklein@google.com
Bug: skia:8731
Change-Id: Ia322d7e9280b67ebea1edbefc820cae72cd9c3a6
Reviewed-on: https://skia-review.googlesource.com/c/190148
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:8731
Change-Id: Ic81f21621c0183bb356601eb663fa1ee334bca55
Reviewed-on: https://skia-review.googlesource.com/c/189134
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This is a second attempt at https://skia-review.googlesource.com/c/skia/+/182816
This version ensures that SkImage::colorSpace() returns the target after
makeColorSpace has been called (to match user expectations, and match
behavior with lazy images). Given that, the xform is baked into the FP
within the maker, rather than externally (again, this matches the lazy
image behavior).
Additionally, the target color space needs to be taken into account when
flattening into the RGB proxy, and some base-class methods need to use
this->colorSpace() rather than fColorSpace to tag the output.
Added a GM that tests quite a few different scenarios. All images have
makeColorSpace() applied:
- Raster image (for reference)
- yuvImage
- yuvImage->makeSubset()
- yuvImage->makeNonTextureImage()
- readPixels(yuvImage)
All images should look the same as the top row. Verified that they do
match, in both untagged (gl) and tagged (glsrgb) configs.
I think there may still be some cases where we transform too many or too
few times, or incorrectly tag the result of an image operation, but this
is much more correct than before, and should (I hope) address Chrome's
immediate needs.
Bug: skia:8740
Change-Id: I5d501879866861a5ba91240f688d3f95711f7595
Reviewed-on: https://skia-review.googlesource.com/c/189494
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Mechanical. This makes the priv() accessor the same for all the context types.
Change-Id: I40850eb05a33b8d7cc3eabdd42226d24b2ba58aa
Reviewed-on: https://skia-review.googlesource.com/c/189164
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This is a reland of 2232b9ed39
Original change's description:
> Add target SkColorSpace to SkImage_GpuYUVA.
>
> Bug: skia:8868
> Change-Id: I91f58bf88aec14c17ea904adca792e20099c36eb
> Reviewed-on: https://skia-review.googlesource.com/c/182816
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:8668
Change-Id: If41ba39e63b348422afaf6910b03405ef1c2be12
Reviewed-on: https://skia-review.googlesource.com/c/183380
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 2232b9ed39.
Reason for revert: Causing crashes on some ES devices and ANGLE.
Original change's description:
> Add target SkColorSpace to SkImage_GpuYUVA.
>
> Bug: skia:8868
> Change-Id: I91f58bf88aec14c17ea904adca792e20099c36eb
> Reviewed-on: https://skia-review.googlesource.com/c/182816
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=jvanverth@google.com,brianosman@google.com
Change-Id: I61752dbd244c0b4c25578bae08f8da40db6bb514
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8668
Reviewed-on: https://skia-review.googlesource.com/c/183301
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:8868
Change-Id: I91f58bf88aec14c17ea904adca792e20099c36eb
Reviewed-on: https://skia-review.googlesource.com/c/182816
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
for f in $(git grep -l drawSimpleText); do
sed -i 's/wSimpleText(\([[:alnum:]]\), strlen(\1), kUTF8_SkTextEncoding,/wString(\1,/g' "$f"
sed -i 's/wSimpleText(\([[:alnum:]]*\)\.c_str(), \1\.size(), kUTF8_SkTextEncoding,/wString(\1,/g' "$f"
done
git checkout @~ include/core/SkCanvas.h samplecode/SampleCusp.cpp
git cl format
Change-Id: Ibc0c3afd30f86465a645fadb26177d61919f57fd
Reviewed-on: https://skia-review.googlesource.com/c/181561
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Bug: skia:7903
Change-Id: I77346b301777479694b051486d95d720d8fd179f
Reviewed-on: https://skia-review.googlesource.com/c/175360
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:7903
Change-Id: I41ee31ad3657aee372e22ec3e7a0a317e31b2791
Reviewed-on: https://skia-review.googlesource.com/c/171007
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
* Remove more uses of colortype
* Add back SkImage_GpuYUVA::MakeFromYUVATextures
Bug: skia:7903
Change-Id: I3ee119d190db39c128516dbb78db34fe29ba3cce
Reviewed-on: https://skia-review.googlesource.com/c/165943
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:7903
Change-Id: If5acd50711ed8bd4a49efcb93db66fd3d14c8992
Reviewed-on: https://skia-review.googlesource.com/c/164681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:7903
Change-Id: I7301d943b679a4670511b6cf60c594baf615834a
Reviewed-on: https://skia-review.googlesource.com/c/164261
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
* Make sure SkBitmaps created have the correct swizzle
Bug: skia:7903
Change-Id: If062bd144da9d9a65b9b7336a7dcf2f62b02f50a
Reviewed-on: https://skia-review.googlesource.com/c/163884
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
It's possible that we want to ask the generator to generate in a
different colorType, which would break the assumptions later in this
function.
Bug: skia:
Change-Id: I4495e01a8829d017887150aa78998f407df354e4
Reviewed-on: https://skia-review.googlesource.com/c/163886
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:7901
Change-Id: Ic83e9f0c2a493335671fe431ffba6f649812d406
Reviewed-on: https://skia-review.googlesource.com/c/163481
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 0c583af06d.
Reason for revert: DDL is failing
Original change's description:
> Widen internal API to support more complex YUV formats
>
> Bug: skia:7901
> Change-Id: I46fec08711b8b483cf58ccae733e4dc2a9689231
> Reviewed-on: https://skia-review.googlesource.com/c/162280
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com
Change-Id: Ibe3dd7abbce4a3b6afe74c565198dadc61a9f439
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7901
Reviewed-on: https://skia-review.googlesource.com/c/163257
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:7901
Change-Id: I46fec08711b8b483cf58ccae733e4dc2a9689231
Reviewed-on: https://skia-review.googlesource.com/c/162280
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:7903
Change-Id: I91d0abee6baa8e939b9a9b90386b7d13dfe8eece
Reviewed-on: https://skia-review.googlesource.com/c/163222
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This makes GL & Vulkan render the wacky_yuv_formats GM correctly (transparency and all).
Bug: skia:7903
Change-Id: I09cf872beae3fd0fc1c5109b03ca1714ed51ae85
Reviewed-on: https://skia-review.googlesource.com/c/160162
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:7903
Change-Id: Ie7d0135f392b67085a23a59cb469429f9e2b0221
Reviewed-on: https://skia-review.googlesource.com/c/160029
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:7903
Change-Id: I04630ebec37b087423e8305cc1716544fa00a403
Reviewed-on: https://skia-review.googlesource.com/c/160020
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: I7b35dd063c19cacd0022840d17207cbf4bb03cc7
Reviewed-on: https://skia-review.googlesource.com/c/159063
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Change-Id: I3da7c566cdf9256e57ac7e7f30fee18b9c1a144d
Reviewed-on: https://skia-review.googlesource.com/c/159460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:7903
Change-Id: I2399e4aaae6b91914d637ff0e921e04596b52836
Reviewed-on: https://skia-review.googlesource.com/159141
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 412dd56589.
Reason for revert: serialize-8888
Original change's description:
> Add GM for less common YUV formats
>
> Bug: skia:7903
> Change-Id: I0d6e6d6274d66a71aaf24b68b6d9ceb0f2148b68
> Reviewed-on: https://skia-review.googlesource.com/157601
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,robertphillips@google.com
Change-Id: I3c8375244ddee5d12836076793ec78a46cc04450
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7903
Reviewed-on: https://skia-review.googlesource.com/c/159043
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Bug: skia:7903
Change-Id: I0d6e6d6274d66a71aaf24b68b6d9ceb0f2148b68
Reviewed-on: https://skia-review.googlesource.com/157601
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>