Add GrExternalTextureData and SkCrossContextImageData
GrExternalTextureData is an API for exporting the backend-specific
information about a texture in a type-safe way, and without pointing
into the GrTexture. The new detachBackendTexture API lets us release
ownership of a texture to the client.
SkCrossContextImageData is the public API that lets clients upload
textures on one thread/GrContext, then safely transfer ownership to
another thread and GrContext for rendering.
Only GL is implemented/supported right now. Vulkan support requires
that we add thread-safe memory pools, or otherwise transfer the
actual memory block containing the texture to the new context.
Re-land of https://skia-review.googlesource.com/c/8529/
BUG=skia:
Change-Id: I48ebd57d1ea0cfd3a1db10c475f2903afb821966
Reviewed-on: https://skia-review.googlesource.com/8960
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h
index 16a4ca9..23f870d 100644
--- a/include/gpu/GrCaps.h
+++ b/include/gpu/GrCaps.h
@@ -183,6 +183,7 @@
bool sampleShadingSupport() const { return fSampleShadingSupport; }
bool fenceSyncSupport() const { return fFenceSyncSupport; }
+ bool crossContextTextureSupport() const { return fCrossContextTextureSupport; }
protected:
/** Subclasses must call this at the end of their constructors in order to apply caps
@@ -225,6 +226,9 @@
// TODO: this may need to be an enum to support different fence types
bool fFenceSyncSupport : 1;
+ // Vulkan doesn't support this (yet) and some drivers have issues, too
+ bool fCrossContextTextureSupport : 1;
+
InstancedSupport fInstancedSupport;
BlendEquationSupport fBlendEquationSupport;