Index: cc/resources/picture_layer_tiling_unittest.cc |
diff --git a/cc/resources/picture_layer_tiling_unittest.cc b/cc/resources/picture_layer_tiling_unittest.cc |
index 183ecf88e702c9b1e757a501e4b481d95bf933f3..9a270e7cc7488f850c25d2e45f53c20c840da079 100644 |
--- a/cc/resources/picture_layer_tiling_unittest.cc |
+++ b/cc/resources/picture_layer_tiling_unittest.cc |
@@ -859,7 +859,7 @@ TEST(PictureLayerTilingTest, ExpandRectEqual) { |
gfx::Rect bounds(-1000, -1000, 10000, 10000); |
int64 target_area = 100 * 200; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(in.ToString(), out.ToString()); |
} |
@@ -868,7 +868,7 @@ TEST(PictureLayerTilingTest, ExpandRectSmaller) { |
gfx::Rect bounds(-1000, -1000, 10000, 10000); |
int64 target_area = 100 * 100; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(out.bottom() - in.bottom(), in.y() - out.y()); |
EXPECT_EQ(out.right() - in.right(), in.x() - out.x()); |
EXPECT_EQ(out.width() - in.width(), out.height() - in.height()); |
@@ -885,7 +885,7 @@ TEST(PictureLayerTilingTest, ExpandRectUnbounded) { |
gfx::Rect bounds(-1000, -1000, 10000, 10000); |
int64 target_area = 200 * 200; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(out.bottom() - in.bottom(), in.y() - out.y()); |
EXPECT_EQ(out.right() - in.right(), in.x() - out.x()); |
EXPECT_EQ(out.width() - in.width(), out.height() - in.height()); |
@@ -898,7 +898,7 @@ TEST(PictureLayerTilingTest, ExpandRectBoundedSmaller) { |
gfx::Rect bounds(50, 60, 40, 30); |
int64 target_area = 200 * 200; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(bounds.ToString(), out.ToString()); |
} |
@@ -907,7 +907,7 @@ TEST(PictureLayerTilingTest, ExpandRectBoundedEqual) { |
gfx::Rect bounds = in; |
int64 target_area = 200 * 200; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(bounds.ToString(), out.ToString()); |
} |
@@ -916,7 +916,7 @@ TEST(PictureLayerTilingTest, ExpandRectBoundedSmallerStretchVertical) { |
gfx::Rect bounds(45, 0, 90, 300); |
int64 target_area = 200 * 200; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(bounds.ToString(), out.ToString()); |
} |
@@ -925,7 +925,7 @@ TEST(PictureLayerTilingTest, ExpandRectBoundedEqualStretchVertical) { |
gfx::Rect bounds(40, 0, 100, 300); |
int64 target_area = 200 * 200; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(bounds.ToString(), out.ToString()); |
} |
@@ -934,7 +934,7 @@ TEST(PictureLayerTilingTest, ExpandRectBoundedSmallerStretchHorizontal) { |
gfx::Rect bounds(0, 55, 180, 190); |
int64 target_area = 200 * 200; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(bounds.ToString(), out.ToString()); |
} |
@@ -943,7 +943,7 @@ TEST(PictureLayerTilingTest, ExpandRectBoundedEqualStretchHorizontal) { |
gfx::Rect bounds(0, 50, 180, 200); |
int64 target_area = 200 * 200; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(bounds.ToString(), out.ToString()); |
} |
@@ -952,7 +952,7 @@ TEST(PictureLayerTilingTest, ExpandRectBoundedLeft) { |
gfx::Rect bounds(20, -1000, 10000, 10000); |
int64 target_area = 200 * 200; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(out.bottom() - in.bottom(), in.y() - out.y()); |
EXPECT_EQ(out.bottom() - in.bottom(), out.right() - in.right()); |
EXPECT_LE(out.width() * out.height(), target_area); |
@@ -966,7 +966,7 @@ TEST(PictureLayerTilingTest, ExpandRectBoundedRight) { |
gfx::Rect bounds(-1000, -1000, 1000+120, 10000); |
int64 target_area = 200 * 200; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(out.bottom() - in.bottom(), in.y() - out.y()); |
EXPECT_EQ(out.bottom() - in.bottom(), in.x() - out.x()); |
EXPECT_LE(out.width() * out.height(), target_area); |
@@ -980,7 +980,7 @@ TEST(PictureLayerTilingTest, ExpandRectBoundedTop) { |
gfx::Rect bounds(-1000, 30, 10000, 10000); |
int64 target_area = 200 * 200; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(out.right() - in.right(), in.x() - out.x()); |
EXPECT_EQ(out.right() - in.right(), out.bottom() - in.bottom()); |
EXPECT_LE(out.width() * out.height(), target_area); |
@@ -994,7 +994,7 @@ TEST(PictureLayerTilingTest, ExpandRectBoundedBottom) { |
gfx::Rect bounds(-1000, -1000, 10000, 1000 + 220); |
int64 target_area = 200 * 200; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(out.right() - in.right(), in.x() - out.x()); |
EXPECT_EQ(out.right() - in.right(), in.y() - out.y()); |
EXPECT_LE(out.width() * out.height(), target_area); |
@@ -1008,7 +1008,7 @@ TEST(PictureLayerTilingTest, ExpandRectSquishedHorizontally) { |
gfx::Rect bounds(0, -4000, 100+40+20, 100000); |
int64 target_area = 400 * 400; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(20, out.right() - in.right()); |
EXPECT_EQ(40, in.x() - out.x()); |
EXPECT_EQ(out.bottom() - in.bottom(), in.y() - out.y()); |
@@ -1023,7 +1023,7 @@ TEST(PictureLayerTilingTest, ExpandRectSquishedVertically) { |
gfx::Rect bounds(-4000, 0, 100000, 200+50+30); |
int64 target_area = 400 * 400; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(30, out.bottom() - in.bottom()); |
EXPECT_EQ(50, in.y() - out.y()); |
EXPECT_EQ(out.right() - in.right(), in.x() - out.x()); |
@@ -1038,7 +1038,7 @@ TEST(PictureLayerTilingTest, ExpandRectOutOfBoundsFarAway) { |
gfx::Rect bounds(0, 0, 10, 10); |
int64 target_area = 400 * 400; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_TRUE(out.IsEmpty()); |
} |
@@ -1047,7 +1047,7 @@ TEST(PictureLayerTilingTest, ExpandRectOutOfBoundsExpandedFullyCover) { |
gfx::Rect bounds(0, 0, 10, 10); |
int64 target_area = 400 * 400; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(bounds.ToString(), out.ToString()); |
} |
@@ -1056,7 +1056,7 @@ TEST(PictureLayerTilingTest, ExpandRectOutOfBoundsExpandedPartlyCover) { |
gfx::Rect bounds(0, 0, 500, 500); |
int64 target_area = 400 * 400; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_EQ(bounds.right(), out.right()); |
EXPECT_EQ(bounds.bottom(), out.bottom()); |
EXPECT_LE(out.width() * out.height(), target_area); |
@@ -1072,7 +1072,7 @@ TEST(PictureLayerTilingTest, EmptyStartingRect) { |
gfx::Rect bounds(0, 0, 10, 10); |
int64 target_area = 400 * 400; |
gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
- in, target_area, bounds, NULL); |
+ in, target_area, bounds, nullptr); |
EXPECT_TRUE(out.IsEmpty()); |
} |
@@ -1207,7 +1207,7 @@ TEST(PictureLayerTilingTest, TilingRasterTileIteratorMovingViewport) { |
// There are 3 bins in TilePriority. |
bool have_tiles[3] = {}; |
- Tile* last_tile = NULL; |
+ Tile* last_tile = nullptr; |
int eventually_bin_order_correct_count = 0; |
int eventually_bin_order_incorrect_count = 0; |
for (PictureLayerTiling::TilingRasterTileIterator it(tiling.get()); it; |
@@ -1250,7 +1250,7 @@ TEST(PictureLayerTilingTest, TilingRasterTileIteratorMovingViewport) { |
static void TileExists(bool exists, Tile* tile, |
const gfx::Rect& geometry_rect) { |
- EXPECT_EQ(exists, tile != NULL) << geometry_rect.ToString(); |
+ EXPECT_EQ(exists, tile != nullptr) << geometry_rect.ToString(); |
} |
TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { |
@@ -1258,8 +1258,14 @@ TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { |
scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d(); |
CHECK(output_surface->BindToClient(&output_surface_client)); |
TestSharedBitmapManager shared_bitmap_manager; |
- scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( |
- output_surface.get(), &shared_bitmap_manager, NULL, 0, false, 1, false); |
+ scoped_ptr<ResourceProvider> resource_provider = |
+ ResourceProvider::Create(output_surface.get(), |
+ &shared_bitmap_manager, |
+ nullptr, |
+ 0, |
+ false, |
+ 1, |
+ false); |
FakePictureLayerTilingClient client(resource_provider.get()); |
scoped_ptr<TestablePictureLayerTiling> tiling; |
@@ -1415,7 +1421,7 @@ static void TilesIntersectingRectExist(const gfx::Rect& rect, |
const gfx::Rect& geometry_rect) { |
bool intersects = rect.Intersects(geometry_rect); |
bool expected_exists = intersect_exists ? intersects : !intersects; |
- EXPECT_EQ(expected_exists, tile != NULL) |
+ EXPECT_EQ(expected_exists, tile != nullptr) |
<< "Rects intersecting " << rect.ToString() << " should exist. " |
<< "Current tile rect is " << geometry_rect.ToString(); |
} |
@@ -2093,9 +2099,9 @@ TEST(PictureLayerTilingTest, RecycledTilesCleared) { |
PENDING_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 1.0f, Occlusion()); |
// Set the second tiling as recycled. |
- active_client.set_twin_tiling(NULL); |
+ active_client.set_twin_tiling(nullptr); |
active_client.set_recycled_twin_tiling(recycle_tiling.get()); |
- recycle_client.set_twin_tiling(NULL); |
+ recycle_client.set_twin_tiling(nullptr); |
// Verify that tiles exist and are shared. |
EXPECT_TRUE(active_tiling->TileAt(0, 0)); |
@@ -2147,9 +2153,9 @@ TEST(PictureLayerTilingTest, RecycledTilesClearedOnReset) { |
PENDING_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 1.0f, Occlusion()); |
// Set the second tiling as recycled. |
- active_client.set_twin_tiling(NULL); |
+ active_client.set_twin_tiling(nullptr); |
active_client.set_recycled_twin_tiling(recycle_tiling.get()); |
- recycle_client.set_twin_tiling(NULL); |
+ recycle_client.set_twin_tiling(nullptr); |
// Verify that tiles exist and are shared. |
EXPECT_TRUE(active_tiling->TileAt(0, 0)); |