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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.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, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest_damage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index f388371f89f7ff192d284dec3eaed633ee35ca59..5c7447f1df1aa6ce8378fa1371e89272d9934a6d 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -2316,8 +2316,8 @@ void LayerTreeHostImplTest::SetupMouseMoveAtWithDeviceScale(
settings.scrollbar_animator = LayerTreeSettings::THINNING;
gfx::Size viewport_size(300, 200);
- gfx::Size device_viewport_size = gfx::ToFlooredSize(
- gfx::ScaleSize(viewport_size, device_scale_factor));
+ gfx::Size device_viewport_size =
+ gfx::ScaleToFlooredSize(viewport_size, device_scale_factor);
gfx::Size content_size(1000, 1000);
CreateHostImpl(settings, CreateOutputSurface());
@@ -3642,12 +3642,14 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsAspectRatio) {
host_impl_->active_tree()->OuterViewportContainerLayer();
LayerImpl* inner_container =
host_impl_->active_tree()->InnerViewportContainerLayer();
- EXPECT_EQ(gfx::Size(100, 100+25), inner_container->BoundsForScrolling());
+ EXPECT_EQ(gfx::SizeF(100.f, 100.f + 25.f),
+ inner_container->BoundsForScrolling());
// Outer viewport should match inner's aspect ratio. The bounds are ceiled.
float aspect_ratio = inner_container->BoundsForScrolling().width() /
inner_container->BoundsForScrolling().height();
- gfx::Size expected = gfx::ToCeiledSize(gfx::SizeF(200, 200 / aspect_ratio));
+ gfx::SizeF expected =
+ gfx::SizeF(gfx::ToCeiledSize(gfx::SizeF(200, 200 / aspect_ratio)));
EXPECT_EQ(expected, outer_container->BoundsForScrolling());
EXPECT_EQ(expected,
host_impl_->InnerViewportScrollLayer()->BoundsForScrolling());
@@ -4712,7 +4714,7 @@ TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) {
host_impl_->pending_tree()->PushPageScaleFromMainThread(1.f, 1.f, 1.f);
CreateScrollAndContentsLayers(host_impl_->pending_tree(), new_size);
host_impl_->ActivateSyncTree();
- EXPECT_EQ(new_size, scroll_watcher.scrollable_size());
+ EXPECT_EQ(gfx::SizeF(new_size), scroll_watcher.scrollable_size());
// Tear down the LayerTreeHostImpl before the InputHandlerClient.
host_impl_.reset();
@@ -5492,7 +5494,7 @@ class LayerTreeHostImplViewportCoveredTest : public LayerTreeHostImplTest {
continue;
const TextureDrawQuad* texture_quad = TextureDrawQuad::MaterialCast(quad);
gfx::SizeF gutter_texture_size_pixels = gfx::ScaleSize(
- gutter_texture_size_, host_impl_->device_scale_factor());
+ gfx::SizeF(gutter_texture_size_), host_impl_->device_scale_factor());
EXPECT_EQ(texture_quad->uv_top_left.x(),
texture_quad->rect.x() / gutter_texture_size_pixels.width());
EXPECT_EQ(texture_quad->uv_top_left.y(),
@@ -5507,8 +5509,7 @@ class LayerTreeHostImplViewportCoveredTest : public LayerTreeHostImplTest {
}
gfx::Size DipSizeToPixelSize(const gfx::Size& size) {
- return gfx::ToRoundedSize(
- gfx::ScaleSize(size, host_impl_->device_scale_factor()));
+ return gfx::ScaleToRoundedSize(size, host_impl_->device_scale_factor());
}
DrawQuad::Material gutter_quad_material_;
@@ -6281,7 +6282,7 @@ TEST_F(LayerTreeHostImplTest, FarAwayQuadsDontNeedAA) {
host_impl_->SetDeviceScaleFactor(device_scale_factor);
gfx::Size root_size(2000, 1000);
gfx::Size device_viewport_size =
- gfx::ToCeiledSize(gfx::ScaleSize(root_size, device_scale_factor));
+ gfx::ScaleToCeiledSize(root_size, device_scale_factor);
host_impl_->SetViewportSize(device_viewport_size);
host_impl_->CreatePendingTree();
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest_damage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698