aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkDeferredDisplayListRecorder.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/core/SkDeferredDisplayListRecorder.h')
-rw-r--r--include/core/SkDeferredDisplayListRecorder.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/core/SkDeferredDisplayListRecorder.h b/include/core/SkDeferredDisplayListRecorder.h
index d7743e6b8c..0acf598f96 100644
--- a/include/core/SkDeferredDisplayListRecorder.h
+++ b/include/core/SkDeferredDisplayListRecorder.h
@@ -55,6 +55,7 @@ public:
typedef void* TextureContext;
typedef void (*TextureReleaseProc)(TextureContext 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
@@ -75,6 +76,12 @@ 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
+ pass in the textureContext as a parameter to the promiseDoneProc. 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.
+
This call is only valid if the SkDeferredDisplayListRecorder is backed by a gpu context.
@param backendFormat format of promised gpu texture
@@ -91,6 +98,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
*/
@@ -104,6 +112,7 @@ public:
sk_sp<SkColorSpace> colorSpace,
TextureFulfillProc textureFulfillProc,
TextureReleaseProc textureReleaseProc,
+ PromiseDoneProc promiseDoneProc,
TextureContext textureContext);
private: