aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceProvider.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-09-26 12:49:26 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-26 17:11:21 +0000
commitcd871401114f402e72420ccd49edecee2532b0e6 (patch)
treea323510790f271cc2e0a85487ab52cbc7ffc9339 /src/gpu/GrResourceProvider.cpp
parent98a6216b18b57c2f7a0d58f542c60503686aed69 (diff)
Add ability to remove unique key from proxy and underlying surface.
Bug: skia: Change-Id: I66b891ce9ca35906fdbddb36f565b35b25825112 Reviewed-on: https://skia-review.googlesource.com/51240 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrResourceProvider.cpp')
-rw-r--r--src/gpu/GrResourceProvider.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 8c96c2986b..16fe0c359d 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -276,6 +276,14 @@ void GrResourceProvider::assignUniqueKeyToResource(const GrUniqueKey& key,
resource->resourcePriv().setUniqueKey(key);
}
+void GrResourceProvider::removeUniqueKeyFromProxy(const GrUniqueKey& key, GrTextureProxy* proxy) {
+ ASSERT_SINGLE_OWNER
+ if (this->isAbandoned() || !proxy) {
+ return;
+ }
+ fCache->processInvalidProxyUniqueKey(key, proxy, true);
+}
+
GrGpuResource* GrResourceProvider::findAndRefResourceByUniqueKey(const GrUniqueKey& key) {
ASSERT_SINGLE_OWNER
return this->isAbandoned() ? nullptr : fCache->findAndRefUniqueResource(key);
@@ -313,6 +321,12 @@ sk_sp<GrTextureProxy> GrResourceProvider::findProxyByUniqueKey(const GrUniqueKey
return this->isAbandoned() ? nullptr : fCache->findProxyByUniqueKey(key, origin);
}
+sk_sp<GrTextureProxy> GrResourceProvider::findOrCreateProxyByUniqueKey(const GrUniqueKey& key,
+ GrSurfaceOrigin origin) {
+ ASSERT_SINGLE_OWNER
+ return this->isAbandoned() ? nullptr : fCache->findOrCreateProxyByUniqueKey(key, origin);
+}
+
const GrBuffer* GrResourceProvider::createPatternedIndexBuffer(const uint16_t* pattern,
int patternSize,
int reps,