| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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) |
| OLD | NEW |