| 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 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 static void TileExists(bool exists, Tile* tile, | 1237 static void TileExists(bool exists, Tile* tile, |
| 1238 const gfx::Rect& geometry_rect) { | 1238 const gfx::Rect& geometry_rect) { |
| 1239 EXPECT_EQ(exists, tile != NULL) << geometry_rect.ToString(); | 1239 EXPECT_EQ(exists, tile != NULL) << geometry_rect.ToString(); |
| 1240 } | 1240 } |
| 1241 | 1241 |
| 1242 TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { | 1242 TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { |
| 1243 FakeOutputSurfaceClient output_surface_client; | 1243 FakeOutputSurfaceClient output_surface_client; |
| 1244 scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); | 1244 scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); |
| 1245 CHECK(output_surface->BindToClient(&output_surface_client)); | 1245 CHECK(output_surface->BindToClient(&output_surface_client)); |
| 1246 TestSharedBitmapManager shared_bitmap_manager; | 1246 TestSharedBitmapManager shared_bitmap_manager; |
| 1247 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( | 1247 scoped_ptr<ResourceProvider> resource_provider = |
| 1248 output_surface.get(), &shared_bitmap_manager, NULL, 0, false, 1, false); | 1248 ResourceProvider::Create(output_surface.get(), |
| 1249 &shared_bitmap_manager, |
| 1250 NULL, |
| 1251 NULL, |
| 1252 0, |
| 1253 false, |
| 1254 1, |
| 1255 false); |
| 1249 | 1256 |
| 1250 FakePictureLayerTilingClient client(resource_provider.get()); | 1257 FakePictureLayerTilingClient client(resource_provider.get()); |
| 1251 scoped_ptr<TestablePictureLayerTiling> tiling; | 1258 scoped_ptr<TestablePictureLayerTiling> tiling; |
| 1252 | 1259 |
| 1253 gfx::Rect viewport(50, 50, 100, 100); | 1260 gfx::Rect viewport(50, 50, 100, 100); |
| 1254 gfx::Size layer_bounds(2000, 2000); | 1261 gfx::Size layer_bounds(2000, 2000); |
| 1255 | 1262 |
| 1256 client.SetTileSize(gfx::Size(30, 30)); | 1263 client.SetTileSize(gfx::Size(30, 30)); |
| 1257 client.set_tree(ACTIVE_TREE); | 1264 client.set_tree(ACTIVE_TREE); |
| 1258 | 1265 |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2162 EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); | 2169 EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); |
| 2163 | 2170 |
| 2164 // Reset the active tiling. The recycle tiles should be released too. | 2171 // Reset the active tiling. The recycle tiles should be released too. |
| 2165 active_tiling->Reset(); | 2172 active_tiling->Reset(); |
| 2166 EXPECT_FALSE(active_tiling->TileAt(0, 0)); | 2173 EXPECT_FALSE(active_tiling->TileAt(0, 0)); |
| 2167 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); | 2174 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); |
| 2168 } | 2175 } |
| 2169 | 2176 |
| 2170 } // namespace | 2177 } // namespace |
| 2171 } // namespace cc | 2178 } // namespace cc |
| OLD | NEW |