OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 4477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4488 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 4488 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
4489 (*plugin_it)->SetContainerVisibility(true); | 4489 (*plugin_it)->SetContainerVisibility(true); |
4490 } | 4490 } |
4491 #endif // OS_MACOSX | 4491 #endif // OS_MACOSX |
4492 } | 4492 } |
4493 | 4493 |
4494 bool RenderViewImpl::SupportsAsynchronousSwapBuffers() { | 4494 bool RenderViewImpl::SupportsAsynchronousSwapBuffers() { |
4495 if (WebWidgetHandlesCompositorScheduling()) | 4495 if (WebWidgetHandlesCompositorScheduling()) |
4496 return false; | 4496 return false; |
4497 | 4497 |
4498 if (queried_for_swapbuffers_complete_callback_) | |
4499 return context_has_swapbuffers_complete_callback_; | |
4500 | |
4501 queried_for_swapbuffers_complete_callback_ = true; | |
4502 | |
4503 WebKit::WebGraphicsContext3D* context = webview()->graphicsContext3D(); | 4498 WebKit::WebGraphicsContext3D* context = webview()->graphicsContext3D(); |
4504 if (context) { | 4499 if (!context) |
4505 context->makeContextCurrent(); | 4500 return false; |
4506 std::string extensions(context->getRequestableExtensionsCHROMIUM().utf8()); | 4501 std::string extensions(context->getRequestableExtensionsCHROMIUM().utf8()); |
4507 context_has_swapbuffers_complete_callback_ = | 4502 return extensions.find("GL_CHROMIUM_swapbuffers_complete_callback") != |
4508 extensions.find("GL_CHROMIUM_swapbuffers_complete_callback") | 4503 std::string::npos; |
4509 != std::string::npos; | |
4510 } | |
4511 | |
4512 return context_has_swapbuffers_complete_callback_; | |
4513 } | 4504 } |
4514 | 4505 |
4515 void RenderViewImpl::OnSetFocus(bool enable) { | 4506 void RenderViewImpl::OnSetFocus(bool enable) { |
4516 RenderWidget::OnSetFocus(enable); | 4507 RenderWidget::OnSetFocus(enable); |
4517 | 4508 |
4518 if (webview() && webview()->isActive()) { | 4509 if (webview() && webview()->isActive()) { |
4519 // Notify all NPAPI plugins. | 4510 // Notify all NPAPI plugins. |
4520 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 4511 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
4521 for (plugin_it = plugin_delegates_.begin(); | 4512 for (plugin_it = plugin_delegates_.begin(); |
4522 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 4513 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4957 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4948 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
4958 return !!RenderThreadImpl::current()->compositor_thread(); | 4949 return !!RenderThreadImpl::current()->compositor_thread(); |
4959 } | 4950 } |
4960 | 4951 |
4961 void RenderViewImpl::OnJavaBridgeInit() { | 4952 void RenderViewImpl::OnJavaBridgeInit() { |
4962 DCHECK(!java_bridge_dispatcher_.get()); | 4953 DCHECK(!java_bridge_dispatcher_.get()); |
4963 #if defined(ENABLE_JAVA_BRIDGE) | 4954 #if defined(ENABLE_JAVA_BRIDGE) |
4964 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 4955 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
4965 #endif | 4956 #endif |
4966 } | 4957 } |
OLD | NEW |