aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProxyProvider.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-01-17 13:35:46 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-17 19:43:57 +0000
commitadbe1328789071d1f742023edd93b6948eed9470 (patch)
tree952806d1cb29fc01b5743b433f6bfaabc6d6869e /src/gpu/GrProxyProvider.h
parentfe266c2bce2b8ac4ef953f16c8e1a7801da9c57d (diff)
Remove GrSurfaceProxy::MakeWrapped (take 2)
TBR=bsalomon@google.com Change-Id: I26fd911da502fb00addacb8b2c1a263efc5aa4ec Reviewed-on: https://skia-review.googlesource.com/95881 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrProxyProvider.h')
-rw-r--r--src/gpu/GrProxyProvider.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gpu/GrProxyProvider.h b/src/gpu/GrProxyProvider.h
index 4c93886da6..f0b1bbd1ed 100644
--- a/src/gpu/GrProxyProvider.h
+++ b/src/gpu/GrProxyProvider.h
@@ -32,7 +32,7 @@ public:
* 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*);
+ bool assignUniqueKeyToProxy(const GrUniqueKey&, GrTextureProxy*);
/*
* Sets the unique key of the provided proxy to the unique key of the surface. The surface must
@@ -102,10 +102,17 @@ public:
sk_sp<GrTextureProxy> createProxy(const GrSurfaceDesc&, SkBackingFit, SkBudgeted,
uint32_t flags = 0);
+ // These match the definitions in SkImage & GrTexture.h, for whence they came
+ typedef void* ReleaseContext;
+ typedef void (*ReleaseProc)(ReleaseContext);
+
/*
* Create a texture proxy that wraps a (non-renderable) backend texture.
*/
- sk_sp<GrTextureProxy> createWrappedTextureProxy(const GrBackendTexture&, GrSurfaceOrigin);
+ sk_sp<GrTextureProxy> createWrappedTextureProxy(const GrBackendTexture&, GrSurfaceOrigin,
+ GrWrapOwnership = kBorrow_GrWrapOwnership,
+ ReleaseProc = nullptr,
+ ReleaseContext = nullptr);
/*
* Create a texture proxy that wraps a backend texture and is both texture-able and renderable
@@ -188,6 +195,10 @@ public:
void removeAllUniqueKeys();
private:
+ friend class GrAHardwareBufferImageGenerator; // for createWrapped
+
+ sk_sp<GrTextureProxy> createWrapped(sk_sp<GrTexture> tex, GrSurfaceOrigin origin);
+
struct UniquelyKeyedProxyHashTraits {
static const GrUniqueKey& GetKey(const GrTextureProxy& p) { return p.getUniqueKey(); }