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.h" | 5 #include "cc/layers/picture_layer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 382 |
383 FakePictureLayerImpl* layer_impl = static_cast<FakePictureLayerImpl*>( | 383 FakePictureLayerImpl* layer_impl = static_cast<FakePictureLayerImpl*>( |
384 host_impl.pending_tree()->root_layer_for_testing()); | 384 host_impl.pending_tree()->root_layer_for_testing()); |
385 | 385 |
386 layer->PushPropertiesTo(layer_impl); | 386 layer->PushPropertiesTo(layer_impl); |
387 | 387 |
388 host->CommitComplete(); | 388 host->CommitComplete(); |
389 EXPECT_EQ(2, host->source_frame_number()); | 389 EXPECT_EQ(2, host->source_frame_number()); |
390 | 390 |
391 host_impl.ActivateSyncTree(); | 391 host_impl.ActivateSyncTree(); |
392 host_impl.active_tree()->SetRootLayerFromLayerListForTesting(); | |
393 | 392 |
394 // By updating the draw proprties on the active tree, we will set the viewport | 393 // By updating the draw proprties on the active tree, we will set the viewport |
395 // rect for tile priorities to something non-empty. | 394 // rect for tile priorities to something non-empty. |
396 const bool can_use_lcd_text = false; | 395 const bool can_use_lcd_text = false; |
397 host_impl.active_tree()->property_trees()->needs_rebuild = true; | 396 host_impl.active_tree()->BuildPropertyTreesForTesting(); |
398 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); | |
399 host_impl.active_tree()->UpdateDrawProperties(can_use_lcd_text); | 397 host_impl.active_tree()->UpdateDrawProperties(can_use_lcd_text); |
400 | 398 |
401 layer->SetBounds(gfx::Size(11, 11)); | 399 layer->SetBounds(gfx::Size(11, 11)); |
402 layer->SavePaintProperties(); | 400 layer->SavePaintProperties(); |
403 | 401 |
404 host_impl.CreatePendingTree(); | 402 host_impl.CreatePendingTree(); |
405 layer_impl = static_cast<FakePictureLayerImpl*>( | 403 layer_impl = static_cast<FakePictureLayerImpl*>( |
406 host_impl.pending_tree()->root_layer_for_testing()); | 404 host_impl.pending_tree()->root_layer_for_testing()); |
407 | 405 |
408 // We should now have invalid contents and should therefore clear the | 406 // We should now have invalid contents and should therefore clear the |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 // Do a main frame, record the picture layers. The frame number has changed | 518 // Do a main frame, record the picture layers. The frame number has changed |
521 // non-monotonically. | 519 // non-monotonically. |
522 layer->SetNeedsDisplay(); | 520 layer->SetNeedsDisplay(); |
523 host2->Composite(base::TimeTicks::Now()); | 521 host2->Composite(base::TimeTicks::Now()); |
524 EXPECT_EQ(3, layer->update_count()); | 522 EXPECT_EQ(3, layer->update_count()); |
525 EXPECT_EQ(1, host2->source_frame_number()); | 523 EXPECT_EQ(1, host2->source_frame_number()); |
526 } | 524 } |
527 | 525 |
528 } // namespace | 526 } // namespace |
529 } // namespace cc | 527 } // namespace cc |
OLD | NEW |