aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpuResourceCacheAccess.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-06-18 09:12:16 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-18 09:12:17 -0700
commit6dc6f5f4a153d33ed91565cb3cd397a310a937d0 (patch)
treea432ddf0638895a1d1d645876575aa64a9d9d6c7 /src/gpu/GrGpuResourceCacheAccess.h
parent4c58e085b27c4cd9813ed7cad2388194d1d1f089 (diff)
Add support for creating texture backed images where Skia will delete the texture.
Diffstat (limited to 'src/gpu/GrGpuResourceCacheAccess.h')
-rw-r--r--src/gpu/GrGpuResourceCacheAccess.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gpu/GrGpuResourceCacheAccess.h b/src/gpu/GrGpuResourceCacheAccess.h
index 4f38fc6002..611d43b9a1 100644
--- a/src/gpu/GrGpuResourceCacheAccess.h
+++ b/src/gpu/GrGpuResourceCacheAccess.h
@@ -33,7 +33,19 @@ private:
/**
* Is the resource object wrapping an externally allocated GPU resource?
*/
- bool isWrapped() const { return GrGpuResource::kWrapped_LifeCycle == fResource->fLifeCycle; }
+ bool isExternal() const { return fResource->isExternal(); }
+
+ /**
+ * Is the resource object wrapping an externally allocated GPU resource that Skia has not taken
+ * ownership of.
+ */
+ bool isBorrowed() const { return GrGpuResource::kBorrowed_LifeCycle == fResource->fLifeCycle; }
+
+ /**
+ * Is the resource object wrapping an externally allocated GPU resource that Skia has taken
+ * ownership of.
+ */
+ bool isAdopted() const { return GrGpuResource::kAdopted_LifeCycle == fResource->fLifeCycle; }
/**
* Called by the cache to delete the resource under normal circumstances.