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 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 const gfx::Rect& geometry_rect) { | 1249 const gfx::Rect& geometry_rect) { |
1250 EXPECT_EQ(exists, tile != NULL) << geometry_rect.ToString(); | 1250 EXPECT_EQ(exists, tile != NULL) << geometry_rect.ToString(); |
1251 } | 1251 } |
1252 | 1252 |
1253 TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { | 1253 TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { |
1254 FakeOutputSurfaceClient output_surface_client; | 1254 FakeOutputSurfaceClient output_surface_client; |
1255 scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); | 1255 scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); |
1256 CHECK(output_surface->BindToClient(&output_surface_client)); | 1256 CHECK(output_surface->BindToClient(&output_surface_client)); |
1257 TestSharedBitmapManager shared_bitmap_manager; | 1257 TestSharedBitmapManager shared_bitmap_manager; |
1258 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( | 1258 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( |
1259 output_surface.get(), &shared_bitmap_manager, 0, false, 1, false); | 1259 output_surface.get(), &shared_bitmap_manager, NULL, 0, false, 1, false); |
1260 | 1260 |
1261 FakePictureLayerTilingClient client(resource_provider.get()); | 1261 FakePictureLayerTilingClient client(resource_provider.get()); |
1262 scoped_ptr<TestablePictureLayerTiling> tiling; | 1262 scoped_ptr<TestablePictureLayerTiling> tiling; |
1263 | 1263 |
1264 gfx::Rect viewport(50, 50, 100, 100); | 1264 gfx::Rect viewport(50, 50, 100, 100); |
1265 gfx::Size layer_bounds(2000, 2000); | 1265 gfx::Size layer_bounds(2000, 2000); |
1266 | 1266 |
1267 client.SetTileSize(gfx::Size(30, 30)); | 1267 client.SetTileSize(gfx::Size(30, 30)); |
1268 client.set_tree(ACTIVE_TREE); | 1268 client.set_tree(ACTIVE_TREE); |
1269 | 1269 |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2276 EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); | 2276 EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); |
2277 | 2277 |
2278 // Reset the active tiling. The recycle tiles should be released too. | 2278 // Reset the active tiling. The recycle tiles should be released too. |
2279 active_tiling->Reset(); | 2279 active_tiling->Reset(); |
2280 EXPECT_FALSE(active_tiling->TileAt(0, 0)); | 2280 EXPECT_FALSE(active_tiling->TileAt(0, 0)); |
2281 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); | 2281 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); |
2282 } | 2282 } |
2283 | 2283 |
2284 } // namespace | 2284 } // namespace |
2285 } // namespace cc | 2285 } // namespace cc |
OLD | NEW |