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/GrAHardwareBufferImageGenerator.cpp b/src/gpu/GrAHardwareBufferImageGenerator.cpp
index 33e482a..78e1cfc 100644
--- a/src/gpu/GrAHardwareBufferImageGenerator.cpp
+++ b/src/gpu/GrAHardwareBufferImageGenerator.cpp
@@ -191,19 +191,20 @@
return GrSurfaceProxyView(std::move(texProxy), fSurfaceOrigin, readSwizzle);
}
-sk_sp<GrTextureProxy> GrAHardwareBufferImageGenerator::onGenerateTexture(
+GrSurfaceProxyView GrAHardwareBufferImageGenerator::onGenerateTexture(
GrRecordingContext* context, const SkImageInfo& info,
const SkIPoint& origin, bool willNeedMipMaps) {
GrSurfaceProxyView texProxyView = this->makeView(context);
if (!texProxyView.proxy()) {
- return nullptr;
+ return {};
}
+ SkASSERT(texProxyView.asTextureProxy());
if (0 == origin.fX && 0 == origin.fY &&
info.width() == this->getInfo().width() && info.height() == this->getInfo().height()) {
// If the caller wants the full texture we're done. The caller will handle making a copy for
// mip maps if that is required.
- return texProxyView.asTextureProxyRef();
+ return texProxyView;
}
// Otherwise, make a copy for the requested subset.
SkIRect subset = SkIRect::MakeXYWH(origin.fX, origin.fY, info.width(), info.height());
@@ -213,7 +214,7 @@
GrColorType grColorType = SkColorTypeToGrColorType(this->getInfo().colorType());
return GrSurfaceProxy::Copy(context, texProxyView.proxy(), texProxyView.origin(), grColorType,
mipMapped, subset, SkBackingFit::kExact,
- SkBudgeted::kYes).asTextureProxyRef();
+ SkBudgeted::kYes);
}
bool GrAHardwareBufferImageGenerator::onIsValid(GrContext* context) const {