diff options
author | Brian Osman <brianosman@google.com> | 2017-02-23 17:06:10 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-24 16:09:33 +0000 |
commit | 9ad1f92e2fceea33215c0f13cee42a679fb88d44 (patch) | |
tree | f44afa1066b401ae5e3cf189078ff6fceaccca78 /tools/gpu/gl/win | |
parent | 20de615e3d02ff52c9a3c319ce35bcaace97be25 (diff) |
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.
BUG=skia:
Change-Id: I784a3a74be69807df038c7d192eaed002c7e45ca
Reviewed-on: https://skia-review.googlesource.com/8529
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tools/gpu/gl/win')
-rw-r--r-- | tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp b/tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp index af35b7b6bc..49d774315b 100644 --- a/tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp +++ b/tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp @@ -85,7 +85,11 @@ WinGLTestContext::WinGLTestContext(GrGLStandard forcedGpuAPI, WinGLTestContext* kGLES_GrGLStandard == forcedGpuAPI ? kGLES_SkWGLContextRequest : kGLPreferCompatibilityProfile_SkWGLContextRequest; - HGLRC winShareContext = shareContext ? shareContext->fGlRenderContext : nullptr; + HGLRC winShareContext = nullptr; + if (shareContext) { + winShareContext = shareContext->fPbufferContext ? shareContext->fPbufferContext->getGLRC() + : shareContext->fGlRenderContext; + } fPbufferContext = SkWGLPbufferContext::Create(fDeviceContext, 0, contextType, winShareContext); HDC dc; |