Have gpu yuv code speak in views.
Bug: skia:9556
Change-Id: Iaa071d53248dfcd6d9e1bd88b24c8b39e133ced2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269148
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrYUVProvider.cpp b/src/gpu/GrYUVProvider.cpp
index 3b5e5d8..26074ac 100644
--- a/src/gpu/GrYUVProvider.cpp
+++ b/src/gpu/GrYUVProvider.cpp
@@ -120,7 +120,7 @@
return {};
}
- sk_sp<GrTextureProxy> yuvTextureProxies[SkYUVASizeInfo::kMaxCount];
+ GrSurfaceProxyView yuvViews[SkYUVASizeInfo::kMaxCount];
for (int i = 0; i < SkYUVASizeInfo::kMaxCount; ++i) {
if (yuvSizeInfo.fSizes[i].isEmpty()) {
SkASSERT(!yuvSizeInfo.fWidthBytes[i]);
@@ -153,14 +153,13 @@
bitmap.setImmutable();
GrBitmapTextureMaker maker(ctx, bitmap, GrBitmapTextureMaker::Cached::kNo, fit);
- auto[view, grCT] = maker.view(GrMipMapped::kNo);
- yuvTextureProxies[i] = view.asTextureProxyRef();
+ std::tie(yuvViews[i], std::ignore) = maker.view(GrMipMapped::kNo);
- if (!yuvTextureProxies[i]) {
+ if (!yuvViews[i]) {
return {};
}
- SkASSERT(yuvTextureProxies[i]->dimensions() == yuvSizeInfo.fSizes[i]);
+ SkASSERT(yuvViews[i].proxy()->dimensions() == yuvSizeInfo.fSizes[i]);
}
// TODO: investigate preallocating mip maps here
@@ -173,7 +172,7 @@
GrPaint paint;
const auto& caps = *ctx->priv().caps();
- auto yuvToRgbProcessor = GrYUVtoRGBEffect::Make(yuvTextureProxies, yuvaIndices, yuvColorSpace,
+ auto yuvToRgbProcessor = GrYUVtoRGBEffect::Make(yuvViews, yuvaIndices, yuvColorSpace,
GrSamplerState::Filter::kNearest, caps);
paint.addColorFragmentProcessor(std::move(yuvToRgbProcessor));