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/gpu/webgraphicscontext3d_command_buffer_impl.h" | 7 #include "content/renderer/gpu/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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 RendererGLContext* parent_context = NULL; | 107 RendererGLContext* parent_context = NULL; |
108 if (render_directly_to_web_view) { | 108 if (render_directly_to_web_view) { |
109 RenderView* renderview = RenderView::FromWebView(web_view); | 109 RenderView* renderview = RenderView::FromWebView(web_view); |
110 if (!renderview) | 110 if (!renderview) |
111 return false; | 111 return false; |
112 | 112 |
113 web_view_ = web_view; | 113 web_view_ = web_view; |
114 context_ = RendererGLContext::CreateViewContext( | 114 context_ = RendererGLContext::CreateViewContext( |
115 host, | 115 host, |
116 renderview->compositing_surface(), | |
117 renderview->routing_id(), | 116 renderview->routing_id(), |
118 preferred_extensions, | 117 preferred_extensions, |
119 attribs, | 118 attribs, |
120 active_url); | 119 active_url); |
121 if (context_) { | 120 if (context_) { |
122 context_->SetSwapBuffersCallback( | 121 context_->SetSwapBuffersCallback( |
123 NewCallback(this, | 122 NewCallback(this, |
124 &WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete)); | 123 &WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete)); |
125 } | 124 } |
126 } else { | 125 } else { |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 context_lost_callback_->onContextLost(); | 1030 context_lost_callback_->onContextLost(); |
1032 } | 1031 } |
1033 | 1032 |
1034 RenderView* renderview = | 1033 RenderView* renderview = |
1035 web_view_ ? RenderView::FromWebView(web_view_) : NULL; | 1034 web_view_ ? RenderView::FromWebView(web_view_) : NULL; |
1036 if (renderview) | 1035 if (renderview) |
1037 renderview->OnViewContextSwapBuffersAborted(); | 1036 renderview->OnViewContextSwapBuffersAborted(); |
1038 } | 1037 } |
1039 | 1038 |
1040 #endif // defined(ENABLE_GPU) | 1039 #endif // defined(ENABLE_GPU) |
OLD | NEW |