OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/resources/picture_layer_tiling.h" | 5 #include "cc/resources/picture_layer_tiling.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1017 EXPECT_TRUE(have_tiles[TilePriority::NOW]); | 1017 EXPECT_TRUE(have_tiles[TilePriority::NOW]); |
1018 EXPECT_TRUE(have_tiles[TilePriority::SOON]); | 1018 EXPECT_TRUE(have_tiles[TilePriority::SOON]); |
1019 EXPECT_TRUE(have_tiles[TilePriority::EVENTUALLY]); | 1019 EXPECT_TRUE(have_tiles[TilePriority::EVENTUALLY]); |
1020 } | 1020 } |
1021 | 1021 |
1022 static void TileExists(bool exists, Tile* tile, | 1022 static void TileExists(bool exists, Tile* tile, |
1023 const gfx::Rect& geometry_rect) { | 1023 const gfx::Rect& geometry_rect) { |
1024 EXPECT_EQ(exists, tile != NULL) << geometry_rect.ToString(); | 1024 EXPECT_EQ(exists, tile != NULL) << geometry_rect.ToString(); |
1025 } | 1025 } |
1026 | 1026 |
1027 #if !1 | |
vmpstr
2014/07/28 23:32:07
I'll fix this if this is the approach we want to t
| |
1027 TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { | 1028 TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { |
1028 FakeOutputSurfaceClient output_surface_client; | 1029 FakeOutputSurfaceClient output_surface_client; |
1029 scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); | 1030 scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); |
1030 CHECK(output_surface->BindToClient(&output_surface_client)); | 1031 CHECK(output_surface->BindToClient(&output_surface_client)); |
1031 TestSharedBitmapManager shared_bitmap_manager; | 1032 TestSharedBitmapManager shared_bitmap_manager; |
1032 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( | 1033 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( |
1033 output_surface.get(), &shared_bitmap_manager, 0, false, 1, false); | 1034 output_surface.get(), &shared_bitmap_manager, 0, false, 1, false); |
1034 | 1035 |
1035 FakePictureLayerTilingClient client(resource_provider.get()); | 1036 FakePictureLayerTilingClient client(resource_provider.get()); |
1036 scoped_ptr<TestablePictureLayerTiling> tiling; | 1037 scoped_ptr<TestablePictureLayerTiling> tiling; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1078 EXPECT_LE(tile->priority(ACTIVE_TREE).distance_to_visible, | 1079 EXPECT_LE(tile->priority(ACTIVE_TREE).distance_to_visible, |
1079 last_tile->priority(ACTIVE_TREE).distance_to_visible); | 1080 last_tile->priority(ACTIVE_TREE).distance_to_visible); |
1080 } | 1081 } |
1081 last_tile = tile; | 1082 last_tile = tile; |
1082 eviction_tiles.insert(tile); | 1083 eviction_tiles.insert(tile); |
1083 } | 1084 } |
1084 | 1085 |
1085 EXPECT_GT(all_tiles_set.size(), 0u); | 1086 EXPECT_GT(all_tiles_set.size(), 0u); |
1086 EXPECT_EQ(all_tiles_set, eviction_tiles); | 1087 EXPECT_EQ(all_tiles_set, eviction_tiles); |
1087 } | 1088 } |
1089 #endif | |
1088 | 1090 |
1089 TEST_F(PictureLayerTilingIteratorTest, TilesExist) { | 1091 TEST_F(PictureLayerTilingIteratorTest, TilesExist) { |
1090 gfx::Size layer_bounds(1099, 801); | 1092 gfx::Size layer_bounds(1099, 801); |
1091 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); | 1093 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); |
1092 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); | 1094 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); |
1093 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); | 1095 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); |
1094 | 1096 |
1095 tiling_->UpdateTilePriorities( | 1097 tiling_->UpdateTilePriorities( |
1096 ACTIVE_TREE, | 1098 ACTIVE_TREE, |
1097 gfx::Rect(layer_bounds), // visible content rect | 1099 gfx::Rect(layer_bounds), // visible content rect |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1840 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 1842 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
1841 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); | 1843 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); |
1842 | 1844 |
1843 priority = tiling->TileAt(1, 0)->priority(ACTIVE_TREE); | 1845 priority = tiling->TileAt(1, 0)->priority(ACTIVE_TREE); |
1844 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 1846 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
1845 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); | 1847 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); |
1846 } | 1848 } |
1847 | 1849 |
1848 } // namespace | 1850 } // namespace |
1849 } // namespace cc | 1851 } // namespace cc |
OLD | NEW |