diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-01 21:50:59 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-01 21:50:59 +0000 |
commit | 78b514be30c67dad84bb8e2b6dfac3cfb15c79ff (patch) | |
tree | dd7d62dafa82bd6fbe087fb6f4de8148939c34ee /content/common/gpu/gpu_command_buffer_stub.h | |
parent | 107d6e00cece1fb1545f5403193576f822e93a09 (diff) | |
download | chromium_src-78b514be30c67dad84bb8e2b6dfac3cfb15c79ff.zip chromium_src-78b514be30c67dad84bb8e2b6dfac3cfb15c79ff.tar.gz chromium_src-78b514be30c67dad84bb8e2b6dfac3cfb15c79ff.tar.bz2 |
Allow textures to be moved from one GL context group to another.
The function glProduceTexture(target, mailbox) removes a texture from a context group and puts it in a "mailbox" that is accessible to all context groups on the same channel.
Then glConsumeTexture(target, mailbox) adds the texture to a context group, possibly a different one, if the caller knows the name of the mailbox.
From the point of view of the caller, the texture objects themselves do not move, just the texels. In terms of the underlying GL, the TextureInfo service IDs are reassigned as necessary.
A texture in a mailbox is destroyed when the context group that put it there is destroyed.
Expected usage is:
// Context 1
glBindTexture(GL_TEXTURE_2D, foo);
glProduceTexture(GL_TEXTURE_2D, secret_name);
glFlush();
// Context 2
glBindTexture(GL_TEXTURE_2D, bar);
glConsumeTexture(GL_TEXTURE_2D, secret_name);
Review URL: http://codereview.chromium.org/10106015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/gpu/gpu_command_buffer_stub.h')
-rw-r--r-- | content/common/gpu/gpu_command_buffer_stub.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/content/common/gpu/gpu_command_buffer_stub.h b/content/common/gpu/gpu_command_buffer_stub.h index 4f08818..5a99c56 100644 --- a/content/common/gpu/gpu_command_buffer_stub.h +++ b/content/common/gpu/gpu_command_buffer_stub.h @@ -39,6 +39,12 @@ class GpuChannel; struct GpuMemoryAllocation; class GpuWatchdog; +namespace gpu { +namespace gles2 { +class MailboxManager; +} +} + // This Base class is used to expose methods of GpuCommandBufferStub used for // testability. class CONTENT_EXPORT GpuCommandBufferStubBase { @@ -88,6 +94,7 @@ class GpuCommandBufferStub GpuChannel* channel, GpuCommandBufferStub* share_group, const gfx::GLSurfaceHandle& handle, + gpu::gles2::MailboxManager* mailbox_manager, const gfx::Size& size, const gpu::gles2::DisallowedFeatures& disallowed_features, const std::string& allowed_extensions, |