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