diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-05-17 21:45:25 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-18 10:56:54 +0000 |
commit | 50edafacc8ea56bdc13fd2234618fe06094eec0e (patch) | |
tree | dbac9524d201e74c60315b363df431903571c834 /src | |
parent | 44890ef00dabf8c47bbed3bba66a73bae8ed2f0d (diff) |
Add proxy unique key management to GrOnFlushResourceProvider
Bug: skia:
Change-Id: I0c462e282ea6d78f22340546c03b357f1ba7666f
Reviewed-on: https://skia-review.googlesource.com/129140
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrOnFlushResourceProvider.cpp | 18 | ||||
-rw-r--r-- | src/gpu/GrOnFlushResourceProvider.h | 5 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/gpu/GrOnFlushResourceProvider.cpp b/src/gpu/GrOnFlushResourceProvider.cpp index 9e2e1fee4a..ff56c33c12 100644 --- a/src/gpu/GrOnFlushResourceProvider.cpp +++ b/src/gpu/GrOnFlushResourceProvider.cpp @@ -81,6 +81,24 @@ sk_sp<GrRenderTargetContext> GrOnFlushResourceProvider::makeRenderTargetContext( return renderTargetContext; } +bool GrOnFlushResourceProvider::assignUniqueKeyToProxy(const GrUniqueKey& key, + GrTextureProxy* proxy) { + auto proxyProvider = fDrawingMgr->getContext()->contextPriv().proxyProvider(); + return proxyProvider->assignUniqueKeyToProxy(key, proxy); +} + +void GrOnFlushResourceProvider::removeUniqueKeyFromProxy(const GrUniqueKey& key, + GrTextureProxy* proxy) { + auto proxyProvider = fDrawingMgr->getContext()->contextPriv().proxyProvider(); + proxyProvider->removeUniqueKeyFromProxy(key, proxy); +} + +sk_sp<GrTextureProxy> GrOnFlushResourceProvider::findOrCreateProxyByUniqueKey( + const GrUniqueKey& key, GrSurfaceOrigin origin) { + auto proxyProvider = fDrawingMgr->getContext()->contextPriv().proxyProvider(); + return proxyProvider->findOrCreateProxyByUniqueKey(key, origin); +} + bool GrOnFlushResourceProvider::instatiateProxy(GrSurfaceProxy* proxy) { auto resourceProvider = fDrawingMgr->getContext()->contextPriv().resourceProvider(); diff --git a/src/gpu/GrOnFlushResourceProvider.h b/src/gpu/GrOnFlushResourceProvider.h index 3bfc87de0a..d01f1342ea 100644 --- a/src/gpu/GrOnFlushResourceProvider.h +++ b/src/gpu/GrOnFlushResourceProvider.h @@ -77,6 +77,11 @@ public: sk_sp<SkColorSpace>, const SkSurfaceProps*); + // Proxy unique key management. See GrProxyProvider. + bool assignUniqueKeyToProxy(const GrUniqueKey&, GrTextureProxy*); + void removeUniqueKeyFromProxy(const GrUniqueKey&, GrTextureProxy*); + sk_sp<GrTextureProxy> findOrCreateProxyByUniqueKey(const GrUniqueKey&, GrSurfaceOrigin); + bool instatiateProxy(GrSurfaceProxy*); // Creates a GPU buffer with a "dynamic" access pattern. |