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

Side by Side Diff: content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc

Issue 8512005: Plumb through EGL_NV_post_sub_buffer and GLX_MESA_copy_sub_buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h ('k') | gpu/GLES2/gl2ext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h ('k') | gpu/GLES2/gl2ext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698