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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 &WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete, | 285 &WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete, |
286 weak_ptr_factory_.GetWeakPtr())); | 286 weak_ptr_factory_.GetWeakPtr())); |
287 #if defined(OS_MACOSX) | 287 #if defined(OS_MACOSX) |
288 // It appears that making the compositor's on-screen context current on | 288 // It appears that making the compositor's on-screen context current on |
289 // other platforms implies this flush. TODO(kbr): this means that the | 289 // other platforms implies this flush. TODO(kbr): this means that the |
290 // TOUCH build and, in the future, other platforms might need this. | 290 // TOUCH build and, in the future, other platforms might need this. |
291 gl_->Flush(); | 291 gl_->Flush(); |
292 #endif | 292 #endif |
293 } | 293 } |
294 | 294 |
| 295 void WebGraphicsContext3DCommandBufferImpl::postSubBufferCHROMIUM( |
| 296 int x, int y, int width, int height) { |
| 297 // Same flow control as WebGraphicsContext3DCommandBufferImpl::prepareTexture |
| 298 // (see above). |
| 299 RenderViewImpl* renderview = |
| 300 web_view_ ? RenderViewImpl::FromWebView(web_view_) : NULL; |
| 301 if (renderview) |
| 302 renderview->OnViewContextSwapBuffersPosted(); |
| 303 gl_->PostSubBufferCHROMIUM(x, y, width, height); |
| 304 context_->Echo(base::Bind( |
| 305 &WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete, |
| 306 weak_ptr_factory_.GetWeakPtr())); |
| 307 } |
| 308 |
295 void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) { | 309 void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) { |
296 cached_width_ = width; | 310 cached_width_ = width; |
297 cached_height_ = height; | 311 cached_height_ = height; |
298 | 312 |
299 gl_->ResizeCHROMIUM(width, height); | 313 gl_->ResizeCHROMIUM(width, height); |
300 | 314 |
301 #ifdef FLIP_FRAMEBUFFER_VERTICALLY | 315 #ifdef FLIP_FRAMEBUFFER_VERTICALLY |
302 scanline_.reset(new uint8[width * 4]); | 316 scanline_.reset(new uint8[width * 4]); |
303 #endif // FLIP_FRAMEBUFFER_VERTICALLY | 317 #endif // FLIP_FRAMEBUFFER_VERTICALLY |
304 } | 318 } |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 if (context_lost_callback_) { | 1170 if (context_lost_callback_) { |
1157 context_lost_callback_->onContextLost(); | 1171 context_lost_callback_->onContextLost(); |
1158 } | 1172 } |
1159 RenderViewImpl* renderview = | 1173 RenderViewImpl* renderview = |
1160 web_view_ ? RenderViewImpl::FromWebView(web_view_) : NULL; | 1174 web_view_ ? RenderViewImpl::FromWebView(web_view_) : NULL; |
1161 if (renderview) | 1175 if (renderview) |
1162 renderview->OnViewContextSwapBuffersAborted(); | 1176 renderview->OnViewContextSwapBuffersAborted(); |
1163 } | 1177 } |
1164 | 1178 |
1165 #endif // defined(ENABLE_GPU) | 1179 #endif // defined(ENABLE_GPU) |
OLD | NEW |