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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "cc/layers/delegated_frame_provider.h" | 8 #include "cc/layers/delegated_frame_provider.h" |
9 #include "cc/layers/delegated_frame_resource_collection.h" | 9 #include "cc/layers/delegated_frame_resource_collection.h" |
10 #include "cc/layers/heads_up_display_layer.h" | 10 #include "cc/layers/heads_up_display_layer.h" |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 : public LayerTreeHostContextTestLostContextSucceeds { | 554 : public LayerTreeHostContextTestLostContextSucceeds { |
555 public: | 555 public: |
556 void SetupTree() override { | 556 void SetupTree() override { |
557 root_ = Layer::Create(layer_settings()); | 557 root_ = Layer::Create(layer_settings()); |
558 root_->SetBounds(gfx::Size(10, 10)); | 558 root_->SetBounds(gfx::Size(10, 10)); |
559 root_->SetIsDrawable(true); | 559 root_->SetIsDrawable(true); |
560 | 560 |
561 // Paint non-solid color. | 561 // Paint non-solid color. |
562 SkPaint paint; | 562 SkPaint paint; |
563 paint.setColor(SkColorSetARGB(100, 80, 200, 200)); | 563 paint.setColor(SkColorSetARGB(100, 80, 200, 200)); |
564 client_.add_draw_rect(gfx::Rect(0, 0, 5, 5), paint); | 564 client_.add_draw_rect(gfx::Rect(5, 5), paint); |
565 | 565 |
566 layer_ = FakePictureLayer::Create(layer_settings(), &client_); | 566 layer_ = FakePictureLayer::Create(layer_settings(), &client_); |
567 layer_->SetBounds(gfx::Size(10, 10)); | 567 layer_->SetBounds(gfx::Size(10, 10)); |
568 layer_->SetIsDrawable(true); | 568 layer_->SetIsDrawable(true); |
569 | 569 |
570 root_->AddChild(layer_); | 570 root_->AddChild(layer_); |
571 | 571 |
572 layer_tree_host()->SetRootLayer(root_); | 572 layer_tree_host()->SetRootLayer(root_); |
573 LayerTreeHostContextTest::SetupTree(); | 573 LayerTreeHostContextTest::SetupTree(); |
574 } | 574 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 LayerTreeHostContextTestLostContextAndEvictTextures() | 632 LayerTreeHostContextTestLostContextAndEvictTextures() |
633 : LayerTreeHostContextTest(), | 633 : LayerTreeHostContextTest(), |
634 impl_host_(0), | 634 impl_host_(0), |
635 num_commits_(0), | 635 num_commits_(0), |
636 lost_context_(false) {} | 636 lost_context_(false) {} |
637 | 637 |
638 void SetupTree() override { | 638 void SetupTree() override { |
639 // Paint non-solid color. | 639 // Paint non-solid color. |
640 SkPaint paint; | 640 SkPaint paint; |
641 paint.setColor(SkColorSetARGB(100, 80, 200, 200)); | 641 paint.setColor(SkColorSetARGB(100, 80, 200, 200)); |
642 client_.add_draw_rect(gfx::Rect(0, 0, 5, 5), paint); | 642 client_.add_draw_rect(gfx::Rect(5, 5), paint); |
643 | 643 |
644 scoped_refptr<FakePictureLayer> picture_layer = | 644 scoped_refptr<FakePictureLayer> picture_layer = |
645 FakePictureLayer::Create(layer_settings(), &client_); | 645 FakePictureLayer::Create(layer_settings(), &client_); |
646 picture_layer->SetBounds(gfx::Size(10, 20)); | 646 picture_layer->SetBounds(gfx::Size(10, 20)); |
647 layer_tree_host()->SetRootLayer(picture_layer); | 647 layer_tree_host()->SetRootLayer(picture_layer); |
648 | 648 |
649 LayerTreeHostContextTest::SetupTree(); | 649 LayerTreeHostContextTest::SetupTree(); |
650 } | 650 } |
651 | 651 |
652 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 652 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1558 void AfterTest() override {} | 1558 void AfterTest() override {} |
1559 | 1559 |
1560 bool deferred_; | 1560 bool deferred_; |
1561 }; | 1561 }; |
1562 | 1562 |
1563 SINGLE_AND_MULTI_THREAD_TEST_F( | 1563 SINGLE_AND_MULTI_THREAD_TEST_F( |
1564 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); | 1564 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); |
1565 | 1565 |
1566 } // namespace | 1566 } // namespace |
1567 } // namespace cc | 1567 } // namespace cc |
OLD | NEW |