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 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 } | 1516 } |
1517 // Set the UV coordinates of the texture based on the size of the Graphics2D | 1517 // Set the UV coordinates of the texture based on the size of the Graphics2D |
1518 // context. By default a texture gets scaled to the size of the layer. But | 1518 // context. By default a texture gets scaled to the size of the layer. But |
1519 // if the size of the Graphics2D context doesn't match the size of the plugin | 1519 // if the size of the Graphics2D context doesn't match the size of the plugin |
1520 // then it will be incorrectly stretched. This also affects how the plugin | 1520 // then it will be incorrectly stretched. This also affects how the plugin |
1521 // is painted when it is being resized. If the Graphics2D contents are | 1521 // is painted when it is being resized. If the Graphics2D contents are |
1522 // stretched when a plugin is resized while waiting for a new frame from the | 1522 // stretched when a plugin is resized while waiting for a new frame from the |
1523 // plugin to be rendered, then flickering behavior occurs as in | 1523 // plugin to be rendered, then flickering behavior occurs as in |
1524 // crbug.com/353453. | 1524 // crbug.com/353453. |
1525 gfx::SizeF graphics_2d_size_in_dip = | 1525 gfx::SizeF graphics_2d_size_in_dip = |
1526 gfx::ScaleSize(bound_graphics_2d_platform_->Size(), | 1526 gfx::ScaleSize(gfx::SizeF(bound_graphics_2d_platform_->Size()), |
1527 bound_graphics_2d_platform_->GetScale()); | 1527 bound_graphics_2d_platform_->GetScale()); |
1528 gfx::Size plugin_size_in_dip(view_data_.rect.size.width, | 1528 gfx::Size plugin_size_in_dip(view_data_.rect.size.width, |
1529 view_data_.rect.size.height); | 1529 view_data_.rect.size.height); |
1530 | 1530 |
1531 texture_layer_->SetUV( | 1531 texture_layer_->SetUV( |
1532 gfx::PointF(0.0f, 0.0f), | 1532 gfx::PointF(0.0f, 0.0f), |
1533 gfx::PointF( | 1533 gfx::PointF( |
1534 plugin_size_in_dip.width() / graphics_2d_size_in_dip.width(), | 1534 plugin_size_in_dip.width() / graphics_2d_size_in_dip.width(), |
1535 plugin_size_in_dip.height() / graphics_2d_size_in_dip.height())); | 1535 plugin_size_in_dip.height() / graphics_2d_size_in_dip.height())); |
1536 } | 1536 } |
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3272 | 3272 |
3273 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { | 3273 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { |
3274 if (initialized_ && !javascript_used_ && is_flash_plugin_) { | 3274 if (initialized_ && !javascript_used_ && is_flash_plugin_) { |
3275 javascript_used_ = true; | 3275 javascript_used_ = true; |
3276 RenderThread::Get()->RecordAction( | 3276 RenderThread::Get()->RecordAction( |
3277 base::UserMetricsAction("Flash.JavaScriptUsed")); | 3277 base::UserMetricsAction("Flash.JavaScriptUsed")); |
3278 } | 3278 } |
3279 } | 3279 } |
3280 | 3280 |
3281 } // namespace content | 3281 } // namespace content |
OLD | NEW |