diff options
Diffstat (limited to 'chrome/renderer/ggl/ggl.h')
-rw-r--r-- | chrome/renderer/ggl/ggl.h | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/chrome/renderer/ggl/ggl.h b/chrome/renderer/ggl/ggl.h index 26607ec..e5c661f 100644 --- a/chrome/renderer/ggl/ggl.h +++ b/chrome/renderer/ggl/ggl.h @@ -10,6 +10,9 @@ #ifndef CHROME_RENDERER_GGL_GGL_H_ #define CHROME_RENDERER_GGL_GGL_H_ +#include "gfx/native_widget_types.h" +#include "gfx/size.h" + class GpuChannelHost; namespace ggl { @@ -32,8 +35,30 @@ bool Initialize(); // have completed. bool Terminate(); -// Create A GGL context for an offscreen 1 x 1 pbuffer. -Context* CreateContext(GpuChannelHost* channel); +// Create a GGL context that renders directly to a view. +Context* CreateViewContext(GpuChannelHost* channel, gfx::NativeViewId view); + +// Create a GGL context that renders to an offscreen frame buffer. If parent is +// not NULL, that context can access a copy of the created +// context's frame buffer that is updated every time SwapBuffers is called. It +// is not as general as shared contexts in other implementations of OpenGL. If +// parent is not NULL, it must be used on the same thread as the parent. A child +// context may not outlive its parent. +Context* CreateOffscreenContext(GpuChannelHost* channel, + Context* parent, + const gfx::Size& size); + +// Resize an offscreen frame buffer. The resize occurs on the next call to +// SwapBuffers. This is to avoid waiting until all pending GL calls have been +// executed by the GPU process. Everything rendered up to the call to +// SwapBuffers will be lost. A lost context will be reported if the resize +// fails. +void ResizeOffscreenContext(Context* context, const gfx::Size& size); + +// For an offscreen frame buffer context, return the texture ID with +// respect to the parent context. Returns zero if context does not have a +// parent. +uint32 GetParentTextureId(Context* context); // Set the current GGL context for the calling thread. bool MakeCurrent(Context* context); @@ -41,7 +66,10 @@ bool MakeCurrent(Context* context); // Get the calling thread's current GGL context. Context* GetCurrentContext(); -// Display everything that has been rendered since the last call. +// For a view context, display everything that has been rendered since the +// last call. For an offscreen context, resolve everything that has been +// rendered since the last call to a copy that can be accessed by the parent +// context. bool SwapBuffers(); // Destroy the given GGL context. |