diff options
author | Robert Phillips <robertphillips@google.com> | 2017-06-01 12:55:44 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-02 11:46:40 +0000 |
commit | 18166eeaf2d088d494c4273b88107544166046fd (patch) | |
tree | a5653250b48b2c3c432127ac2e40d57008a5f117 /src/gpu/GrProcessor.h | |
parent | dec4c0b29843d5de7d06c3998d919b3e3abecdf2 (diff) |
Omnibus: Push instantiation of GrTextures later (post TextureSampler)
Split into:
https://skia-review.googlesource.com/c/10485/ (More GrSurfaceProxy-clean up)
https://skia-review.googlesource.com/c/15819/ (Expand GrTextureProxy to handle highestFilterMode)
https://skia-review.googlesource.com/c/16714/ (Switch ImageStorageAccess over to GrTextureProxies)
https://skia-review.googlesource.com/c/16908/ (Convert DstTexture to DstProxy)
Change-Id: I6cf3ba0f3bf0e1908d36749bc83571c066ddd568
Reviewed-on: https://skia-review.googlesource.com/10484
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrProcessor.h')
-rw-r--r-- | src/gpu/GrProcessor.h | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/gpu/GrProcessor.h b/src/gpu/GrProcessor.h index 0cf4fb1370..7a12b6c196 100644 --- a/src/gpu/GrProcessor.h +++ b/src/gpu/GrProcessor.h @@ -233,50 +233,37 @@ public: GrShaderFlags visibility = kFragment_GrShaderFlag); bool operator==(const TextureSampler& that) const { - return this->texture() == that.texture() && + return this->proxy() == that.proxy() && fParams == that.fParams && fVisibility == that.fVisibility; } bool operator!=(const TextureSampler& other) const { return !(*this == other); } - // MDB TODO: remove the remaining callers of this accessor - GrTexture* texture() const { return fTexture.get(); } - // 'instantiate' should only ever be called at flush time. bool instantiate(GrResourceProvider* resourceProvider) const { - // MDB TODO: return SkToBool(fProxy->instantiate(resourceProvider)); - // and remove the following 2 lines - SkDEBUGCODE(fInstantiated = true;) - return SkToBool(fTexture.get()); + return SkToBool(fProxyRef.get()->instantiate(resourceProvider)); } // 'peekTexture' should only ever be called after a successful 'instantiate' call GrTexture* peekTexture() const { - // MDB TODO: - // SkASSERT(fProxy->priv().peekTexture()); - // return fProxy->priv().peekTexture(); - // and remove the following 3 lines: - SkASSERT(fInstantiated); - SkASSERT(fTexture.get()); - return fTexture.get(); + SkASSERT(fProxyRef.get()->priv().peekTexture()); + return fProxyRef.get()->priv().peekTexture(); } + GrTextureProxy* proxy() const { return fProxyRef.get()->asTextureProxy(); } GrShaderFlags visibility() const { return fVisibility; } const GrSamplerParams& params() const { return fParams; } /** * For internal use by GrProcessor. */ - const GrGpuResourceRef* programTexture() const { return &fTexture; } + const GrSurfaceProxyRef* programProxy() const { return &fProxyRef; } private: - typedef GrTGpuResourceRef<GrTexture> ProgramTexture; - - ProgramTexture fTexture; + GrSurfaceProxyRef fProxyRef; GrSamplerParams fParams; GrShaderFlags fVisibility; - SkDEBUGCODE(mutable bool fInstantiated = false;) // MDB TODO: remove this line typedef SkNoncopyable INHERITED; }; |