Remove GrSurfaceDesc
Replace with SkISize.
Also change some const SkISize& params to just SkISize.
Change-Id: I3c72d961662eefeda545fba17d63e877cd5ca813
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269374
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp
index f2a10a5..d9cbf6e 100644
--- a/src/gpu/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/GrBackendTextureImageGenerator.cpp
@@ -143,9 +143,6 @@
GrColorType grColorType = SkColorTypeToGrColorType(info.colorType());
- GrSurfaceDesc desc;
- desc.fWidth = fBackendTexture.width();
- desc.fHeight = fBackendTexture.height();
GrMipMapped mipMapped = fBackendTexture.hasMipMaps() ? GrMipMapped::kYes : GrMipMapped::kNo;
// Ganesh assumes that, when wrapping a mipmapped backend texture from a client, that its
@@ -197,15 +194,15 @@
// unrelated to the whatever SkImage key may be assigned to the proxy.
return {std::move(tex), true, GrSurfaceProxy::LazyInstantiationKeyMode::kUnsynced};
},
- backendFormat, desc, readSwizzle, GrRenderable::kNo, 1, fSurfaceOrigin, mipMapped,
- mipMapsStatus, GrInternalSurfaceFlags::kReadOnly, SkBackingFit::kExact, SkBudgeted::kNo,
- GrProtected::kNo, GrSurfaceProxy::UseAllocator::kYes);
+ backendFormat, fBackendTexture.dimensions(), readSwizzle, GrRenderable::kNo, 1,
+ fSurfaceOrigin, mipMapped, mipMapsStatus, GrInternalSurfaceFlags::kReadOnly,
+ SkBackingFit::kExact, SkBudgeted::kNo, GrProtected::kNo,
+ GrSurfaceProxy::UseAllocator::kYes);
if (!proxy) {
return {};
}
- if (0 == origin.fX && 0 == origin.fY &&
- info.width() == fBackendTexture.width() && info.height() == fBackendTexture.height() &&
+ if (origin.isZero() && info.dimensions() == fBackendTexture.dimensions() &&
(!willNeedMipMaps || GrMipMapped::kYes == proxy->mipMapped())) {
// If the caller wants the entire texture and we have the correct mip support, we're done
return GrSurfaceProxyView(std::move(proxy), fSurfaceOrigin, readSwizzle);