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 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1255 static void TileExists(bool exists, Tile* tile, | 1255 static void TileExists(bool exists, Tile* tile, |
1256 const gfx::Rect& geometry_rect) { | 1256 const gfx::Rect& geometry_rect) { |
1257 EXPECT_EQ(exists, tile != NULL) << geometry_rect.ToString(); | 1257 EXPECT_EQ(exists, tile != NULL) << geometry_rect.ToString(); |
1258 } | 1258 } |
1259 | 1259 |
1260 TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { | 1260 TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { |
1261 FakeOutputSurfaceClient output_surface_client; | 1261 FakeOutputSurfaceClient output_surface_client; |
1262 scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); | 1262 scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); |
1263 CHECK(output_surface->BindToClient(&output_surface_client)); | 1263 CHECK(output_surface->BindToClient(&output_surface_client)); |
1264 TestSharedBitmapManager shared_bitmap_manager; | 1264 TestSharedBitmapManager shared_bitmap_manager; |
1265 scoped_ptr<ResourceProvider> resource_provider = | 1265 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( |
1266 ResourceProvider::Create(output_surface.get(), | 1266 output_surface.get(), &shared_bitmap_manager, NULL, NULL, 0, false, 1); |
1267 &shared_bitmap_manager, | |
1268 NULL, | |
1269 NULL, | |
1270 0, | |
1271 false, | |
1272 1, | |
1273 false); | |
1274 | 1267 |
1275 FakePictureLayerTilingClient client(resource_provider.get()); | 1268 FakePictureLayerTilingClient client(resource_provider.get()); |
1276 scoped_ptr<TestablePictureLayerTiling> tiling; | 1269 scoped_ptr<TestablePictureLayerTiling> tiling; |
1277 | 1270 |
1278 gfx::Rect viewport(50, 50, 100, 100); | 1271 gfx::Rect viewport(50, 50, 100, 100); |
1279 gfx::Size layer_bounds(2000, 2000); | 1272 gfx::Size layer_bounds(2000, 2000); |
1280 | 1273 |
1281 client.SetTileSize(gfx::Size(30, 30)); | 1274 client.SetTileSize(gfx::Size(30, 30)); |
1282 client.set_tree(ACTIVE_TREE); | 1275 client.set_tree(ACTIVE_TREE); |
1283 | 1276 |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2172 EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); | 2165 EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); |
2173 | 2166 |
2174 // Reset the active tiling. The recycle tiles should be released too. | 2167 // Reset the active tiling. The recycle tiles should be released too. |
2175 active_tiling->Reset(); | 2168 active_tiling->Reset(); |
2176 EXPECT_FALSE(active_tiling->TileAt(0, 0)); | 2169 EXPECT_FALSE(active_tiling->TileAt(0, 0)); |
2177 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); | 2170 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); |
2178 } | 2171 } |
2179 | 2172 |
2180 } // namespace | 2173 } // namespace |
2181 } // namespace cc | 2174 } // namespace cc |
OLD | NEW |