diff options
author | 2018-01-10 17:06:31 -0500 | |
---|---|---|
committer | 2018-01-12 19:36:08 +0000 | |
commit | 65fa8ca85ef146340ddea61bb08c182df499ca62 (patch) | |
tree | c8795e3ecf0c2c45929249b03dcbe108f52e2445 /include/private/GrTextureProxy.h | |
parent | e2330261a704e2db762e2de0d297bf8b4dc510f1 (diff) |
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 <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
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; |