Have GrTextureProducer return views instead of proxies.
Bug: skia:9556
Change-Id: Ieedb9c48914c637278203d4d462c19b2d85b27d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268396
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp
index fa9b07c..38e4cbb 100644
--- a/src/gpu/SkGpuDevice_drawTexture.cpp
+++ b/src/gpu/SkGpuDevice_drawTexture.cpp
@@ -244,13 +244,13 @@
if (attemptDrawTexture && can_use_draw_texture(paint)) {
// We've done enough checks above to allow us to pass ClampNearest() and not check for
// scaling adjustments.
- auto [proxy, ct] = producer->refTextureProxy(GrMipMapped::kNo);
- if (!proxy) {
+ auto [view, ct] = producer->refTextureProxyView(GrMipMapped::kNo);
+ if (!view.proxy()) {
return;
}
draw_texture(rtc, clip, ctm, paint, src, dst, dstClip, aa, aaFlags, constraint,
- std::move(proxy),
+ view.asTextureProxyRef(),
{ct, producer->alphaType(), sk_ref_sp(producer->colorSpace())});
return;
}
@@ -421,7 +421,10 @@
dstClip, aa, aaFlags, constraint, std::move(proxy), colorInfo);
return;
}
- GrTextureAdjuster adjuster(fContext.get(), std::move(proxy), colorInfo, pinnedUniqueID,
+ GrSurfaceOrigin origin = proxy->origin();
+ GrSwizzle swizzle = proxy->textureSwizzle();
+ GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
+ GrTextureAdjuster adjuster(fContext.get(), std::move(view), colorInfo, pinnedUniqueID,
useDecal);
draw_texture_producer(fContext.get(), fRenderTargetContext.get(), this->clip(), ctm,
paint, &adjuster, src, dst, dstClip, srcToDst, aa, aaFlags,