aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpuResource.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-11-25 05:52:06 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-25 05:52:06 -0800
commit10e23caea3106be125acea10a637789e5a15c728 (patch)
tree80c21f2ab346fc91983b02fcaa4031604803607b /src/gpu/GrGpuResource.cpp
parent03bee31e553100ba7814cda8351d10645500f154 (diff)
Use scratch keys for stencil buffers.
Diffstat (limited to 'src/gpu/GrGpuResource.cpp')
-rw-r--r--src/gpu/GrGpuResource.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp
index 8dbbd83ef5..cc24335184 100644
--- a/src/gpu/GrGpuResource.cpp
+++ b/src/gpu/GrGpuResource.cpp
@@ -128,6 +128,13 @@ void GrGpuResource::setScratchKey(const GrResourceKey& scratchKey) {
fScratchKey = scratchKey;
}
+void GrGpuResource::removeScratchKey() {
+ if (!this->wasDestroyed() && !fScratchKey.isNullScratch()) {
+ get_resource_cache2(fGpu)->resourceAccess().willRemoveScratchKey(this);
+ fScratchKey = GrResourceKey::NullScratchKey();
+ }
+}
+
uint32_t GrGpuResource::CreateUniqueID() {
static int32_t gUniqueID = SK_InvalidUniqueID;
uint32_t id;