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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 7 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
8 | 8 |
9 #include "gpu/GLES2/gl2.h" | 9 #include "gpu/GLES2/gl2.h" |
10 #ifndef GL_GLEXT_PROTOTYPES | 10 #ifndef GL_GLEXT_PROTOTYPES |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 void WebGraphicsContext3DCommandBufferImpl::prepareTexture() { | 228 void WebGraphicsContext3DCommandBufferImpl::prepareTexture() { |
229 // Copies the contents of the off-screen render target into the texture | 229 // Copies the contents of the off-screen render target into the texture |
230 // used by the compositor. | 230 // used by the compositor. |
231 #ifndef WTF_USE_THREADED_COMPOSITING | 231 #ifndef WTF_USE_THREADED_COMPOSITING |
232 RenderView* renderview = | 232 RenderView* renderview = |
233 web_view_ ? RenderView::FromWebView(web_view_) : NULL; | 233 web_view_ ? RenderView::FromWebView(web_view_) : NULL; |
234 if (renderview) | 234 if (renderview) |
235 renderview->OnViewContextSwapBuffersPosted(); | 235 renderview->OnViewContextSwapBuffersPosted(); |
236 #endif | 236 #endif |
237 context_->SwapBuffers(); | 237 context_->SwapBuffers(); |
| 238 #if defined(OS_MACOSX) |
| 239 // It appears that making the compositor's on-screen context current on |
| 240 // other platforms implies this flush. TODO(kbr): this means that the |
| 241 // TOUCH build and, in the future, other platforms might need this. |
| 242 gl_->Flush(); |
| 243 #endif |
238 } | 244 } |
239 | 245 |
240 void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) { | 246 void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) { |
241 cached_width_ = width; | 247 cached_width_ = width; |
242 cached_height_ = height; | 248 cached_height_ = height; |
243 | 249 |
244 gl_->ResizeCHROMIUM(width, height); | 250 gl_->ResizeCHROMIUM(width, height); |
245 | 251 |
246 #ifdef FLIP_FRAMEBUFFER_VERTICALLY | 252 #ifdef FLIP_FRAMEBUFFER_VERTICALLY |
247 scanline_.reset(new uint8[width * 4]); | 253 scanline_.reset(new uint8[width * 4]); |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 } | 1065 } |
1060 #ifndef WTF_USE_THREADED_COMPOSITING | 1066 #ifndef WTF_USE_THREADED_COMPOSITING |
1061 RenderView* renderview = | 1067 RenderView* renderview = |
1062 web_view_ ? RenderView::FromWebView(web_view_) : NULL; | 1068 web_view_ ? RenderView::FromWebView(web_view_) : NULL; |
1063 if (renderview) | 1069 if (renderview) |
1064 renderview->OnViewContextSwapBuffersAborted(); | 1070 renderview->OnViewContextSwapBuffersAborted(); |
1065 #endif | 1071 #endif |
1066 } | 1072 } |
1067 | 1073 |
1068 #endif // defined(ENABLE_GPU) | 1074 #endif // defined(ENABLE_GPU) |
OLD | NEW |