From 65fa8ca85ef146340ddea61bb08c182df499ca62 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Wed, 10 Jan 2018 17:06:31 -0500 Subject: Updating lazy proxys to support the case where we know a lot more info about the texture. This is needed for future DDL texture work. Bug: skia: Change-Id: I07e0b9c67509e63b9cac00adc355254d03784df8 Reviewed-on: https://skia-review.googlesource.com/91500 Commit-Queue: Greg Daniel Reviewed-by: Chris Dalton --- include/private/GrTextureProxy.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'include/private/GrTextureProxy.h') 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, GrSurfaceOrigin); ~GrTextureProxy() override; - SkDestinationSurfaceColorMode mipColorMode() const { return fMipColorMode; } + SkDestinationSurfaceColorMode mipColorMode() const { + SkASSERT(LazyState::kNot == this->lazyInstantiationState()); + return fMipColorMode; + } sk_sp createSurface(GrResourceProvider*) const override; -- cgit v1.2.3