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

Side by Side Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 290573007: cc: Move gpu rasterization flag from tree-impl to tree-host-impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated unittests Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1709 } 1709 }
1710 1710
1711 TEST_F(PictureLayerImplTest, NoLowResTilingWithGpuRasterization) { 1711 TEST_F(PictureLayerImplTest, NoLowResTilingWithGpuRasterization) {
1712 gfx::Size default_tile_size(host_impl_.settings().default_tile_size); 1712 gfx::Size default_tile_size(host_impl_.settings().default_tile_size);
1713 gfx::Size layer_bounds(default_tile_size.width() * 4, 1713 gfx::Size layer_bounds(default_tile_size.width() * 4,
1714 default_tile_size.height() * 4); 1714 default_tile_size.height() * 4);
1715 float result_scale_x, result_scale_y; 1715 float result_scale_x, result_scale_y;
1716 gfx::Size result_bounds; 1716 gfx::Size result_bounds;
1717 1717
1718 SetupDefaultTrees(layer_bounds); 1718 SetupDefaultTrees(layer_bounds);
1719 EXPECT_FALSE(pending_layer_->use_gpu_rasterization()); 1719 EXPECT_FALSE(host_impl_.use_gpu_rasterization());
1720 EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings()); 1720 EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings());
1721 pending_layer_->CalculateContentsScale(1.f, 1721 pending_layer_->CalculateContentsScale(1.f,
1722 1.f, 1722 1.f,
1723 1.f, 1723 1.f,
1724 1.f, 1724 1.f,
1725 false, 1725 false,
1726 &result_scale_x, 1726 &result_scale_x,
1727 &result_scale_y, 1727 &result_scale_y,
1728 &result_bounds); 1728 &result_bounds);
1729 // Should have a low-res and a high-res tiling. 1729 // Should have a low-res and a high-res tiling.
1730 ASSERT_EQ(2u, pending_layer_->tilings()->num_tilings()); 1730 ASSERT_EQ(2u, pending_layer_->tilings()->num_tilings());
1731 1731
1732 ResetTilingsAndRasterScales(); 1732 ResetTilingsAndRasterScales();
1733 1733
1734 host_impl_.pending_tree()->SetUseGpuRasterization(true); 1734 host_impl_.SetUseGpuRasterization(true);
1735 EXPECT_TRUE(pending_layer_->use_gpu_rasterization()); 1735 EXPECT_TRUE(host_impl_.use_gpu_rasterization());
1736 pending_layer_->CalculateContentsScale(1.f, 1736 pending_layer_->CalculateContentsScale(1.f,
1737 1.f, 1737 1.f,
1738 1.f, 1738 1.f,
1739 1.f, 1739 1.f,
1740 false, 1740 false,
1741 &result_scale_x, 1741 &result_scale_x,
1742 &result_scale_y, 1742 &result_scale_y,
1743 &result_bounds); 1743 &result_bounds);
1744 // Should only have the high-res tiling. 1744 // Should only have the high-res tiling.
1745 ASSERT_EQ(1u, pending_layer_->tilings()->num_tilings()); 1745 ASSERT_EQ(1u, pending_layer_->tilings()->num_tilings());
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 SetContentsScaleOnBothLayers(contents_scale, 2283 SetContentsScaleOnBothLayers(contents_scale,
2284 device_scale, 2284 device_scale,
2285 page_scale, 2285 page_scale,
2286 maximum_animation_scale, 2286 maximum_animation_scale,
2287 animating_transform); 2287 animating_transform);
2288 EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 1.f); 2288 EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 1.f);
2289 } 2289 }
2290 2290
2291 } // namespace 2291 } // namespace
2292 } // namespace cc 2292 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698