aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProcessor.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-05-01 13:12:20 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-03 16:59:37 +0000
commita91e0b7cc2537dc57ccf67914638e13b4612ffd1 (patch)
tree858fb3b4d98cb07461468f9b9ea1935f7950392e /src/gpu/GrProcessor.h
parent7eb86981a954c500fa4a4d8425496a5beb789e5d (diff)
Allow TextureSamplers to have null GrTexture pointer
Bug: 715488 Change-Id: I69775cbb50d334d81872e236e59368fe65e698ff Reviewed-on: https://skia-review.googlesource.com/14605 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrProcessor.h')
-rw-r--r--src/gpu/GrProcessor.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gpu/GrProcessor.h b/src/gpu/GrProcessor.h
index 1816db2ea5..7011267c76 100644
--- a/src/gpu/GrProcessor.h
+++ b/src/gpu/GrProcessor.h
@@ -176,8 +176,10 @@ public:
return *fImageStorageAccesses[index];
}
+ bool isBad() const { return fIsBad; }
+
protected:
- GrResourceIOProcessor() = default;
+ GrResourceIOProcessor() : fIsBad(false) {}
/**
* Subclasses call these from their constructor to register sampler/image sources. The processor
@@ -196,10 +198,13 @@ protected:
void removeRefs() const;
void pendingIOComplete() const;
+ void markAsBad() { fIsBad = true; }
+
private:
SkSTArray<4, const TextureSampler*, true> fTextureSamplers;
SkSTArray<1, const BufferAccess*, true> fBufferAccesses;
SkSTArray<1, const ImageStorageAccess*, true> fImageStorageAccesses;
+ bool fIsBad;
typedef GrProcessor INHERITED;
};
@@ -252,6 +257,8 @@ public:
*/
const GrGpuResourceRef* programTexture() const { return &fTexture; }
+ bool isBad() const { return !fTexture.get(); }
+
private:
typedef GrTGpuResourceRef<GrTexture> ProgramTexture;