Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Unified Diff: chrome/renderer/ggl/ggl.h

Issue 1136006: Calling OpenGL from the renderer process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/command_buffer_proxy.cc ('k') | chrome/renderer/ggl/ggl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/ggl/ggl.h
===================================================================
--- chrome/renderer/ggl/ggl.h (revision 42644)
+++ chrome/renderer/ggl/ggl.h (working copy)
@@ -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,16 +35,41 @@
// 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);
// 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.
« no previous file with comments | « chrome/renderer/command_buffer_proxy.cc ('k') | chrome/renderer/ggl/ggl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698