OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 296 |
297 EXPECT_EQ(pending_layer_->tilings()->num_tilings(), | 297 EXPECT_EQ(pending_layer_->tilings()->num_tilings(), |
298 active_layer_->tilings()->num_tilings()); | 298 active_layer_->tilings()->num_tilings()); |
299 | 299 |
300 const PictureLayerTilingSet* tilings = pending_layer_->tilings(); | 300 const PictureLayerTilingSet* tilings = pending_layer_->tilings(); |
301 EXPECT_GT(tilings->num_tilings(), 0u); | 301 EXPECT_GT(tilings->num_tilings(), 0u); |
302 for (size_t i = 0; i < tilings->num_tilings(); ++i) | 302 for (size_t i = 0; i < tilings->num_tilings(); ++i) |
303 VerifyAllTilesExistAndHavePile(tilings->tiling_at(i), active_pile.get()); | 303 VerifyAllTilesExistAndHavePile(tilings->tiling_at(i), active_pile.get()); |
304 } | 304 } |
305 | 305 |
306 TEST_F(PictureLayerImplTest, | 306 TEST_F(PictureLayerImplTest, ExternalViewportRectForPrioritizingTiles) { |
307 DISABLED_ExternalViewportRectForPrioritizingTiles) { | |
308 base::TimeTicks time_ticks; | 307 base::TimeTicks time_ticks; |
| 308 time_ticks += base::TimeDelta::FromMilliseconds(1); |
309 host_impl_.SetCurrentFrameTimeTicks(time_ticks); | 309 host_impl_.SetCurrentFrameTimeTicks(time_ticks); |
310 gfx::Size tile_size(100, 100); | 310 gfx::Size tile_size(100, 100); |
311 gfx::Size layer_bounds(400, 400); | 311 gfx::Size layer_bounds(400, 400); |
312 | 312 |
313 scoped_refptr<FakePicturePileImpl> pending_pile = | 313 scoped_refptr<FakePicturePileImpl> pending_pile = |
314 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); | 314 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); |
315 scoped_refptr<FakePicturePileImpl> active_pile = | 315 scoped_refptr<FakePicturePileImpl> active_pile = |
316 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); | 316 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); |
317 | 317 |
318 SetupTrees(pending_pile, active_pile); | 318 SetupTrees(pending_pile, active_pile); |
319 | 319 |
320 Region invalidation; | 320 Region invalidation; |
321 AddDefaultTilingsWithInvalidation(invalidation); | 321 AddDefaultTilingsWithInvalidation(invalidation); |
322 SetupDrawPropertiesAndUpdateTiles(active_layer_, 1.f, 1.f, 1.f, 1.f, false); | 322 SetupDrawPropertiesAndUpdateTiles(active_layer_, 1.f, 1.f, 1.f, 1.f, false); |
323 | 323 |
| 324 /* |
| 325 time_ticks += base::TimeDelta::FromMilliseconds(200); |
| 326 host_impl_.SetCurrentFrameTimeTicks(time_ticks); |
| 327 */ |
| 328 |
324 // Update tiles with viewport for tile priority as (0, 0, 100, 100) and the | 329 // Update tiles with viewport for tile priority as (0, 0, 100, 100) and the |
325 // identify transform for tile priority. | 330 // identify transform for tile priority. |
326 bool resourceless_software_draw = false; | 331 bool resourceless_software_draw = false; |
327 gfx::Rect viewport = gfx::Rect(layer_bounds), | 332 gfx::Rect viewport = gfx::Rect(layer_bounds), |
328 viewport_rect_for_tile_priority = gfx::Rect(0, 0, 100, 100); | 333 viewport_rect_for_tile_priority = gfx::Rect(0, 0, 100, 100); |
329 gfx::Transform transform, transform_for_tile_priority; | 334 gfx::Transform transform, transform_for_tile_priority; |
330 | 335 |
331 host_impl_.SetExternalDrawConstraints(transform, | 336 host_impl_.SetExternalDrawConstraints(transform, |
332 viewport, | 337 viewport, |
333 viewport, | 338 viewport, |
(...skipping 3368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3702 | 3707 |
3703 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); | 3708 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); |
3704 | 3709 |
3705 VerifyEvictionConsidersOcclusion(pending_layer_, | 3710 VerifyEvictionConsidersOcclusion(pending_layer_, |
3706 total_expected_occluded_tile_count); | 3711 total_expected_occluded_tile_count); |
3707 VerifyEvictionConsidersOcclusion(active_layer_, | 3712 VerifyEvictionConsidersOcclusion(active_layer_, |
3708 total_expected_occluded_tile_count); | 3713 total_expected_occluded_tile_count); |
3709 } | 3714 } |
3710 } // namespace | 3715 } // namespace |
3711 } // namespace cc | 3716 } // namespace cc |
OLD | NEW |