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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 const gfx::Rect& geometry_rect) { | 941 const gfx::Rect& geometry_rect) { |
942 EXPECT_EQ(exists, tile != NULL) << geometry_rect.ToString(); | 942 EXPECT_EQ(exists, tile != NULL) << geometry_rect.ToString(); |
943 } | 943 } |
944 | 944 |
945 TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { | 945 TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { |
946 FakeOutputSurfaceClient output_surface_client; | 946 FakeOutputSurfaceClient output_surface_client; |
947 scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); | 947 scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); |
948 CHECK(output_surface->BindToClient(&output_surface_client)); | 948 CHECK(output_surface->BindToClient(&output_surface_client)); |
949 TestSharedBitmapManager shared_bitmap_manager; | 949 TestSharedBitmapManager shared_bitmap_manager; |
950 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( | 950 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( |
951 output_surface.get(), &shared_bitmap_manager, 0, false, 1); | 951 output_surface.get(), &shared_bitmap_manager, 0, false, 1, false); |
952 | 952 |
953 FakePictureLayerTilingClient client(resource_provider.get()); | 953 FakePictureLayerTilingClient client(resource_provider.get()); |
954 scoped_ptr<TestablePictureLayerTiling> tiling; | 954 scoped_ptr<TestablePictureLayerTiling> tiling; |
955 | 955 |
956 gfx::Rect viewport(50, 50, 100, 100); | 956 gfx::Rect viewport(50, 50, 100, 100); |
957 gfx::Size layer_bounds(200, 200); | 957 gfx::Size layer_bounds(200, 200); |
958 | 958 |
959 client.SetTileSize(gfx::Size(30, 30)); | 959 client.SetTileSize(gfx::Size(30, 30)); |
960 | 960 |
961 tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); | 961 tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1706 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 1706 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
1707 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); | 1707 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); |
1708 | 1708 |
1709 priority = tiling->TileAt(1, 0)->priority(ACTIVE_TREE); | 1709 priority = tiling->TileAt(1, 0)->priority(ACTIVE_TREE); |
1710 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 1710 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
1711 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); | 1711 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); |
1712 } | 1712 } |
1713 | 1713 |
1714 } // namespace | 1714 } // namespace |
1715 } // namespace cc | 1715 } // namespace cc |
OLD | NEW |