Chromium Code Reviews| 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_; | |
|
piman
2012/01/30 18:10:23
I'm not sure caching this is a valid thing to do.
| |
| 4500 | |
| 4501 queried_for_swapbuffers_complete_callback_ = true; | |
| 4502 | |
| 4498 WebKit::WebGraphicsContext3D* context = webview()->graphicsContext3D(); | 4503 WebKit::WebGraphicsContext3D* context = webview()->graphicsContext3D(); |
| 4499 if (!context) | 4504 if (context) { |
| 4500 return false; | 4505 context->makeContextCurrent(); |
| 4501 std::string extensions(context->getRequestableExtensionsCHROMIUM().utf8()); | 4506 std::string extensions(context->getRequestableExtensionsCHROMIUM().utf8()); |
| 4502 return extensions.find("GL_CHROMIUM_swapbuffers_complete_callback") != | 4507 context_has_swapbuffers_complete_callback_ = |
| 4503 std::string::npos; | 4508 extensions.find("GL_CHROMIUM_swapbuffers_complete_callback") |
| 4509 != std::string::npos; | |
| 4510 } | |
| 4511 | |
| 4512 return context_has_swapbuffers_complete_callback_; | |
| 4504 } | 4513 } |
| 4505 | 4514 |
| 4506 void RenderViewImpl::OnSetFocus(bool enable) { | 4515 void RenderViewImpl::OnSetFocus(bool enable) { |
| 4507 RenderWidget::OnSetFocus(enable); | 4516 RenderWidget::OnSetFocus(enable); |
| 4508 | 4517 |
| 4509 if (webview() && webview()->isActive()) { | 4518 if (webview() && webview()->isActive()) { |
| 4510 // Notify all NPAPI plugins. | 4519 // Notify all NPAPI plugins. |
| 4511 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 4520 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
| 4512 for (plugin_it = plugin_delegates_.begin(); | 4521 for (plugin_it = plugin_delegates_.begin(); |
| 4513 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 4522 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4948 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4957 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 4949 return !!RenderThreadImpl::current()->compositor_thread(); | 4958 return !!RenderThreadImpl::current()->compositor_thread(); |
| 4950 } | 4959 } |
| 4951 | 4960 |
| 4952 void RenderViewImpl::OnJavaBridgeInit() { | 4961 void RenderViewImpl::OnJavaBridgeInit() { |
| 4953 DCHECK(!java_bridge_dispatcher_.get()); | 4962 DCHECK(!java_bridge_dispatcher_.get()); |
| 4954 #if defined(ENABLE_JAVA_BRIDGE) | 4963 #if defined(ENABLE_JAVA_BRIDGE) |
| 4955 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 4964 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
| 4956 #endif | 4965 #endif |
| 4957 } | 4966 } |
| OLD | NEW |