Support sharing promise images between DDLs
- Migrate our code to SkImage::MakePromiseTexture
- Have DDLTileHelper share one SKP and one set of promise images across all tiles.
- Disallow on-the-fly allocation of mips for promise textures.
Bug: skia:10286
Change-Id: Ie35976958454fc520f3c9d860e6285441260c9f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291938
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index 8e4bc2a..9562f07 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -689,17 +689,19 @@
// 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 indicate that the texture is protected.
- return sk_sp<GrTextureProxy>(new GrTextureProxy(std::move(callback),
- format,
- dimensions,
- mipMapped,
- mipmapStatus,
- SkBackingFit::kExact,
- SkBudgeted::kNo,
- GrProtected::kNo,
- GrInternalSurfaceFlags::kReadOnly,
- GrSurfaceProxy::UseAllocator::kYes,
- GrDDLProvider::kYes));
+ auto proxy = sk_sp<GrTextureProxy>(new GrTextureProxy(std::move(callback),
+ format,
+ dimensions,
+ mipMapped,
+ mipmapStatus,
+ SkBackingFit::kExact,
+ SkBudgeted::kNo,
+ GrProtected::kNo,
+ GrInternalSurfaceFlags::kReadOnly,
+ GrSurfaceProxy::UseAllocator::kYes,
+ GrDDLProvider::kYes));
+ proxy->priv().setIsPromiseProxy();
+ return proxy;
}
sk_sp<GrTextureProxy> GrProxyProvider::createLazyProxy(LazyInstantiateCallback&& callback,