Connect up YUVA images for testing.
* Fixes isTextureBacked() for SkImage_GpuYUVA
* Hooks in SkImage_GpuYUVA::MakePromiseYUVATexture()
* Pass down plane texture sizes to MakePromiseYUVATexture()
* Move some other methods to SkImage_GpuBase.
Bug: skia:7901
Change-Id: I33d62c16b426abba5830f7168f9f8fd54a0cb093
Reviewed-on: https://skia-review.googlesource.com/c/161149
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/tools/DDLPromiseImageHelper.cpp b/tools/DDLPromiseImageHelper.cpp
index dd97f94..63369cc 100644
--- a/tools/DDLPromiseImageHelper.cpp
+++ b/tools/DDLPromiseImageHelper.cpp
@@ -142,29 +142,29 @@
if (curImage.isYUV()) {
GrBackendFormat backendFormats[4];
void* contexts[4] = { nullptr, nullptr, nullptr, nullptr };
+ SkISize sizes[4];
for (int i = 0; i < 3; ++i) {
const GrBackendTexture& backendTex = curImage.backendTexture(i);
backendFormats[i] = caps->createFormatFromBackendTexture(backendTex);
contexts[i] = curImage.refCallbackContext(i).release();
+ sizes[i].set(curImage.yuvPixmap(i).width(), curImage.yuvPixmap(i).height());
}
SkYUVAIndex yuvaIndices[4] = {
SkYUVAIndex{0, SkColorChannel::kA},
SkYUVAIndex{1, SkColorChannel::kA},
SkYUVAIndex{2, SkColorChannel::kA},
- SkYUVAIndex{-1, SkColorChannel::kA}
+ SkYUVAIndex{-1, SkColorChannel::kA} // TODO: enable this
};
- int tempWidth = curImage.backendTexture(0).width();
- int tempHeight = curImage.backendTexture(0).height();
-
image = recorder->makeYUVAPromiseTexture(curImage.yuvColorSpace(),
backendFormats,
+ sizes,
yuvaIndices,
- tempWidth, //curImage.overallWidth(),
- tempHeight, //curImage.overallHeight(),
+ curImage.overallWidth(),
+ curImage.overallHeight(),
GrSurfaceOrigin::kTopLeft_GrSurfaceOrigin,
curImage.refOverallColorSpace(),
DDLPromiseImageHelper::PromiseImageFulfillProc,