Pass description of GrSurface to GrSurfaceProxy lazy callbacks.
Also make GrDynamicAtlas directly use the GrSurface callback type rather
than go through a springboard.
Change-Id: I3e3c155bbc1e2e794e0d6828b0ea3c64c6a7f3e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283226
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrTextureProxy.cpp b/src/gpu/GrTextureProxy.cpp
index 573d777..fa7e064 100644
--- a/src/gpu/GrTextureProxy.cpp
+++ b/src/gpu/GrTextureProxy.cpp
@@ -171,6 +171,28 @@
fProxyProvider = nullptr;
}
+GrSurfaceProxy::LazySurfaceDesc GrTextureProxy::callbackDesc() const {
+ SkISize dims;
+ SkBackingFit fit;
+ if (this->isFullyLazy()) {
+ fit = SkBackingFit::kApprox;
+ dims = {-1, -1};
+ } else {
+ fit = this->isFunctionallyExact() ? SkBackingFit::kExact : SkBackingFit::kApprox;
+ dims = this->dimensions();
+ }
+ return {
+ dims,
+ fit,
+ GrRenderable::kNo,
+ fMipMapped,
+ 1,
+ this->backendFormat(),
+ this->isProtected(),
+ this->isBudgeted(),
+ };
+}
+
#ifdef SK_DEBUG
void GrTextureProxy::onValidateSurface(const GrSurface* surface) {
SkASSERT(!surface->asRenderTarget());