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

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

Issue 3974004: Revert 63535 - Disable GPU features AcceleratingCompositing and WebGL by defa... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 2 months 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.cc ('k') | no next file » | 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 view_id = static_cast<gfx::NativeViewId>(plugin_handle_); 100 view_id = static_cast<gfx::NativeViewId>(plugin_handle_);
101 #endif 101 #endif
102 web_view_ = web_view; 102 web_view_ = web_view;
103 context_ = ggl::CreateViewContext( 103 context_ = ggl::CreateViewContext(
104 host, 104 host,
105 view_id, 105 view_id,
106 renderview->routing_id(), 106 renderview->routing_id(),
107 kWebGraphicsContext3DPerferredGLExtensions, 107 kWebGraphicsContext3DPerferredGLExtensions,
108 attribs); 108 attribs);
109 } else { 109 } else {
110 bool compositing_enabled = CommandLine::ForCurrentProcess()->HasSwitch( 110 bool compositing_enabled = !CommandLine::ForCurrentProcess()->HasSwitch(
111 switches::kEnableAcceleratedCompositing); 111 switches::kDisableAcceleratedCompositing);
112 ggl::Context* parent_context = NULL; 112 ggl::Context* parent_context = NULL;
113 // If GPU compositing is enabled we need to create a GL context that shares 113 // If GPU compositing is enabled we need to create a GL context that shares
114 // resources with the compositor's context. 114 // resources with the compositor's context.
115 if (compositing_enabled) { 115 if (compositing_enabled) {
116 // Asking for the WebGraphicsContext3D on the WebView will force one to 116 // Asking for the WebGraphicsContext3D on the WebView will force one to
117 // be created if it doesn't already exist. When the compositor is created 117 // be created if it doesn't already exist. When the compositor is created
118 // for the view it will use the same context. 118 // for the view it will use the same context.
119 WebKit::WebGraphicsContext3D* view_context = 119 WebKit::WebGraphicsContext3D* view_context =
120 web_view->graphicsContext3D(); 120 web_view->graphicsContext3D();
121 if (view_context) { 121 if (view_context) {
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 } 1021 }
1022 1022
1023 void WebGraphicsContext3DCommandBufferImpl::copyTextureToCompositor( 1023 void WebGraphicsContext3DCommandBufferImpl::copyTextureToCompositor(
1024 unsigned texture, unsigned parentTexture) { 1024 unsigned texture, unsigned parentTexture) {
1025 makeContextCurrent(); 1025 makeContextCurrent();
1026 glCopyTextureToParentTexture(texture, parentTexture); 1026 glCopyTextureToParentTexture(texture, parentTexture);
1027 glFlush(); 1027 glFlush();
1028 } 1028 }
1029 1029
1030 #endif // defined(ENABLE_GPU) 1030 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698