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 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2032 fullscreen_container_->SetLayer(NULL); | 2032 fullscreen_container_->SetLayer(NULL); |
2033 web_layer_.reset(); | 2033 web_layer_.reset(); |
2034 texture_layer_ = NULL; | 2034 texture_layer_ = NULL; |
2035 compositor_layer_ = NULL; | 2035 compositor_layer_ = NULL; |
2036 } | 2036 } |
2037 | 2037 |
2038 if (want_texture_layer) { | 2038 if (want_texture_layer) { |
2039 bool opaque = false; | 2039 bool opaque = false; |
2040 if (want_3d_layer) { | 2040 if (want_3d_layer) { |
2041 DCHECK(bound_graphics_3d_.get()); | 2041 DCHECK(bound_graphics_3d_.get()); |
2042 texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL); | 2042 texture_layer_ = cc::TextureLayer::CreateForMailbox( |
| 2043 cc_blink::WebLayerImpl::LayerSettings(), NULL); |
2043 opaque = bound_graphics_3d_->IsOpaque(); | 2044 opaque = bound_graphics_3d_->IsOpaque(); |
2044 texture_layer_->SetTextureMailboxWithoutReleaseCallback( | 2045 texture_layer_->SetTextureMailboxWithoutReleaseCallback( |
2045 cc::TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point)); | 2046 cc::TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point)); |
2046 } else { | 2047 } else { |
2047 DCHECK(bound_graphics_2d_platform_); | 2048 DCHECK(bound_graphics_2d_platform_); |
2048 texture_layer_ = cc::TextureLayer::CreateForMailbox(this); | 2049 texture_layer_ = cc::TextureLayer::CreateForMailbox( |
| 2050 cc_blink::WebLayerImpl::LayerSettings(), this); |
2049 bound_graphics_2d_platform_->AttachedToNewLayer(); | 2051 bound_graphics_2d_platform_->AttachedToNewLayer(); |
2050 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); | 2052 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); |
2051 texture_layer_->SetFlipped(false); | 2053 texture_layer_->SetFlipped(false); |
2052 } | 2054 } |
2053 | 2055 |
2054 // Ignore transparency in fullscreen, since that's what Flash always | 2056 // Ignore transparency in fullscreen, since that's what Flash always |
2055 // wants to do, and that lets it not recreate a context if | 2057 // wants to do, and that lets it not recreate a context if |
2056 // wmode=transparent was specified. | 2058 // wmode=transparent was specified. |
2057 opaque = opaque || fullscreen_container_; | 2059 opaque = opaque || fullscreen_container_; |
2058 texture_layer_->SetContentsOpaque(opaque); | 2060 texture_layer_->SetContentsOpaque(opaque); |
(...skipping 1283 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 |