Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 1357423009: gfx: Make conversions from Size to SizeF be explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sizefconvert-gfx: . Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_graphics_2d_host.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698