aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrStencilAttachment.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-08-30 16:44:40 -0400
committerGravatar Robert Phillips <robertphillips@google.com>2017-08-30 21:17:36 +0000
commitcb2e235e6fb5d9230c41ccf58b865c90ff928f67 (patch)
tree4506e0436973260c15513589347ad49cb8c48bb2 /src/gpu/GrStencilAttachment.h
parentdff47afd5a5b91fff4435c5fe6f9392e20d2b3bf (diff)
Reduce stencil buffer clearing
TBR=bsalomon@google.com Bug: skia:6953 Change-Id: I079f90711297ee290f2d4011cfcb18b764554deb Reviewed-on: https://skia-review.googlesource.com/40691 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrStencilAttachment.h')
-rw-r--r--src/gpu/GrStencilAttachment.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gpu/GrStencilAttachment.h b/src/gpu/GrStencilAttachment.h
index 08d6799f62..df5677d163 100644
--- a/src/gpu/GrStencilAttachment.h
+++ b/src/gpu/GrStencilAttachment.h
@@ -17,9 +17,7 @@ class GrResourceKey;
class GrStencilAttachment : public GrGpuResource {
public:
-
-
- virtual ~GrStencilAttachment() {
+ ~GrStencilAttachment() override {
// TODO: allow SB to be purged and detach itself from rts
}
@@ -27,6 +25,9 @@ public:
int height() const { return fHeight; }
int bits() const { return fBits; }
int numSamples() const { return fSampleCnt; }
+ bool isDirty() const { return fIsDirty; }
+
+ void cleared() { fIsDirty = false; }
// We create a unique stencil buffer at each width, height and sampleCnt and share it for
// all render targets that require a stencil with those params.
@@ -35,11 +36,12 @@ public:
protected:
GrStencilAttachment(GrGpu* gpu, int width, int height, int bits, int sampleCnt)
- : GrGpuResource(gpu)
- , fWidth(width)
- , fHeight(height)
- , fBits(bits)
- , fSampleCnt(sampleCnt) {
+ : INHERITED(gpu)
+ , fWidth(width)
+ , fHeight(height)
+ , fBits(bits)
+ , fSampleCnt(sampleCnt)
+ , fIsDirty(true) {
}
private:
@@ -48,6 +50,7 @@ private:
int fHeight;
int fBits;
int fSampleCnt;
+ bool fIsDirty;
typedef GrGpuResource INHERITED;
};