| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| (...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2035 texture_layer_->ClearClient(); | 2035 texture_layer_->ClearClient(); |
| 2036 texture_layer_ = NULL; | 2036 texture_layer_ = NULL; |
| 2037 } | 2037 } |
| 2038 compositor_layer_ = NULL; | 2038 compositor_layer_ = NULL; |
| 2039 } | 2039 } |
| 2040 | 2040 |
| 2041 if (want_texture_layer) { | 2041 if (want_texture_layer) { |
| 2042 bool opaque = false; | 2042 bool opaque = false; |
| 2043 if (want_3d_layer) { | 2043 if (want_3d_layer) { |
| 2044 DCHECK(bound_graphics_3d_.get()); | 2044 DCHECK(bound_graphics_3d_.get()); |
| 2045 texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL); | 2045 texture_layer_ = cc::TextureLayer::CreateForMailbox( |
| 2046 cc_blink::WebLayerImpl::LayerSettings(), NULL); |
| 2046 opaque = bound_graphics_3d_->IsOpaque(); | 2047 opaque = bound_graphics_3d_->IsOpaque(); |
| 2047 texture_layer_->SetTextureMailboxWithoutReleaseCallback( | 2048 texture_layer_->SetTextureMailboxWithoutReleaseCallback( |
| 2048 cc::TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point)); | 2049 cc::TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point)); |
| 2049 } else { | 2050 } else { |
| 2050 DCHECK(bound_graphics_2d_platform_); | 2051 DCHECK(bound_graphics_2d_platform_); |
| 2051 texture_layer_ = cc::TextureLayer::CreateForMailbox(this); | 2052 texture_layer_ = cc::TextureLayer::CreateForMailbox( |
| 2053 cc_blink::WebLayerImpl::LayerSettings(), this); |
| 2052 bound_graphics_2d_platform_->AttachedToNewLayer(); | 2054 bound_graphics_2d_platform_->AttachedToNewLayer(); |
| 2053 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); | 2055 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); |
| 2054 texture_layer_->SetFlipped(false); | 2056 texture_layer_->SetFlipped(false); |
| 2055 } | 2057 } |
| 2056 | 2058 |
| 2057 // Ignore transparency in fullscreen, since that's what Flash always | 2059 // Ignore transparency in fullscreen, since that's what Flash always |
| 2058 // wants to do, and that lets it not recreate a context if | 2060 // wants to do, and that lets it not recreate a context if |
| 2059 // wmode=transparent was specified. | 2061 // wmode=transparent was specified. |
| 2060 opaque = opaque || fullscreen_container_; | 2062 opaque = opaque || fullscreen_container_; |
| 2061 texture_layer_->SetContentsOpaque(opaque); | 2063 texture_layer_->SetContentsOpaque(opaque); |
| (...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3342 | 3344 |
| 3343 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { | 3345 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { |
| 3344 if (initialized_ && !javascript_used_ && is_flash_plugin_) { | 3346 if (initialized_ && !javascript_used_ && is_flash_plugin_) { |
| 3345 javascript_used_ = true; | 3347 javascript_used_ = true; |
| 3346 RenderThread::Get()->RecordAction( | 3348 RenderThread::Get()->RecordAction( |
| 3347 base::UserMetricsAction("Flash.JavaScriptUsed")); | 3349 base::UserMetricsAction("Flash.JavaScriptUsed")); |
| 3348 } | 3350 } |
| 3349 } | 3351 } |
| 3350 | 3352 |
| 3351 } // namespace content | 3353 } // namespace content |
| OLD | NEW |