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/test/fake_impl_proxy.h" | 9 #include "cc/test/fake_impl_proxy.h" |
10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 tile_size, | 262 tile_size, |
263 layer_size, | 263 layer_size, |
264 LayerTilingData::NO_BORDER_TEXELS, | 264 LayerTilingData::NO_BORDER_TEXELS, |
265 gfx::Rect(layer_size)); | 265 gfx::Rect(layer_size)); |
266 | 266 |
267 for (auto iter = render_pass->quad_list.cbegin(); | 267 for (auto iter = render_pass->quad_list.cbegin(); |
268 iter != render_pass->quad_list.cend(); | 268 iter != render_pass->quad_list.cend(); |
269 ++iter) { | 269 ++iter) { |
270 const TileDrawQuad* quad = TileDrawQuad::MaterialCast(*iter); | 270 const TileDrawQuad* quad = TileDrawQuad::MaterialCast(*iter); |
271 | 271 |
272 EXPECT_NE(0u, quad->resource_id) << LayerTestCommon::quad_string | 272 EXPECT_NE(0u, quad->resource_id()) << LayerTestCommon::quad_string |
273 << iter.index(); | 273 << iter.index(); |
274 EXPECT_EQ(gfx::RectF(gfx::PointF(), tile_size), quad->tex_coord_rect) | 274 EXPECT_EQ(gfx::RectF(gfx::PointF(), tile_size), quad->tex_coord_rect) |
275 << LayerTestCommon::quad_string << iter.index(); | 275 << LayerTestCommon::quad_string << iter.index(); |
276 EXPECT_EQ(tile_size, quad->texture_size) << LayerTestCommon::quad_string | 276 EXPECT_EQ(tile_size, quad->texture_size) << LayerTestCommon::quad_string |
277 << iter.index(); | 277 << iter.index(); |
278 } | 278 } |
279 } | 279 } |
280 | 280 |
281 TEST_F(TiledLayerImplTest, GPUMemoryUsage) { | 281 TEST_F(TiledLayerImplTest, GPUMemoryUsage) { |
282 gfx::Size tile_size(20, 30); | 282 gfx::Size tile_size(20, 30); |
283 int num_tiles_x = 12; | 283 int num_tiles_x = 12; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 LayerTestCommon::VerifyQuadsAreOccluded( | 378 LayerTestCommon::VerifyQuadsAreOccluded( |
379 impl.quad_list(), occluded, &partially_occluded_count); | 379 impl.quad_list(), occluded, &partially_occluded_count); |
380 // The layer outputs one quad, which is partially occluded. | 380 // The layer outputs one quad, which is partially occluded. |
381 EXPECT_EQ(100u - 10u, impl.quad_list().size()); | 381 EXPECT_EQ(100u - 10u, impl.quad_list().size()); |
382 EXPECT_EQ(10u + 10u, partially_occluded_count); | 382 EXPECT_EQ(10u + 10u, partially_occluded_count); |
383 } | 383 } |
384 } | 384 } |
385 | 385 |
386 } // namespace | 386 } // namespace |
387 } // namespace cc | 387 } // namespace cc |
OLD | NEW |