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 "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" | 7 #include "webkit/gpu/webgraphicscontext3d_in_process_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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 const char* preferred_extensions = attributes.noExtensions ? | 642 const char* preferred_extensions = attributes.noExtensions ? |
643 kWebGLPreferredGLExtensions : "*"; | 643 kWebGLPreferredGLExtensions : "*"; |
644 | 644 |
645 GURL active_url; | 645 GURL active_url; |
646 if (web_view && web_view->mainFrame()) | 646 if (web_view && web_view->mainFrame()) |
647 active_url = GURL(web_view->mainFrame()->document().url()); | 647 active_url = GURL(web_view->mainFrame()->document().url()); |
648 | 648 |
649 GLInProcessContext* parent_context = NULL; | 649 GLInProcessContext* parent_context = NULL; |
650 if (!render_directly_to_web_view) { | 650 if (!render_directly_to_web_view) { |
651 WebKit::WebGraphicsContext3D* view_context = | 651 WebKit::WebGraphicsContext3D* view_context = |
652 web_view->graphicsContext3D(); | 652 web_view ? web_view->graphicsContext3D() : NULL; |
653 if (view_context) { | 653 if (view_context) { |
654 WebGraphicsContext3DInProcessCommandBufferImpl* context_impl = | 654 WebGraphicsContext3DInProcessCommandBufferImpl* context_impl = |
655 static_cast<WebGraphicsContext3DInProcessCommandBufferImpl*>( | 655 static_cast<WebGraphicsContext3DInProcessCommandBufferImpl*>( |
656 view_context); | 656 view_context); |
657 parent_context = context_impl->context_; | 657 parent_context = context_impl->context_; |
658 } | 658 } |
659 } | 659 } |
660 | 660 |
661 // HACK: Assume this is a WebGL context by looking for the noExtensions | 661 // HACK: Assume this is a WebGL context by looking for the noExtensions |
662 // attribute. WebGL contexts must not go in the share group because they | 662 // attribute. WebGL contexts must not go in the share group because they |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 if (context_lost_callback_) { | 1629 if (context_lost_callback_) { |
1630 context_lost_callback_->onContextLost(); | 1630 context_lost_callback_->onContextLost(); |
1631 } | 1631 } |
1632 } | 1632 } |
1633 | 1633 |
1634 } // namespace gpu | 1634 } // namespace gpu |
1635 } // namespace webkit | 1635 } // namespace webkit |
1636 | 1636 |
1637 #endif // defined(ENABLE_GPU) | 1637 #endif // defined(ENABLE_GPU) |
1638 | 1638 |
OLD | NEW |