diff options
Diffstat (limited to 'include/private/GrTextureProxy.h')
-rw-r--r-- | include/private/GrTextureProxy.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/private/GrTextureProxy.h b/include/private/GrTextureProxy.h index 2e7c0029fd..d4daa8e94e 100644 --- a/include/private/GrTextureProxy.h +++ b/include/private/GrTextureProxy.h @@ -69,14 +69,27 @@ protected: const void* srcData, size_t srcRowBytes, uint32_t flags); // Lazy-callback version - GrTextureProxy(LazyInstantiateCallback&&, GrPixelConfig); + // There are two main use cases for lazily-instantiated proxies: + // basic knowledge - width, height, config, origin are known + // minimal knowledge - only config is known. + // + // The basic knowledge version is used for DDL where we know the type of proxy we are going to + // use, but we don't have access to the GPU yet to instantiate it. + // + // The minimal knowledge version is used for CCPR where we are generating an atlas but we do not + // know the final size until flush time. + GrTextureProxy(LazyInstantiateCallback&&, const GrSurfaceDesc& desc, GrMipMapped, + SkBackingFit fit, SkBudgeted budgeted, uint32_t flags); // Wrapped version GrTextureProxy(sk_sp<GrSurface>, GrSurfaceOrigin); ~GrTextureProxy() override; - SkDestinationSurfaceColorMode mipColorMode() const { return fMipColorMode; } + SkDestinationSurfaceColorMode mipColorMode() const { + SkASSERT(LazyState::kNot == this->lazyInstantiationState()); + return fMipColorMode; + } sk_sp<GrSurface> createSurface(GrResourceProvider*) const override; |