| 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 #include "content/renderer/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 PepperPluginDelegateImpl::CreateContext3D() { | 894 PepperPluginDelegateImpl::CreateContext3D() { |
| 895 #ifdef ENABLE_GPU | 895 #ifdef ENABLE_GPU |
| 896 // If accelerated compositing of plugins is disabled, fail to create a 3D | 896 // If accelerated compositing of plugins is disabled, fail to create a 3D |
| 897 // context, because it won't be visible. This allows graceful fallback in the | 897 // context, because it won't be visible. This allows graceful fallback in the |
| 898 // modules. | 898 // modules. |
| 899 if (!render_view_->webkit_preferences().accelerated_plugins_enabled) | 899 if (!render_view_->webkit_preferences().accelerated_plugins_enabled) |
| 900 return NULL; | 900 return NULL; |
| 901 WebGraphicsContext3DCommandBufferImpl* context = | 901 WebGraphicsContext3DCommandBufferImpl* context = |
| 902 static_cast<WebGraphicsContext3DCommandBufferImpl*>( | 902 static_cast<WebGraphicsContext3DCommandBufferImpl*>( |
| 903 render_view_->webview()->graphicsContext3D()); | 903 render_view_->webview()->graphicsContext3D()); |
| 904 if (!context || context->isContextLost()) | 904 if (!context) |
| 905 return NULL; |
| 906 if (!context->makeContextCurrent() || context->isContextLost()) |
| 905 return NULL; | 907 return NULL; |
| 906 | 908 |
| 907 RendererGLContext* parent_context = context->context(); | 909 RendererGLContext* parent_context = context->context(); |
| 908 if (!parent_context) | 910 if (!parent_context) |
| 909 return NULL; | 911 return NULL; |
| 910 | 912 |
| 911 return new PlatformContext3DImpl(parent_context); | 913 return new PlatformContext3DImpl(parent_context); |
| 912 #else | 914 #else |
| 913 return NULL; | 915 return NULL; |
| 914 #endif | 916 #endif |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 | 1478 |
| 1477 int PepperPluginDelegateImpl::GetRoutingId() const { | 1479 int PepperPluginDelegateImpl::GetRoutingId() const { |
| 1478 return render_view_->routing_id(); | 1480 return render_view_->routing_id(); |
| 1479 } | 1481 } |
| 1480 | 1482 |
| 1481 void PepperPluginDelegateImpl::PublishInitialPolicy( | 1483 void PepperPluginDelegateImpl::PublishInitialPolicy( |
| 1482 scoped_refptr<webkit::ppapi::PluginInstance> instance, | 1484 scoped_refptr<webkit::ppapi::PluginInstance> instance, |
| 1483 const std::string& policy) { | 1485 const std::string& policy) { |
| 1484 instance->HandlePolicyUpdate(policy); | 1486 instance->HandlePolicyUpdate(policy); |
| 1485 } | 1487 } |
| OLD | NEW |