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/webgraphicscontext3d_command_buffer_impl.h" | 7 #include "content/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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 active_url = GURL(web_view->mainFrame()->url()); | 93 active_url = GURL(web_view->mainFrame()->url()); |
94 | 94 |
95 if (render_directly_to_web_view) { | 95 if (render_directly_to_web_view) { |
96 RenderView* renderview = RenderView::FromWebView(web_view); | 96 RenderView* renderview = RenderView::FromWebView(web_view); |
97 if (!renderview) | 97 if (!renderview) |
98 return false; | 98 return false; |
99 | 99 |
100 web_view_ = web_view; | 100 web_view_ = web_view; |
101 context_ = RendererGLContext::CreateViewContext( | 101 context_ = RendererGLContext::CreateViewContext( |
102 host, | 102 host, |
| 103 renderview->compositing_surface(), |
103 renderview->routing_id(), | 104 renderview->routing_id(), |
104 kWebGraphicsContext3DPerferredGLExtensions, | 105 kWebGraphicsContext3DPerferredGLExtensions, |
105 attribs, | 106 attribs, |
106 active_url); | 107 active_url); |
107 if (context_) { | 108 if (context_) { |
108 context_->SetSwapBuffersCallback( | 109 context_->SetSwapBuffersCallback( |
109 NewCallback(this, | 110 NewCallback(this, |
110 &WebGraphicsContext3DCommandBufferImpl::OnSwapBuffers)); | 111 &WebGraphicsContext3DCommandBufferImpl::OnSwapBuffers)); |
111 } | 112 } |
112 } else { | 113 } else { |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 context_lost_callback_ = cb; | 1057 context_lost_callback_ = cb; |
1057 } | 1058 } |
1058 | 1059 |
1059 void WebGraphicsContext3DCommandBufferImpl::OnContextLost() { | 1060 void WebGraphicsContext3DCommandBufferImpl::OnContextLost() { |
1060 if (context_lost_callback_) { | 1061 if (context_lost_callback_) { |
1061 context_lost_callback_->onContextLost(); | 1062 context_lost_callback_->onContextLost(); |
1062 } | 1063 } |
1063 } | 1064 } |
1064 | 1065 |
1065 #endif // defined(ENABLE_GPU) | 1066 #endif // defined(ENABLE_GPU) |
OLD | NEW |