OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This API is consistent with other OpenGL setup APIs like window's WGL | 5 // This API is consistent with other OpenGL setup APIs like window's WGL |
6 // and pepper's PGL. This API is used to manage OpenGL RendererGLContexts in the | 6 // and pepper's PGL. This API is used to manage OpenGL RendererGLContexts in the |
7 // Chrome renderer process in a way that is consistent with other platforms. | 7 // Chrome renderer process in a way that is consistent with other platforms. |
8 | 8 |
9 #ifndef CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ | 9 #ifndef CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ |
10 #define CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ | 10 #define CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // already in place. We could add more entry points and messages to | 78 // already in place. We could add more entry points and messages to |
79 // allocate both fake PluginWindowHandles and NativeViewIds and map | 79 // allocate both fake PluginWindowHandles and NativeViewIds and map |
80 // from fake NativeViewIds to PluginWindowHandles, but this seems like | 80 // from fake NativeViewIds to PluginWindowHandles, but this seems like |
81 // unnecessary complexity at the moment. | 81 // unnecessary complexity at the moment. |
82 // | 82 // |
83 // The render_view_id is currently also only used on Mac OS X. | 83 // The render_view_id is currently also only used on Mac OS X. |
84 // TODO(kbr): clean up the arguments to this function and make them | 84 // TODO(kbr): clean up the arguments to this function and make them |
85 // more cross-platform. | 85 // more cross-platform. |
86 static RendererGLContext* CreateViewContext( | 86 static RendererGLContext* CreateViewContext( |
87 GpuChannelHost* channel, | 87 GpuChannelHost* channel, |
88 gfx::PluginWindowHandle render_surface, | |
89 int render_view_id, | 88 int render_view_id, |
90 const char* allowed_extensions, | 89 const char* allowed_extensions, |
91 const int32* attrib_list, | 90 const int32* attrib_list, |
92 const GURL& active_arl); | 91 const GURL& active_arl); |
93 | 92 |
94 #if defined(OS_MACOSX) | 93 #if defined(OS_MACOSX) |
95 // On Mac OS X only, view RendererGLContexts actually behave like offscreen | 94 // On Mac OS X only, view RendererGLContexts actually behave like offscreen |
96 // RendererGLContexts, and require an explicit resize operation which is | 95 // RendererGLContexts, and require an explicit resize operation which is |
97 // slightly different from that of offscreen RendererGLContexts. | 96 // slightly different from that of offscreen RendererGLContexts. |
98 void ResizeOnscreen(const gfx::Size& size); | 97 void ResizeOnscreen(const gfx::Size& size); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // for synchronization with parent context. If *this* context does not have a | 179 // for synchronization with parent context. If *this* context does not have a |
181 // parent context, these methods will return false. | 180 // parent context, these methods will return false. |
182 bool GetParentToChildLatch(uint32* parent_to_child_latch); | 181 bool GetParentToChildLatch(uint32* parent_to_child_latch); |
183 bool GetChildToParentLatch(uint32* child_to_parent_latch); | 182 bool GetChildToParentLatch(uint32* child_to_parent_latch); |
184 | 183 |
185 private: | 184 private: |
186 RendererGLContext(GpuChannelHost* channel, | 185 RendererGLContext(GpuChannelHost* channel, |
187 RendererGLContext* parent); | 186 RendererGLContext* parent); |
188 | 187 |
189 bool Initialize(bool onscreen, | 188 bool Initialize(bool onscreen, |
190 gfx::PluginWindowHandle render_surface, | |
191 int render_view_id, | 189 int render_view_id, |
192 const gfx::Size& size, | 190 const gfx::Size& size, |
193 const char* allowed_extensions, | 191 const char* allowed_extensions, |
194 const int32* attrib_list, | 192 const int32* attrib_list, |
195 const GURL& active_url); | 193 const GURL& active_url); |
196 void Destroy(); | 194 void Destroy(); |
197 | 195 |
198 void OnSwapBuffers(); | 196 void OnSwapBuffers(); |
199 void OnContextLost(); | 197 void OnContextLost(); |
200 | 198 |
(...skipping 10 matching lines...) Expand all Loading... |
211 int32 transfer_buffer_id_; | 209 int32 transfer_buffer_id_; |
212 gpu::gles2::GLES2Implementation* gles2_implementation_; | 210 gpu::gles2::GLES2Implementation* gles2_implementation_; |
213 gfx::Size size_; | 211 gfx::Size size_; |
214 Error last_error_; | 212 Error last_error_; |
215 int frame_number_; | 213 int frame_number_; |
216 | 214 |
217 DISALLOW_COPY_AND_ASSIGN(RendererGLContext); | 215 DISALLOW_COPY_AND_ASSIGN(RendererGLContext); |
218 }; | 216 }; |
219 | 217 |
220 #endif // CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ | 218 #endif // CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ |
OLD | NEW |