diff options
author | Robert Phillips <robertphillips@google.com> | 2017-05-12 14:49:16 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-12 19:20:22 +0000 |
commit | 8a02f65c5cc16d010f188c34861b03d96cb8ec10 (patch) | |
tree | e90adb6d5167987d1b93fb3c0ba2511ff435bdc0 /src/gpu/GrProcessor.h | |
parent | 177266339c3aa6dda4fa2912af9eaa8e8206f78f (diff) |
Switch ImageStorageAccess over to GrTextureProxies
Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler))
Change-Id: I341de6ae121620d30e50bff21450878a18bdf4f2
Reviewed-on: https://skia-review.googlesource.com/16714
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, 17 insertions, 10 deletions
diff --git a/src/gpu/GrProcessor.h b/src/gpu/GrProcessor.h index 7011267c76..027a34e334 100644 --- a/src/gpu/GrProcessor.h +++ b/src/gpu/GrProcessor.h @@ -15,6 +15,7 @@ #include "GrProgramElement.h" #include "GrSamplerParams.h" #include "GrShaderVar.h" +#include "GrSurfaceProxyPriv.h" #include "SkMath.h" #include "SkString.h" #include "../private/SkAtomics.h" @@ -189,7 +190,7 @@ protected: */ void addTextureSampler(const TextureSampler*); void addBufferAccess(const BufferAccess*); - void addImageStorageAccess(const ImageStorageAccess*); + void addImageStorageAccess(GrResourceProvider* resourceProvider, const ImageStorageAccess*); bool hasSameSamplersAndAccesses(const GrResourceIOProcessor&) const; @@ -324,33 +325,39 @@ private: */ class GrResourceIOProcessor::ImageStorageAccess : public SkNoncopyable { public: - ImageStorageAccess(sk_sp<GrTexture> texture, GrIOType ioType, GrSLMemoryModel, GrSLRestrict, + ImageStorageAccess(sk_sp<GrTextureProxy>, GrIOType, GrSLMemoryModel, GrSLRestrict, GrShaderFlags visibility = kFragment_GrShaderFlag); bool operator==(const ImageStorageAccess& that) const { - return this->texture() == that.texture() && fVisibility == that.fVisibility; + return this->proxy() == that.proxy() && fVisibility == that.fVisibility; } bool operator!=(const ImageStorageAccess& that) const { return !(*this == that); } - GrTexture* texture() const { return fTexture.get(); } + GrTexture* texture() const { return fProxyRef.getProxy()->priv().peekTexture(); } + GrTextureProxy* proxy() const { return fProxyRef.getProxy()->asTextureProxy(); } GrShaderFlags visibility() const { return fVisibility; } - GrIOType ioType() const { return fTexture.ioType(); } + GrIOType ioType() const { return fProxyRef.ioType(); } GrImageStorageFormat format() const { return fFormat; } GrSLMemoryModel memoryModel() const { return fMemoryModel; } GrSLRestrict restrict() const { return fRestrict; } + // MDB: In the future this should be renamed instantiate + bool isBad(GrResourceProvider* resourceProvider) const { + return SkToBool(!fProxyRef.getProxy()->instantiate(resourceProvider)); + } + /** * For internal use by GrProcessor. */ - const GrGpuResourceRef* programTexture() const { return &fTexture; } + const GrSurfaceProxyRef* programProxy() const { return &fProxyRef; } private: - GrTGpuResourceRef<GrTexture> fTexture; - GrShaderFlags fVisibility; + GrSurfaceProxyRef fProxyRef; + GrShaderFlags fVisibility; GrImageStorageFormat fFormat; - GrSLMemoryModel fMemoryModel; - GrSLRestrict fRestrict; + GrSLMemoryModel fMemoryModel; + GrSLRestrict fRestrict; typedef SkNoncopyable INHERITED; }; |