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/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 | 766 |
767 void PepperPluginInstanceImpl::CommitBackingTexture() { | 767 void PepperPluginInstanceImpl::CommitBackingTexture() { |
768 if (!texture_layer_.get()) | 768 if (!texture_layer_.get()) |
769 return; | 769 return; |
770 gpu::Mailbox mailbox; | 770 gpu::Mailbox mailbox; |
771 uint32 sync_point = 0; | 771 uint32 sync_point = 0; |
772 bound_graphics_3d_->GetBackingMailbox(&mailbox, &sync_point); | 772 bound_graphics_3d_->GetBackingMailbox(&mailbox, &sync_point); |
773 DCHECK(!mailbox.IsZero()); | 773 DCHECK(!mailbox.IsZero()); |
774 DCHECK_NE(sync_point, 0u); | 774 DCHECK_NE(sync_point, 0u); |
775 texture_layer_->SetTextureMailboxWithoutReleaseCallback( | 775 texture_layer_->SetTextureMailboxWithoutReleaseCallback( |
776 cc::TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point)); | 776 cc::TextureMailbox(mailbox, gpu::SyncToken(sync_point), GL_TEXTURE_2D)); |
777 texture_layer_->SetNeedsDisplay(); | 777 texture_layer_->SetNeedsDisplay(); |
778 } | 778 } |
779 | 779 |
780 void PepperPluginInstanceImpl::InstanceCrashed() { | 780 void PepperPluginInstanceImpl::InstanceCrashed() { |
781 // Force free all resources and vars. | 781 // Force free all resources and vars. |
782 HostGlobals::Get()->InstanceCrashed(pp_instance()); | 782 HostGlobals::Get()->InstanceCrashed(pp_instance()); |
783 | 783 |
784 // Free any associated graphics. | 784 // Free any associated graphics. |
785 SetFullscreen(false); | 785 SetFullscreen(false); |
786 FlashSetFullscreen(false, false); | 786 FlashSetFullscreen(false, false); |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 } | 1997 } |
1998 | 1998 |
1999 if (want_texture_layer) { | 1999 if (want_texture_layer) { |
2000 bool opaque = false; | 2000 bool opaque = false; |
2001 if (want_3d_layer) { | 2001 if (want_3d_layer) { |
2002 DCHECK(bound_graphics_3d_.get()); | 2002 DCHECK(bound_graphics_3d_.get()); |
2003 texture_layer_ = cc::TextureLayer::CreateForMailbox( | 2003 texture_layer_ = cc::TextureLayer::CreateForMailbox( |
2004 cc_blink::WebLayerImpl::LayerSettings(), NULL); | 2004 cc_blink::WebLayerImpl::LayerSettings(), NULL); |
2005 opaque = bound_graphics_3d_->IsOpaque(); | 2005 opaque = bound_graphics_3d_->IsOpaque(); |
2006 texture_layer_->SetTextureMailboxWithoutReleaseCallback( | 2006 texture_layer_->SetTextureMailboxWithoutReleaseCallback( |
2007 cc::TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point)); | 2007 cc::TextureMailbox(mailbox, gpu::SyncToken(sync_point), |
| 2008 GL_TEXTURE_2D)); |
2008 } else { | 2009 } else { |
2009 DCHECK(bound_graphics_2d_platform_); | 2010 DCHECK(bound_graphics_2d_platform_); |
2010 texture_layer_ = cc::TextureLayer::CreateForMailbox( | 2011 texture_layer_ = cc::TextureLayer::CreateForMailbox( |
2011 cc_blink::WebLayerImpl::LayerSettings(), this); | 2012 cc_blink::WebLayerImpl::LayerSettings(), this); |
2012 bound_graphics_2d_platform_->AttachedToNewLayer(); | 2013 bound_graphics_2d_platform_->AttachedToNewLayer(); |
2013 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); | 2014 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); |
2014 texture_layer_->SetFlipped(false); | 2015 texture_layer_->SetFlipped(false); |
2015 } | 2016 } |
2016 | 2017 |
2017 // Ignore transparency in fullscreen, since that's what Flash always | 2018 // Ignore transparency in fullscreen, since that's what Flash always |
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3276 | 3277 |
3277 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { | 3278 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { |
3278 if (initialized_ && !javascript_used_ && is_flash_plugin_) { | 3279 if (initialized_ && !javascript_used_ && is_flash_plugin_) { |
3279 javascript_used_ = true; | 3280 javascript_used_ = true; |
3280 RenderThread::Get()->RecordAction( | 3281 RenderThread::Get()->RecordAction( |
3281 base::UserMetricsAction("Flash.JavaScriptUsed")); | 3282 base::UserMetricsAction("Flash.JavaScriptUsed")); |
3282 } | 3283 } |
3283 } | 3284 } |
3284 | 3285 |
3285 } // namespace content | 3286 } // namespace content |
OLD | NEW |