| 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 "chrome/renderer/pepper_plugin_delegate_impl.h" | 5 #include "chrome/renderer/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/surface/transport_dib.h" | 10 #include "app/surface/transport_dib.h" |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 if (!dib) | 508 if (!dib) |
| 509 return NULL; | 509 return NULL; |
| 510 #endif | 510 #endif |
| 511 | 511 |
| 512 return new PlatformImage2DImpl(width, height, dib); | 512 return new PlatformImage2DImpl(width, height, dib); |
| 513 } | 513 } |
| 514 | 514 |
| 515 webkit::ppapi::PluginDelegate::PlatformContext3D* | 515 webkit::ppapi::PluginDelegate::PlatformContext3D* |
| 516 PepperPluginDelegateImpl::CreateContext3D() { | 516 PepperPluginDelegateImpl::CreateContext3D() { |
| 517 #ifdef ENABLE_GPU | 517 #ifdef ENABLE_GPU |
| 518 // If accelerated compositing of plugins is disabled, fail to create a 3D |
| 519 // context, because it won't be visible. This allows graceful fallback in the |
| 520 // modules. |
| 521 if (!render_view_->webkit_preferences().accelerated_plugins_enabled) |
| 522 return NULL; |
| 518 WebGraphicsContext3DCommandBufferImpl* context = | 523 WebGraphicsContext3DCommandBufferImpl* context = |
| 519 static_cast<WebGraphicsContext3DCommandBufferImpl*>( | 524 static_cast<WebGraphicsContext3DCommandBufferImpl*>( |
| 520 render_view_->webview()->graphicsContext3D()); | 525 render_view_->webview()->graphicsContext3D()); |
| 521 if (!context) | 526 if (!context) |
| 522 return NULL; | 527 return NULL; |
| 523 | 528 |
| 524 ggl::Context* parent_context = context->context(); | 529 ggl::Context* parent_context = context->context(); |
| 525 if (!parent_context) | 530 if (!parent_context) |
| 526 return NULL; | 531 return NULL; |
| 527 | 532 |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 } | 874 } |
| 870 | 875 |
| 871 void PepperPluginDelegateImpl::DidStopLoading() { | 876 void PepperPluginDelegateImpl::DidStopLoading() { |
| 872 render_view_->DidStopLoadingForPlugin(); | 877 render_view_->DidStopLoadingForPlugin(); |
| 873 } | 878 } |
| 874 | 879 |
| 875 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { | 880 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { |
| 876 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( | 881 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( |
| 877 render_view_->routing_id(), restrictions)); | 882 render_view_->routing_id(), restrictions)); |
| 878 } | 883 } |
| OLD | NEW |