aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkImage_Gpu.h
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-03-16 14:57:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-16 19:27:46 +0000
commit7278d68cac9e39970144909df449113d43fff480 (patch)
tree95c86e6c9676d59e99549ddcd3fa5d727b71ec98 /src/image/SkImage_Gpu.h
parent7ba427ef40301d199bcd5c0f9a9d41244c495bd6 (diff)
Add DoneProc to Promise Images
This proc will notify the client when we will no longer call fulfill on their promise image so that can delete any meta data they needed to store to be able to complete the fulfill requests. Bug: skia: Change-Id: Ife1e6845f221c31ce1ae2c0d2ba5e4c8f0203b74 Reviewed-on: https://skia-review.googlesource.com/114092 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/image/SkImage_Gpu.h')
-rw-r--r--src/image/SkImage_Gpu.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/image/SkImage_Gpu.h b/src/image/SkImage_Gpu.h
index e1fd35a766..7a4fa9751a 100644
--- a/src/image/SkImage_Gpu.h
+++ b/src/image/SkImage_Gpu.h
@@ -63,6 +63,7 @@ public:
typedef ReleaseContext TextureContext;
typedef void (*TextureFulfillProc)(TextureContext textureContext, GrBackendTexture* outTexture);
+ typedef void (*PromiseDoneProc)(TextureContext textureContext);
/**
Create a new SkImage that is very similar to an SkImage created by MakeFromTexture. The main
@@ -83,6 +84,11 @@ public:
In other words we will never call textureFulfillProc or textureReleaseProc multiple times
for the same textureContext before calling the other.
+ We we call the promiseDoneProc when we will no longer call the textureFulfillProc again. We
+ also guarantee that there will be no outstanding textureReleaseProcs that still need to be
+ called when we call the textureDoneProc. Thus when the textureDoneProc gets called the
+ client is able to cleanup all GPU objects and meta data needed for the textureFulfill call.
+
@param context Gpu context
@param backendFormat format of promised gpu texture
@param width width of promised gpu texture
@@ -98,6 +104,7 @@ public:
@param colorSpace range of colors; may be nullptr
@param textureFulfillProc function called to get actual gpu texture
@param textureReleaseProc function called when texture can be released
+ @param promiseDoneProc function called when we will no longer call textureFulfillProc
@param textureContext state passed to textureFulfillProc and textureReleaseProc
@return created SkImage, or nullptr
*/
@@ -112,6 +119,7 @@ public:
sk_sp<SkColorSpace> colorSpace,
TextureFulfillProc textureFulfillProc,
TextureReleaseProc textureReleaseProc,
+ PromiseDoneProc promiseDoneProc,
TextureContext textureContext);
/** Implementation of MakeFromYUVTexturesCopy and MakeFromNV12TexturesCopy */