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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/tiled_layer_impl.h" | 7 #include "cc/tiled_layer_impl.h" |
8 | 8 |
9 #include "cc/append_quads_data.h" | 9 #include "cc/append_quads_data.h" |
10 #include "cc/layer_tiling_data.h" | 10 #include "cc/layer_tiling_data.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 static scoped_ptr<TiledLayerImpl> createLayer(const IntSize& tileSize, const Int
Size& layerSize, LayerTilingData::BorderTexelOption borderTexels) | 25 static scoped_ptr<TiledLayerImpl> createLayer(const IntSize& tileSize, const Int
Size& layerSize, LayerTilingData::BorderTexelOption borderTexels) |
26 { | 26 { |
27 scoped_ptr<TiledLayerImpl> layer = TiledLayerImpl::create(1); | 27 scoped_ptr<TiledLayerImpl> layer = TiledLayerImpl::create(1); |
28 scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(tileSize, border
Texels); | 28 scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(tileSize, border
Texels); |
29 tiler->setBounds(layerSize); | 29 tiler->setBounds(layerSize); |
30 layer->setTilingData(*tiler); | 30 layer->setTilingData(*tiler); |
31 layer->setSkipsDraw(false); | 31 layer->setSkipsDraw(false); |
32 layer->setVisibleContentRect(IntRect(IntPoint(), layerSize)); | 32 layer->setVisibleContentRect(IntRect(IntPoint(), layerSize)); |
33 layer->setDrawOpacity(1); | 33 layer->setDrawOpacity(1); |
34 layer->setBounds(layerSize); | 34 layer->setBounds(layerSize); |
35 layer->setContentBounds(layerSize); | |
36 layer->createRenderSurface(); | 35 layer->createRenderSurface(); |
37 layer->setRenderTarget(layer.get()); | 36 layer->setRenderTarget(layer.get()); |
38 | 37 |
39 ResourceProvider::ResourceId resourceId = 1; | 38 ResourceProvider::ResourceId resourceId = 1; |
40 for (int i = 0; i < tiler->numTilesX(); ++i) | 39 for (int i = 0; i < tiler->numTilesX(); ++i) |
41 for (int j = 0; j < tiler->numTilesY(); ++j) | 40 for (int j = 0; j < tiler->numTilesY(); ++j) |
42 layer->pushTileProperties(i, j, resourceId++, IntRect(0, 0, 1, 1), f
alse); | 41 layer->pushTileProperties(i, j, resourceId++, IntRect(0, 0, 1, 1), f
alse); |
43 | 42 |
44 return layer.Pass(); | 43 return layer.Pass(); |
45 } | 44 } |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 234 |
236 for (size_t i = 0; i < quads.size(); ++i) { | 235 for (size_t i = 0; i < quads.size(); ++i) { |
237 ASSERT_EQ(quads[i]->material(), DrawQuad::TiledContent) << quadString <<
i; | 236 ASSERT_EQ(quads[i]->material(), DrawQuad::TiledContent) << quadString <<
i; |
238 TileDrawQuad* quad = static_cast<TileDrawQuad*>(quads[i]); | 237 TileDrawQuad* quad = static_cast<TileDrawQuad*>(quads[i]); |
239 | 238 |
240 EXPECT_EQ(gfx::Rect(0, 0, 1, 1), quad->opaqueRect()) << quadString << i; | 239 EXPECT_EQ(gfx::Rect(0, 0, 1, 1), quad->opaqueRect()) << quadString << i; |
241 } | 240 } |
242 } | 241 } |
243 | 242 |
244 } // namespace | 243 } // namespace |
OLD | NEW |