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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 } | 310 } |
311 | 311 |
312 TEST_F(TiledLayerImplTest, Occlusion) { | 312 TEST_F(TiledLayerImplTest, Occlusion) { |
313 gfx::Size tile_size(100, 100); | 313 gfx::Size tile_size(100, 100); |
314 gfx::Size layer_bounds(1000, 1000); | 314 gfx::Size layer_bounds(1000, 1000); |
315 gfx::Size viewport_size(1000, 1000); | 315 gfx::Size viewport_size(1000, 1000); |
316 | 316 |
317 LayerTestCommon::LayerImplTest impl; | 317 LayerTestCommon::LayerImplTest impl; |
318 | 318 |
319 TiledLayerImpl* tiled_layer = impl.AddChildToRoot<TiledLayerImpl>(); | 319 TiledLayerImpl* tiled_layer = impl.AddChildToRoot<TiledLayerImpl>(); |
320 tiled_layer->SetAnchorPoint(gfx::PointF()); | |
321 tiled_layer->SetBounds(layer_bounds); | 320 tiled_layer->SetBounds(layer_bounds); |
322 tiled_layer->SetContentBounds(layer_bounds); | 321 tiled_layer->SetContentBounds(layer_bounds); |
323 tiled_layer->SetDrawsContent(true); | 322 tiled_layer->SetDrawsContent(true); |
324 tiled_layer->set_skips_draw(false); | 323 tiled_layer->set_skips_draw(false); |
325 | 324 |
326 scoped_ptr<LayerTilingData> tiler = | 325 scoped_ptr<LayerTilingData> tiler = |
327 LayerTilingData::Create(tile_size, LayerTilingData::NO_BORDER_TEXELS); | 326 LayerTilingData::Create(tile_size, LayerTilingData::NO_BORDER_TEXELS); |
328 tiler->SetTilingRect(gfx::Rect(layer_bounds)); | 327 tiler->SetTilingRect(gfx::Rect(layer_bounds)); |
329 tiled_layer->SetTilingData(*tiler); | 328 tiled_layer->SetTilingData(*tiler); |
330 | 329 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 occluded, | 366 occluded, |
368 &partially_occluded_count); | 367 &partially_occluded_count); |
369 // The layer outputs one quad, which is partially occluded. | 368 // The layer outputs one quad, which is partially occluded. |
370 EXPECT_EQ(100u - 10u, impl.quad_list().size()); | 369 EXPECT_EQ(100u - 10u, impl.quad_list().size()); |
371 EXPECT_EQ(10u + 10u, partially_occluded_count); | 370 EXPECT_EQ(10u + 10u, partially_occluded_count); |
372 } | 371 } |
373 } | 372 } |
374 | 373 |
375 } // namespace | 374 } // namespace |
376 } // namespace cc | 375 } // namespace cc |
OLD | NEW |