| Index: cc/tiled_layer_impl_unittest.cc
|
| diff --git a/cc/tiled_layer_impl_unittest.cc b/cc/tiled_layer_impl_unittest.cc
|
| index e8c066f96132f56e3515b5a359d4720f2475d655..4421d138fbda8e3f6db9c5efdb400cac27e9e3b6 100644
|
| --- a/cc/tiled_layer_impl_unittest.cc
|
| +++ b/cc/tiled_layer_impl_unittest.cc
|
| @@ -22,14 +22,14 @@ namespace {
|
|
|
| // Create a default tiled layer with textures for all tiles and a default
|
| // visibility of the entire layer size.
|
| -static scoped_ptr<TiledLayerImpl> createLayer(const IntSize& tileSize, const IntSize& layerSize, LayerTilingData::BorderTexelOption borderTexels)
|
| +static scoped_ptr<TiledLayerImpl> createLayer(const gfx::Size& tileSize, const gfx::Size& layerSize, LayerTilingData::BorderTexelOption borderTexels)
|
| {
|
| scoped_ptr<TiledLayerImpl> layer = TiledLayerImpl::create(1);
|
| scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(tileSize, borderTexels);
|
| tiler->setBounds(layerSize);
|
| layer->setTilingData(*tiler);
|
| layer->setSkipsDraw(false);
|
| - layer->setVisibleContentRect(IntRect(IntPoint(), layerSize));
|
| + layer->setVisibleContentRect(gfx::Rect(gfx::Point(), layerSize));
|
| layer->setDrawOpacity(1);
|
| layer->setBounds(layerSize);
|
| layer->setContentBounds(layerSize);
|
| @@ -39,7 +39,7 @@ static scoped_ptr<TiledLayerImpl> createLayer(const IntSize& tileSize, const Int
|
| ResourceProvider::ResourceId resourceId = 1;
|
| for (int i = 0; i < tiler->numTilesX(); ++i)
|
| for (int j = 0; j < tiler->numTilesY(); ++j)
|
| - layer->pushTileProperties(i, j, resourceId++, IntRect(0, 0, 1, 1), false);
|
| + layer->pushTileProperties(i, j, resourceId++, gfx::Rect(0, 0, 1, 1), false);
|
|
|
| return layer.Pass();
|
| }
|
| @@ -48,10 +48,10 @@ TEST(TiledLayerImplTest, emptyQuadList)
|
| {
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - const IntSize tileSize(90, 90);
|
| + const gfx::Size tileSize(90, 90);
|
| const int numTilesX = 8;
|
| const int numTilesY = 4;
|
| - const IntSize layerSize(tileSize.width() * numTilesX, tileSize.height() * numTilesY);
|
| + const gfx::Size layerSize(tileSize.width() * numTilesX, tileSize.height() * numTilesY);
|
|
|
| // Verify default layer does creates quads
|
| {
|
| @@ -66,7 +66,7 @@ TEST(TiledLayerImplTest, emptyQuadList)
|
| // Layer with empty visible layer rect produces no quads
|
| {
|
| scoped_ptr<TiledLayerImpl> layer = createLayer(tileSize, layerSize, LayerTilingData::NoBorderTexels);
|
| - layer->setVisibleContentRect(IntRect());
|
| + layer->setVisibleContentRect(gfx::Rect());
|
|
|
| MockQuadCuller quadCuller;
|
| AppendQuadsData data;
|
| @@ -78,7 +78,7 @@ TEST(TiledLayerImplTest, emptyQuadList)
|
| {
|
| scoped_ptr<TiledLayerImpl> layer = createLayer(tileSize, layerSize, LayerTilingData::NoBorderTexels);
|
|
|
| - IntRect outsideBounds(IntPoint(-100, -100), IntSize(50, 50));
|
| + gfx::Rect outsideBounds(gfx::Point(-100, -100), gfx::Size(50, 50));
|
| layer->setVisibleContentRect(outsideBounds);
|
|
|
| MockQuadCuller quadCuller;
|
| @@ -103,10 +103,10 @@ TEST(TiledLayerImplTest, checkerboarding)
|
| {
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - const IntSize tileSize(10, 10);
|
| + const gfx::Size tileSize(10, 10);
|
| const int numTilesX = 2;
|
| const int numTilesY = 2;
|
| - const IntSize layerSize(tileSize.width() * numTilesX, tileSize.height() * numTilesY);
|
| + const gfx::Size layerSize(tileSize.width() * numTilesX, tileSize.height() * numTilesY);
|
|
|
| scoped_ptr<TiledLayerImpl> layer = createLayer(tileSize, layerSize, LayerTilingData::NoBorderTexels);
|
|
|
| @@ -124,7 +124,7 @@ TEST(TiledLayerImplTest, checkerboarding)
|
|
|
| for (int i = 0; i < numTilesX; ++i)
|
| for (int j = 0; j < numTilesY; ++j)
|
| - layer->pushTileProperties(i, j, 0, IntRect(), false);
|
| + layer->pushTileProperties(i, j, 0, gfx::Rect(), false);
|
|
|
| // All checkerboarding
|
| {
|
| @@ -138,7 +138,7 @@ TEST(TiledLayerImplTest, checkerboarding)
|
| }
|
| }
|
|
|
| -static void getQuads(QuadList& quads, SharedQuadStateList& sharedStates, IntSize tileSize, const IntSize& layerSize, LayerTilingData::BorderTexelOption borderTexelOption, const IntRect& visibleContentRect)
|
| +static void getQuads(QuadList& quads, SharedQuadStateList& sharedStates, gfx::Size tileSize, const gfx::Size& layerSize, LayerTilingData::BorderTexelOption borderTexelOption, const gfx::Rect& visibleContentRect)
|
| {
|
| scoped_ptr<TiledLayerImpl> layer = createLayer(tileSize, layerSize, borderTexelOption);
|
| layer->setVisibleContentRect(visibleContentRect);
|
| @@ -164,11 +164,11 @@ static void coverageVisibleRectOnTileBoundaries(LayerTilingData::BorderTexelOpti
|
| {
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - IntSize layerSize(1000, 1000);
|
| + gfx::Size layerSize(1000, 1000);
|
| QuadList quads;
|
| SharedQuadStateList sharedStates;
|
| - getQuads(quads, sharedStates, IntSize(100, 100), layerSize, borders, IntRect(IntPoint(), layerSize));
|
| - verifyQuadsExactlyCoverRect(quads, IntRect(IntPoint(), layerSize));
|
| + getQuads(quads, sharedStates, gfx::Size(100, 100), layerSize, borders, gfx::Rect(gfx::Point(), layerSize));
|
| + verifyQuadsExactlyCoverRect(quads, gfx::Rect(gfx::Point(), layerSize));
|
| }
|
| WITH_AND_WITHOUT_BORDER_TEST(coverageVisibleRectOnTileBoundaries);
|
|
|
| @@ -177,14 +177,16 @@ static void coverageVisibleRectIntersectsTiles(LayerTilingData::BorderTexelOptio
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| // This rect intersects the middle 3x3 of the 5x5 tiles.
|
| - IntPoint topLeft(65, 73);
|
| - IntPoint bottomRight(182, 198);
|
| - IntRect visibleContentRect(topLeft, bottomRight - topLeft);
|
| + gfx::Point topLeft(65, 73);
|
| + gfx::Point bottomRight(182, 198);
|
| + gfx::Vector2d rectSize(bottomRight - topLeft);
|
| + // TODO(danakj) Use gfx::BoundingRect()
|
| + gfx::Rect visibleContentRect(topLeft, gfx::Size(rectSize.x(), rectSize.y()));
|
|
|
| - IntSize layerSize(250, 250);
|
| + gfx::Size layerSize(250, 250);
|
| QuadList quads;
|
| SharedQuadStateList sharedStates;
|
| - getQuads(quads, sharedStates, IntSize(50, 50), IntSize(250, 250), LayerTilingData::NoBorderTexels, visibleContentRect);
|
| + getQuads(quads, sharedStates, gfx::Size(50, 50), gfx::Size(250, 250), LayerTilingData::NoBorderTexels, visibleContentRect);
|
| verifyQuadsExactlyCoverRect(quads, visibleContentRect);
|
| }
|
| WITH_AND_WITHOUT_BORDER_TEST(coverageVisibleRectIntersectsTiles);
|
| @@ -193,11 +195,11 @@ static void coverageVisibleRectIntersectsBounds(LayerTilingData::BorderTexelOpti
|
| {
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - IntSize layerSize(220, 210);
|
| - IntRect visibleContentRect(IntPoint(), layerSize);
|
| + gfx::Size layerSize(220, 210);
|
| + gfx::Rect visibleContentRect(gfx::Point(), layerSize);
|
| QuadList quads;
|
| SharedQuadStateList sharedStates;
|
| - getQuads(quads, sharedStates, IntSize(100, 100), layerSize, LayerTilingData::NoBorderTexels, visibleContentRect);
|
| + getQuads(quads, sharedStates, gfx::Size(100, 100), layerSize, LayerTilingData::NoBorderTexels, visibleContentRect);
|
| verifyQuadsExactlyCoverRect(quads, visibleContentRect);
|
| }
|
| WITH_AND_WITHOUT_BORDER_TEST(coverageVisibleRectIntersectsBounds);
|
| @@ -206,18 +208,18 @@ TEST(TiledLayerImplTest, textureInfoForLayerNoBorders)
|
| {
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - IntSize tileSize(50, 50);
|
| - IntSize layerSize(250, 250);
|
| + gfx::Size tileSize(50, 50);
|
| + gfx::Size layerSize(250, 250);
|
| QuadList quads;
|
| SharedQuadStateList sharedStates;
|
| - getQuads(quads, sharedStates, tileSize, layerSize, LayerTilingData::NoBorderTexels, IntRect(IntPoint(), layerSize));
|
| + getQuads(quads, sharedStates, tileSize, layerSize, LayerTilingData::NoBorderTexels, gfx::Rect(gfx::Point(), layerSize));
|
|
|
| for (size_t i = 0; i < quads.size(); ++i) {
|
| ASSERT_EQ(quads[i]->material(), DrawQuad::TiledContent) << quadString << i;
|
| TileDrawQuad* quad = static_cast<TileDrawQuad*>(quads[i]);
|
|
|
| EXPECT_NE(quad->resourceId(), 0u) << quadString << i;
|
| - EXPECT_EQ(quad->textureOffset(), IntPoint()) << quadString << i;
|
| + EXPECT_EQ(quad->textureOffset(), gfx::Vector2d()) << quadString << i;
|
| EXPECT_EQ(quad->textureSize(), tileSize) << quadString << i;
|
| EXPECT_EQ(gfx::Rect(0, 0, 1, 1), quad->opaqueRect()) << quadString << i;
|
| }
|
| @@ -227,11 +229,11 @@ TEST(TiledLayerImplTest, tileOpaqueRectForLayerNoBorders)
|
| {
|
| DebugScopedSetImplThread scopedImplThread;
|
|
|
| - IntSize tileSize(50, 50);
|
| - IntSize layerSize(250, 250);
|
| + gfx::Size tileSize(50, 50);
|
| + gfx::Size layerSize(250, 250);
|
| QuadList quads;
|
| SharedQuadStateList sharedStates;
|
| - getQuads(quads, sharedStates, tileSize, layerSize, LayerTilingData::NoBorderTexels, IntRect(IntPoint(), layerSize));
|
| + getQuads(quads, sharedStates, tileSize, layerSize, LayerTilingData::NoBorderTexels, gfx::Rect(gfx::Point(), layerSize));
|
|
|
| for (size_t i = 0; i < quads.size(); ++i) {
|
| ASSERT_EQ(quads[i]->material(), DrawQuad::TiledContent) << quadString << i;
|
|
|