diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-28 00:48:56 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-28 00:48:56 +0000 |
commit | a3a93e7bbb8275069f319e0807c43f7395502abf (patch) | |
tree | f5424f889285ff09f930ffc30ed16c0203ad1827 /chrome/renderer/ggl/ggl.h | |
parent | 9117fb714da99c44319cc8e56909d0a48bf7da02 (diff) | |
download | chromium_src-a3a93e7bbb8275069f319e0807c43f7395502abf.zip chromium_src-a3a93e7bbb8275069f319e0807c43f7395502abf.tar.gz chromium_src-a3a93e7bbb8275069f319e0807c43f7395502abf.tar.bz2 |
Add way to create a texture in parent's context and copy into it
For canvas we need a way to create multiple offscreen render targets within
the same OpenGL context and expose them all to the compositor, which exists
as a parent context. ggl currently provides a single framebuffer and texture
pair per offscreen context and implements swapBuffers() to copy to the parent
texture. This generalizes that to let clients create as many parent textures
as necessary and do the equivalent of swapBuffers() for each without the
service side needing to keep track of the mapping.
We'll want to change this in the future when we start using glBlitFramebuffer
to support multisampling. I think in that world we'll need a way to bind a
texture in the parent's context to the DRAW_FRAMEBUFFER context. For now,
I think this is OK.
TEST=open a page with multiple accelerated canvases in a shared context
BUG=52684
Review URL: http://codereview.chromium.org/3211005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57761 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/ggl/ggl.h')
-rw-r--r-- | chrome/renderer/ggl/ggl.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/renderer/ggl/ggl.h b/chrome/renderer/ggl/ggl.h index fd1cd56..38f83ad 100644 --- a/chrome/renderer/ggl/ggl.h +++ b/chrome/renderer/ggl/ggl.h @@ -87,6 +87,13 @@ void ResizeOffscreenContext(Context* context, const gfx::Size& size); // parent. uint32 GetParentTextureId(Context* context); +// Create a new texture in the parent's context. Returns zero if context +// does not have a parent. +uint32 CreateParentTexture(Context* context, const gfx::Size& size); + +// Deletes a texture in the parent's context. +void DeleteParentTexture(Context* context, uint32 texture); + // Provides a callback that will be invoked when SwapBuffers has completed // service side. void SetSwapBuffersCallback(Context* context, |