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/layers/tiled_layer_impl.h" | 5 #include "cc/layers/tiled_layer_impl.h" |
6 | 6 |
7 #include "cc/layers/append_quads_data.h" | 7 #include "cc/layers/append_quads_data.h" |
8 #include "cc/quads/tile_draw_quad.h" | 8 #include "cc/quads/tile_draw_quad.h" |
9 #include "cc/resources/layer_tiling_data.h" | 9 #include "cc/resources/layer_tiling_data.h" |
10 #include "cc/test/fake_impl_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 TEST_F(TiledLayerImplTest, TextureInfoForLayerNoBorders) { | 259 TEST_F(TiledLayerImplTest, TextureInfoForLayerNoBorders) { |
260 gfx::Size tile_size(50, 50); | 260 gfx::Size tile_size(50, 50); |
261 gfx::Size layer_size(250, 250); | 261 gfx::Size layer_size(250, 250); |
262 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); | 262 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); |
263 GetQuads(render_pass.get(), | 263 GetQuads(render_pass.get(), |
264 tile_size, | 264 tile_size, |
265 layer_size, | 265 layer_size, |
266 LayerTilingData::NO_BORDER_TEXELS, | 266 LayerTilingData::NO_BORDER_TEXELS, |
267 gfx::Rect(layer_size)); | 267 gfx::Rect(layer_size)); |
268 | 268 |
269 size_t i = 0; | |
270 for (QuadList::Iterator iter = render_pass->quad_list.begin(); | 269 for (QuadList::Iterator iter = render_pass->quad_list.begin(); |
271 iter != render_pass->quad_list.end(); | 270 iter != render_pass->quad_list.end(); |
272 ++iter) { | 271 ++iter) { |
273 const TileDrawQuad* quad = TileDrawQuad::MaterialCast(&*iter); | 272 const TileDrawQuad* quad = TileDrawQuad::MaterialCast(&*iter); |
274 | 273 |
275 EXPECT_NE(0u, quad->resource_id) << LayerTestCommon::quad_string << i; | 274 EXPECT_NE(0u, quad->resource_id) << LayerTestCommon::quad_string |
| 275 << iter.index(); |
276 EXPECT_EQ(gfx::RectF(gfx::PointF(), tile_size), quad->tex_coord_rect) | 276 EXPECT_EQ(gfx::RectF(gfx::PointF(), tile_size), quad->tex_coord_rect) |
277 << LayerTestCommon::quad_string << i; | 277 << LayerTestCommon::quad_string << iter.index(); |
278 EXPECT_EQ(tile_size, quad->texture_size) << LayerTestCommon::quad_string | 278 EXPECT_EQ(tile_size, quad->texture_size) << LayerTestCommon::quad_string |
279 << i; | 279 << iter.index(); |
280 } | 280 } |
281 } | 281 } |
282 | 282 |
283 TEST_F(TiledLayerImplTest, GPUMemoryUsage) { | 283 TEST_F(TiledLayerImplTest, GPUMemoryUsage) { |
284 gfx::Size tile_size(20, 30); | 284 gfx::Size tile_size(20, 30); |
285 int num_tiles_x = 12; | 285 int num_tiles_x = 12; |
286 int num_tiles_y = 32; | 286 int num_tiles_y = 32; |
287 gfx::Size layer_size(tile_size.width() * num_tiles_x, | 287 gfx::Size layer_size(tile_size.width() * num_tiles_x, |
288 tile_size.height() * num_tiles_y); | 288 tile_size.height() * num_tiles_y); |
289 | 289 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 LayerTestCommon::VerifyQuadsAreOccluded( | 374 LayerTestCommon::VerifyQuadsAreOccluded( |
375 impl.quad_list(), occluded, &partially_occluded_count); | 375 impl.quad_list(), occluded, &partially_occluded_count); |
376 // The layer outputs one quad, which is partially occluded. | 376 // The layer outputs one quad, which is partially occluded. |
377 EXPECT_EQ(100u - 10u, impl.quad_list().size()); | 377 EXPECT_EQ(100u - 10u, impl.quad_list().size()); |
378 EXPECT_EQ(10u + 10u, partially_occluded_count); | 378 EXPECT_EQ(10u + 10u, partially_occluded_count); |
379 } | 379 } |
380 } | 380 } |
381 | 381 |
382 } // namespace | 382 } // namespace |
383 } // namespace cc | 383 } // namespace cc |
OLD | NEW |