Chromium Code Reviews| Index: content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h |
| diff --git a/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h b/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h |
| index 0749fa74e41e7a0f0e20bab7ad1acdd450b987db..e2afb4ff22ae9fd756f708a7a0681738840117a0 100644 |
| --- a/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h |
| +++ b/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h |
| @@ -13,6 +13,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/task.h" |
| #include "content/renderer/gpu/renderer_gl_context.h" |
| +#include "googleurl/src/gurl.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| @@ -58,6 +59,11 @@ class WebGraphicsContext3DCommandBufferImpl |
| WebKit::WebView*, |
| bool renderDirectlyToWebView); |
| + // Must be called after initialize() and before any of the following methods. |
| + // Permanently binds to the first calling thread. Returns false if the |
| + // graphics context fails to create. Do not call from more than one thread. |
| + // TODO(husky): Document threading restrictions in WebGraphicsContext3D.h, |
|
lain Merrick
2011/09/09 10:42:47
Is this TODO still accurate? Happy to pick it up,
nduca
2011/09/09 15:47:19
I'll land a comment on the WebGraphicsContext.h si
|
| + // enforce strictly in all implementations. |
| virtual bool makeContextCurrent(); |
| virtual int width(); |
| @@ -437,6 +443,12 @@ class WebGraphicsContext3DCommandBufferImpl |
| #endif |
| private: |
| + // Initialize the underlying GL context. May be called multiple times; second |
| + // and subsequent calls are ignored. Must be called from the thread that is |
| + // going to use this object to issue GL commands (which might not be the main |
| + // thread). |
| + bool MaybeInitializeGL(); |
| + |
| // SwapBuffers callback. |
| void OnSwapBuffersComplete(); |
| virtual void OnContextLost(RendererGLContext::ContextLostReason reason); |
| @@ -446,6 +458,11 @@ class WebGraphicsContext3DCommandBufferImpl |
| // The GLES2Implementation we use for OpenGL rendering. |
| gpu::gles2::GLES2Implementation* gl_; |
| + // State needed by MaybeInitializeGL. |
| + GpuChannelHost* host_; |
| + GURL active_url_; |
| + int32 render_view_routing_id_; |
| + |
| bool render_directly_to_web_view_; |
| #ifndef WTF_USE_THREADED_COMPOSITING |
| // If rendering directly to WebView, weak pointer to it. |