Add GrMipMapsStatus to GrTextureProxy
Bug: skia:
Change-Id: I5adf10f730b04c2b3b62c3b12aa5899da4db3431
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229922
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/image/SkImage_GpuBase.cpp b/src/image/SkImage_GpuBase.cpp
index 60fc1c4..f319f9f 100644
--- a/src/image/SkImage_GpuBase.cpp
+++ b/src/image/SkImage_GpuBase.cpp
@@ -491,10 +491,15 @@
desc.fHeight = height;
desc.fConfig = config;
+ // Ganesh assumes that, when wrapping a mipmapped backend texture from a client, that its
+ // mipmaps are fully fleshed out.
+ GrMipMapsStatus mipMapsStatus = (GrMipMapped::kYes == mipMapped)
+ ? GrMipMapsStatus::kValid : GrMipMapsStatus::kNotAllocated;
+
// We pass kReadOnly here since we should treat content of the client's texture as immutable.
// The promise API provides no way for the client to indicated that the texture is protected.
return proxyProvider->createLazyProxy(
std::move(callback), backendFormat, desc, GrRenderable::kNo, 1, origin, mipMapped,
- GrInternalSurfaceFlags::kReadOnly, SkBackingFit::kExact, SkBudgeted::kNo,
+ mipMapsStatus, GrInternalSurfaceFlags::kReadOnly, SkBackingFit::kExact, SkBudgeted::kNo,
GrProtected::kNo, GrSurfaceProxy::LazyInstantiationType::kDeinstantiate);
}