aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceProvider.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-09-21 08:26:08 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-21 13:52:10 +0000
commitae7d3f3992708354a3284bb49066737e36a76f40 (patch)
tree5f629138138923176da38afe3cb5899fc54a66a5 /src/gpu/GrResourceProvider.h
parent48497462c18533794979cb8020a982f4681fd635 (diff)
Add native caching of uniquely keyed GrTextureProxies (take 2)
TBR=bsalomon@google.com Change-Id: I590dcdc85fb60706c7eb06277694791dc04c9141 Reviewed-on: https://skia-review.googlesource.com/49543 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrResourceProvider.h')
-rw-r--r--src/gpu/GrResourceProvider.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gpu/GrResourceProvider.h b/src/gpu/GrResourceProvider.h
index 1ab1ec42fc..7be8ec1793 100644
--- a/src/gpu/GrResourceProvider.h
+++ b/src/gpu/GrResourceProvider.h
@@ -45,17 +45,19 @@ public:
return static_cast<T*>(this->findAndRefResourceByUniqueKey(key));
}
- ///////////////////////////////////////////////////////////////////////////
- // Textures
+ /*
+ * Assigns a unique key to a proxy. The proxy will be findable via this key using
+ * findProxyByUniqueKey(). It is an error if an existing proxy already has a key.
+ */
+ void assignUniqueKeyToProxy(const GrUniqueKey&, GrTextureProxy*);
- /** Assigns a unique key to the texture. The texture will be findable via this key using
- findTextureByUniqueKey(). If an existing texture has this key, it's key will be removed. */
- void assignUniqueKeyToProxy(const GrUniqueKey& key, GrTextureProxy*);
+ /*
+ * Finds a proxy by unique key.
+ */
+ sk_sp<GrTextureProxy> findProxyByUniqueKey(const GrUniqueKey&, GrSurfaceOrigin);
- /** Finds a texture by unique key. If the texture is found it is ref'ed and returned. */
- // MDB TODO (caching): If this were actually caching proxies (rather than shallowly
- // wrapping GrSurface caching) we would not need the origin parameter.
- sk_sp<GrTextureProxy> findProxyByUniqueKey(const GrUniqueKey& key, GrSurfaceOrigin);
+ ///////////////////////////////////////////////////////////////////////////
+ // Textures
/**
* Finds a texture that approximately matches the descriptor. Will be at least as large in width