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

Side by Side Diff: chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc

Issue 5835007: Revert 69511 - Make Graphics3D::SwapBuffers take a completion callback... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years 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 | « chrome/renderer/render_view.h ('k') | ppapi/c/dev/ppb_graphics_3d_dev.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h" 7 #include "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h"
8 8
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 #ifndef GL_GLEXT_PROTOTYPES 10 #ifndef GL_GLEXT_PROTOTYPES
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 /*opaque=*/true, /*root=*/true); 109 /*opaque=*/true, /*root=*/true);
110 view_id = static_cast<gfx::NativeViewId>(plugin_handle_); 110 view_id = static_cast<gfx::NativeViewId>(plugin_handle_);
111 #endif 111 #endif
112 web_view_ = web_view; 112 web_view_ = web_view;
113 context_ = ggl::CreateViewContext( 113 context_ = ggl::CreateViewContext(
114 host, 114 host,
115 view_id, 115 view_id,
116 renderview->routing_id(), 116 renderview->routing_id(),
117 kWebGraphicsContext3DPerferredGLExtensions, 117 kWebGraphicsContext3DPerferredGLExtensions,
118 attribs); 118 attribs);
119 if (context_) {
120 ggl::SetSwapBuffersCallback(
121 context_,
122 NewCallback(renderview, &RenderView::DidFlushPaint));
123 }
124 } else { 119 } else {
125 bool compositing_enabled = !CommandLine::ForCurrentProcess()->HasSwitch( 120 bool compositing_enabled = !CommandLine::ForCurrentProcess()->HasSwitch(
126 switches::kDisableAcceleratedCompositing); 121 switches::kDisableAcceleratedCompositing);
127 ggl::Context* parent_context = NULL; 122 ggl::Context* parent_context = NULL;
128 // If GPU compositing is enabled we need to create a GL context that shares 123 // If GPU compositing is enabled we need to create a GL context that shares
129 // resources with the compositor's context. 124 // resources with the compositor's context.
130 if (compositing_enabled) { 125 if (compositing_enabled) {
131 // Asking for the WebGraphicsContext3D on the WebView will force one to 126 // Asking for the WebGraphicsContext3D on the WebView will force one to
132 // be created if it doesn't already exist. When the compositor is created 127 // be created if it doesn't already exist. When the compositor is created
133 // for the view it will use the same context. 128 // for the view it will use the same context.
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 } 1022 }
1028 1023
1029 void WebGraphicsContext3DCommandBufferImpl::copyTextureToCompositor( 1024 void WebGraphicsContext3DCommandBufferImpl::copyTextureToCompositor(
1030 unsigned texture, unsigned parentTexture) { 1025 unsigned texture, unsigned parentTexture) {
1031 makeContextCurrent(); 1026 makeContextCurrent();
1032 glCopyTextureToParentTextureCHROMIUM(texture, parentTexture); 1027 glCopyTextureToParentTextureCHROMIUM(texture, parentTexture);
1033 glFlush(); 1028 glFlush();
1034 } 1029 }
1035 1030
1036 #endif // defined(ENABLE_GPU) 1031 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.h ('k') | ppapi/c/dev/ppb_graphics_3d_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698