OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 using testing::AnyNumber; | 57 using testing::AnyNumber; |
58 using testing::AtLeast; | 58 using testing::AtLeast; |
59 using testing::Mock; | 59 using testing::Mock; |
60 | 60 |
61 namespace cc { | 61 namespace cc { |
62 namespace { | 62 namespace { |
63 | 63 |
64 class LayerTreeHostTest : public LayerTreeTest { | 64 class LayerTreeHostTest : public LayerTreeTest { |
65 }; | 65 }; |
66 | 66 |
67 // Two setNeedsCommits in a row should lead to at least 1 commit and at least 1 | 67 // Two setNeedsCommits in a row should lead to 1 commit and 1 draw. |
68 // draw with frame 0. | |
69 class LayerTreeHostTestSetNeedsCommit1 : public LayerTreeHostTest { | 68 class LayerTreeHostTestSetNeedsCommit1 : public LayerTreeHostTest { |
70 public: | 69 public: |
71 LayerTreeHostTestSetNeedsCommit1() : num_commits_(0), num_draws_(0) {} | 70 LayerTreeHostTestSetNeedsCommit1() : num_commits_(0), num_draws_(0) {} |
72 | 71 |
73 virtual void BeginTest() OVERRIDE { | 72 virtual void BeginTest() OVERRIDE { |
74 PostSetNeedsCommitToMainThread(); | 73 PostSetNeedsCommitToMainThread(); |
75 PostSetNeedsCommitToMainThread(); | 74 PostSetNeedsCommitToMainThread(); |
76 } | 75 } |
77 | 76 |
78 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 77 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
79 num_draws_++; | 78 num_draws_++; |
80 if (!impl->active_tree()->source_frame_number()) | 79 if (!impl->active_tree()->source_frame_number()) |
81 EndTest(); | 80 EndTest(); |
82 } | 81 } |
83 | 82 |
84 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 83 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
85 num_commits_++; | 84 num_commits_++; |
86 } | 85 } |
87 | 86 |
88 virtual void AfterTest() OVERRIDE { | 87 virtual void AfterTest() OVERRIDE { |
89 EXPECT_GE(1, num_commits_); | 88 EXPECT_EQ(num_commits_, 1); |
90 EXPECT_GE(1, num_draws_); | 89 EXPECT_EQ(num_draws_, 1); |
91 } | 90 } |
92 | 91 |
93 private: | 92 private: |
94 int num_commits_; | 93 int num_commits_; |
95 int num_draws_; | 94 int num_draws_; |
96 }; | 95 }; |
97 | 96 |
98 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsCommit1); | 97 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsCommit1); |
99 | 98 |
100 // A SetNeedsCommit should lead to 1 commit. Issuing a second commit after that | 99 // A SetNeedsCommit should lead to 1 commit. Issuing a second commit after that |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 | 614 |
616 // A compositeAndReadback while invisible should force a normal commit without | 615 // A compositeAndReadback while invisible should force a normal commit without |
617 // assertion. | 616 // assertion. |
618 class LayerTreeHostTestCompositeAndReadbackWhileInvisible | 617 class LayerTreeHostTestCompositeAndReadbackWhileInvisible |
619 : public LayerTreeHostTest { | 618 : public LayerTreeHostTest { |
620 public: | 619 public: |
621 LayerTreeHostTestCompositeAndReadbackWhileInvisible() : num_commits_(0) {} | 620 LayerTreeHostTestCompositeAndReadbackWhileInvisible() : num_commits_(0) {} |
622 | 621 |
623 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 622 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
624 | 623 |
625 virtual void DidCommitAndDrawFrame() OVERRIDE { | 624 virtual void DidCommit() OVERRIDE { |
626 num_commits_++; | 625 num_commits_++; |
627 if (num_commits_ == 1) { | 626 if (num_commits_ == 1) { |
628 layer_tree_host()->SetVisible(false); | 627 layer_tree_host()->SetVisible(false); |
629 layer_tree_host()->SetNeedsCommit(); | 628 layer_tree_host()->SetNeedsCommit(); |
630 layer_tree_host()->SetNeedsCommit(); | 629 layer_tree_host()->SetNeedsCommit(); |
631 char pixels[4]; | 630 char pixels[4]; |
632 layer_tree_host()->CompositeAndReadback(&pixels, gfx::Rect(0, 0, 1, 1)); | 631 layer_tree_host()->CompositeAndReadback(&pixels, gfx::Rect(0, 0, 1, 1)); |
633 } else { | 632 } else { |
634 EndTest(); | 633 EndTest(); |
635 } | 634 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 }; | 693 }; |
695 | 694 |
696 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit); | 695 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit); |
697 | 696 |
698 // This test verifies that LayerTreeHostImpl's current frame time gets | 697 // This test verifies that LayerTreeHostImpl's current frame time gets |
699 // updated in consecutive frames when it doesn't draw due to tree | 698 // updated in consecutive frames when it doesn't draw due to tree |
700 // activation failure. | 699 // activation failure. |
701 class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails | 700 class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails |
702 : public LayerTreeHostTest { | 701 : public LayerTreeHostTest { |
703 public: | 702 public: |
704 LayerTreeHostTestFrameTimeUpdatesAfterActivationFails() : frame_(0) {} | 703 LayerTreeHostTestFrameTimeUpdatesAfterActivationFails() |
| 704 : frame_count_with_pending_tree_(0) {} |
705 | 705 |
706 virtual void BeginTest() OVERRIDE { | 706 virtual void BeginTest() OVERRIDE { |
707 layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); | 707 layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); |
708 layer_tree_host()->set_background_color(SK_ColorGRAY); | 708 layer_tree_host()->set_background_color(SK_ColorGRAY); |
709 | 709 |
710 PostSetNeedsCommitToMainThread(); | 710 PostSetNeedsCommitToMainThread(); |
711 } | 711 } |
712 | 712 |
| 713 virtual void WillBeginFrameOnThread(LayerTreeHostImpl* host_impl, |
| 714 const BeginFrameArgs& args) OVERRIDE { |
| 715 if (host_impl->pending_tree()) |
| 716 frame_count_with_pending_tree_++; |
| 717 } |
| 718 |
713 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 719 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
714 if (frame_ >= 1) { | 720 if (frame_count_with_pending_tree_ > 1) { |
715 EXPECT_NE(first_frame_time_, impl->CurrentFrameTimeTicks()); | 721 EXPECT_NE(first_frame_time_.ToInternalValue(), |
| 722 impl->CurrentFrameTimeTicks().ToInternalValue()); |
716 EndTest(); | 723 EndTest(); |
717 return; | 724 return; |
718 } | 725 } |
719 | 726 |
720 EXPECT_FALSE(impl->settings().impl_side_painting); | 727 EXPECT_FALSE(impl->settings().impl_side_painting); |
721 EndTest(); | 728 EndTest(); |
722 } | 729 } |
723 | 730 |
724 virtual bool CanActivatePendingTree(LayerTreeHostImpl* impl) OVERRIDE { | 731 virtual bool CanActivatePendingTree(LayerTreeHostImpl* impl) OVERRIDE { |
725 if (frame_ >= 1) | 732 return frame_count_with_pending_tree_ > 1; |
726 return true; | |
727 | |
728 return false; | |
729 } | 733 } |
730 | 734 |
731 virtual bool CanActivatePendingTreeIfNeeded(LayerTreeHostImpl* impl) | 735 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
732 OVERRIDE { | 736 if (impl->settings().impl_side_painting) |
733 frame_++; | 737 EXPECT_NE(frame_count_with_pending_tree_, 1); |
734 if (frame_ == 1) { | |
735 first_frame_time_ = impl->CurrentFrameTimeTicks(); | |
736 | |
737 // Since base::TimeTicks::Now() uses a low-resolution clock on | |
738 // Windows, we need to make sure that the clock has incremented past | |
739 // first_frame_time_. | |
740 while (first_frame_time_ == base::TimeTicks::Now()) {} | |
741 | |
742 return false; | |
743 } | |
744 | |
745 return true; | |
746 } | 738 } |
747 | 739 |
748 virtual void AfterTest() OVERRIDE {} | 740 virtual void AfterTest() OVERRIDE {} |
749 | 741 |
750 private: | 742 private: |
751 int frame_; | 743 int frame_count_with_pending_tree_; |
752 base::TimeTicks first_frame_time_; | 744 base::TimeTicks first_frame_time_; |
753 }; | 745 }; |
754 | 746 |
755 SINGLE_AND_MULTI_THREAD_TEST_F( | 747 SINGLE_AND_MULTI_THREAD_TEST_F( |
756 LayerTreeHostTestFrameTimeUpdatesAfterActivationFails); | 748 LayerTreeHostTestFrameTimeUpdatesAfterActivationFails); |
757 | 749 |
758 // This test verifies that LayerTreeHostImpl's current frame time gets | 750 // This test verifies that LayerTreeHostImpl's current frame time gets |
759 // updated in consecutive frames when it draws in each frame. | 751 // updated in consecutive frames when it draws in each frame. |
760 class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest { | 752 class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest { |
761 public: | 753 public: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 PostSetNeedsCommitToMainThread(); | 815 PostSetNeedsCommitToMainThread(); |
824 } | 816 } |
825 | 817 |
826 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, float scale) | 818 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, float scale) |
827 OVERRIDE { | 819 OVERRIDE { |
828 gfx::Vector2d offset = scroll_layer_->scroll_offset(); | 820 gfx::Vector2d offset = scroll_layer_->scroll_offset(); |
829 scroll_layer_->SetScrollOffset(offset + scroll_delta); | 821 scroll_layer_->SetScrollOffset(offset + scroll_delta); |
830 layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f); | 822 layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f); |
831 } | 823 } |
832 | 824 |
833 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 825 virtual void SwapBuffersOnThread(LayerTreeHostImpl* impl, |
834 impl->ProcessScrollDeltas(); | 826 bool result) OVERRIDE { |
835 // We get one commit before the first draw, and the animation doesn't happen | 827 // We get one commit before the first draw, and the animation doesn't happen |
836 // until the second draw. | 828 // until the second draw. |
837 switch (impl->active_tree()->source_frame_number()) { | 829 switch (impl->active_tree()->source_frame_number()) { |
838 case 0: | 830 case 0: |
839 EXPECT_EQ(1.f, impl->active_tree()->page_scale_factor()); | 831 EXPECT_EQ(1.f, impl->active_tree()->page_scale_factor()); |
840 // We'll start an animation when we get back to the main thread. | 832 // We'll start an animation when we get back to the main thread. |
841 break; | 833 break; |
842 case 1: | 834 case 1: |
843 EXPECT_EQ(1.f, impl->active_tree()->page_scale_factor()); | 835 EXPECT_EQ(1.f, impl->active_tree()->page_scale_factor()); |
844 PostSetNeedsRedrawToMainThread(); | |
845 break; | 836 break; |
846 case 2: | 837 case 2: |
847 EXPECT_EQ(1.25f, impl->active_tree()->page_scale_factor()); | 838 EXPECT_EQ(1.25f, impl->active_tree()->page_scale_factor()); |
848 EndTest(); | 839 EndTest(); |
849 break; | 840 break; |
850 default: | 841 default: |
851 NOTREACHED(); | 842 NOTREACHED(); |
852 } | 843 } |
853 } | 844 } |
854 | 845 |
855 virtual void DidCommitAndDrawFrame() OVERRIDE { | 846 virtual void DidCommit() OVERRIDE { |
856 switch (layer_tree_host()->source_frame_number()) { | 847 switch (layer_tree_host()->source_frame_number()) { |
857 case 1: | 848 case 1: |
858 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f); | 849 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f); |
859 layer_tree_host()->StartPageScaleAnimation( | 850 layer_tree_host()->StartPageScaleAnimation( |
860 gfx::Vector2d(), false, 1.25f, base::TimeDelta()); | 851 gfx::Vector2d(), false, 1.25f, base::TimeDelta()); |
861 break; | 852 break; |
862 } | 853 } |
863 } | 854 } |
864 | 855 |
865 virtual void AfterTest() OVERRIDE {} | 856 virtual void AfterTest() OVERRIDE {} |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 parent_->AddChild(child_); | 1300 parent_->AddChild(child_); |
1310 | 1301 |
1311 layer_tree_host()->SetRootLayer(parent_); | 1302 layer_tree_host()->SetRootLayer(parent_); |
1312 LayerTreeHostTest::SetupTree(); | 1303 LayerTreeHostTest::SetupTree(); |
1313 } | 1304 } |
1314 | 1305 |
1315 virtual void BeginTest() OVERRIDE { | 1306 virtual void BeginTest() OVERRIDE { |
1316 PostSetNeedsCommitToMainThread(); | 1307 PostSetNeedsCommitToMainThread(); |
1317 } | 1308 } |
1318 | 1309 |
1319 virtual void DidCommitAndDrawFrame() OVERRIDE { | 1310 virtual void DidCommit() OVERRIDE { |
1320 switch (layer_tree_host()->source_frame_number()) { | 1311 switch (layer_tree_host()->source_frame_number()) { |
1321 case 1: | 1312 case 1: |
1322 parent_->SetNeedsDisplay(); | 1313 parent_->SetNeedsDisplay(); |
1323 child_->SetNeedsDisplay(); | 1314 child_->SetNeedsDisplay(); |
1324 break; | 1315 break; |
1325 case 2: | 1316 case 2: |
1326 // Damage part of layers. | 1317 // Damage part of layers. |
1327 parent_->SetNeedsDisplayRect(gfx::RectF(0.f, 0.f, 5.f, 5.f)); | 1318 parent_->SetNeedsDisplayRect(gfx::RectF(0.f, 0.f, 5.f, 5.f)); |
1328 child_->SetNeedsDisplayRect(gfx::RectF(0.f, 0.f, 5.f, 5.f)); | 1319 child_->SetNeedsDisplayRect(gfx::RectF(0.f, 0.f, 5.f, 5.f)); |
1329 break; | 1320 break; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 | 1431 |
1441 class LayerTreeHostTestFinishAllRendering : public LayerTreeHostTest { | 1432 class LayerTreeHostTestFinishAllRendering : public LayerTreeHostTest { |
1442 public: | 1433 public: |
1443 LayerTreeHostTestFinishAllRendering() : once_(false), draw_count_(0) {} | 1434 LayerTreeHostTestFinishAllRendering() : once_(false), draw_count_(0) {} |
1444 | 1435 |
1445 virtual void BeginTest() OVERRIDE { | 1436 virtual void BeginTest() OVERRIDE { |
1446 layer_tree_host()->SetNeedsRedraw(); | 1437 layer_tree_host()->SetNeedsRedraw(); |
1447 PostSetNeedsCommitToMainThread(); | 1438 PostSetNeedsCommitToMainThread(); |
1448 } | 1439 } |
1449 | 1440 |
1450 virtual void DidCommitAndDrawFrame() OVERRIDE { | 1441 virtual void DidCommit() OVERRIDE { |
1451 if (once_) | 1442 if (once_) |
1452 return; | 1443 return; |
1453 once_ = true; | 1444 once_ = true; |
1454 layer_tree_host()->SetNeedsRedraw(); | 1445 layer_tree_host()->SetNeedsRedraw(); |
1455 layer_tree_host()->AcquireLayerTextures(); | 1446 layer_tree_host()->AcquireLayerTextures(); |
1456 { | 1447 { |
1457 base::AutoLock lock(lock_); | 1448 base::AutoLock lock(lock_); |
1458 draw_count_ = 0; | 1449 draw_count_ = 0; |
1459 } | 1450 } |
1460 layer_tree_host()->FinishAllRendering(); | 1451 layer_tree_host()->FinishAllRendering(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 surface_layer2_->SetReplicaLayer(replica_layer2_.get()); | 1519 surface_layer2_->SetReplicaLayer(replica_layer2_.get()); |
1529 | 1520 |
1530 layer_tree_host()->SetRootLayer(root_layer_); | 1521 layer_tree_host()->SetRootLayer(root_layer_); |
1531 LayerTreeHostTest::SetupTree(); | 1522 LayerTreeHostTest::SetupTree(); |
1532 } | 1523 } |
1533 | 1524 |
1534 virtual void BeginTest() OVERRIDE { | 1525 virtual void BeginTest() OVERRIDE { |
1535 PostSetNeedsCommitToMainThread(); | 1526 PostSetNeedsCommitToMainThread(); |
1536 } | 1527 } |
1537 | 1528 |
| 1529 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
| 1530 if (host_impl->active_tree()->source_frame_number() == 0) { |
| 1531 // Reduce the memory limit to only fit the root layer and one render |
| 1532 // surface. This prevents any contents drawing into surfaces |
| 1533 // from being allocated. |
| 1534 host_impl->SetMemoryPolicy(ManagedMemoryPolicy(100 * 100 * 4 * 2)); |
| 1535 host_impl->SetDiscardBackBufferWhenNotVisible(true); |
| 1536 |
| 1537 // If ManageTiles ever deallocates resources before the subsequent draw, |
| 1538 // this test will need to change. |
| 1539 host_impl->ManageTiles(); |
| 1540 } |
| 1541 } |
| 1542 |
1538 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 1543 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
1539 Renderer* renderer = host_impl->renderer(); | 1544 Renderer* renderer = host_impl->renderer(); |
1540 RenderPass::Id surface1_render_pass_id = host_impl->active_tree() | 1545 RenderPass::Id surface1_render_pass_id = host_impl->active_tree() |
1541 ->root_layer()->children()[0]->render_surface()->RenderPassId(); | 1546 ->root_layer()->children()[0]->render_surface()->RenderPassId(); |
1542 RenderPass::Id surface2_render_pass_id = | 1547 RenderPass::Id surface2_render_pass_id = |
1543 host_impl->active_tree()->root_layer()->children()[0]->children()[0] | 1548 host_impl->active_tree()->root_layer()->children()[0]->children()[0] |
1544 ->render_surface()->RenderPassId(); | 1549 ->render_surface()->RenderPassId(); |
1545 | 1550 |
1546 switch (host_impl->active_tree()->source_frame_number()) { | 1551 switch (host_impl->active_tree()->source_frame_number()) { |
1547 case 0: | 1552 case 0: |
1548 EXPECT_TRUE(renderer->HaveCachedResourcesForRenderPassId( | 1553 EXPECT_TRUE(renderer->HaveCachedResourcesForRenderPassId( |
1549 surface1_render_pass_id)); | 1554 surface1_render_pass_id)); |
1550 EXPECT_TRUE(renderer->HaveCachedResourcesForRenderPassId( | 1555 EXPECT_TRUE(renderer->HaveCachedResourcesForRenderPassId( |
1551 surface2_render_pass_id)); | 1556 surface2_render_pass_id)); |
1552 | |
1553 // Reduce the memory limit to only fit the root layer and one render | |
1554 // surface. This prevents any contents drawing into surfaces | |
1555 // from being allocated. | |
1556 host_impl->SetMemoryPolicy(ManagedMemoryPolicy(100 * 100 * 4 * 2)); | |
1557 host_impl->SetDiscardBackBufferWhenNotVisible(true); | |
1558 break; | 1557 break; |
1559 case 1: | 1558 case 1: |
1560 EXPECT_FALSE(renderer->HaveCachedResourcesForRenderPassId( | 1559 EXPECT_FALSE(renderer->HaveCachedResourcesForRenderPassId( |
1561 surface1_render_pass_id)); | 1560 surface1_render_pass_id)); |
1562 EXPECT_FALSE(renderer->HaveCachedResourcesForRenderPassId( | 1561 EXPECT_FALSE(renderer->HaveCachedResourcesForRenderPassId( |
1563 surface2_render_pass_id)); | 1562 surface2_render_pass_id)); |
1564 | |
1565 EndTest(); | 1563 EndTest(); |
1566 break; | 1564 break; |
1567 } | 1565 } |
1568 } | 1566 } |
1569 | 1567 |
1570 virtual void DidCommitAndDrawFrame() OVERRIDE { | 1568 virtual void DidCommit() OVERRIDE { |
1571 if (layer_tree_host()->source_frame_number() < 2) | 1569 if (layer_tree_host()->source_frame_number() < 2) |
1572 root_layer_->SetNeedsDisplay(); | 1570 root_layer_->SetNeedsDisplay(); |
1573 } | 1571 } |
1574 | 1572 |
1575 virtual void AfterTest() OVERRIDE { | 1573 virtual void AfterTest() OVERRIDE { |
1576 EXPECT_LE(2u, root_layer_->update_count()); | 1574 EXPECT_LE(2u, root_layer_->update_count()); |
1577 EXPECT_LE(2u, surface_layer1_->update_count()); | 1575 EXPECT_LE(2u, surface_layer1_->update_count()); |
1578 EXPECT_LE(2u, surface_layer2_->update_count()); | 1576 EXPECT_LE(2u, surface_layer2_->update_count()); |
1579 } | 1577 } |
1580 | 1578 |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 content_layer_ = ContentLayer::Create(&client_); | 1864 content_layer_ = ContentLayer::Create(&client_); |
1867 content_layer_->SetBounds(gfx::Size(10, 10)); | 1865 content_layer_->SetBounds(gfx::Size(10, 10)); |
1868 content_layer_->SetPosition(gfx::PointF(0.f, 0.f)); | 1866 content_layer_->SetPosition(gfx::PointF(0.f, 0.f)); |
1869 content_layer_->SetAnchorPoint(gfx::PointF(0.f, 0.f)); | 1867 content_layer_->SetAnchorPoint(gfx::PointF(0.f, 0.f)); |
1870 content_layer_->SetIsDrawable(true); | 1868 content_layer_->SetIsDrawable(true); |
1871 layer_tree_host()->root_layer()->AddChild(content_layer_); | 1869 layer_tree_host()->root_layer()->AddChild(content_layer_); |
1872 | 1870 |
1873 PostSetNeedsCommitToMainThread(); | 1871 PostSetNeedsCommitToMainThread(); |
1874 } | 1872 } |
1875 | 1873 |
1876 virtual void DidCommitAndDrawFrame() OVERRIDE { | 1874 virtual void DidCommit() OVERRIDE { content_layer_->SetNeedsDisplay(); } |
1877 if (num_draw_layers_ == 2) | |
1878 return; | |
1879 content_layer_->SetNeedsDisplay(); | |
1880 } | |
1881 | 1875 |
1882 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 1876 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
1883 if (num_draw_layers_ == 1) | 1877 EXPECT_EQ(num_draw_layers_, num_commit_complete_); |
1884 num_commit_complete_++; | 1878 num_commit_complete_++; |
1885 } | 1879 } |
1886 | 1880 |
1887 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 1881 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
1888 num_draw_layers_++; | 1882 num_draw_layers_++; |
1889 if (num_draw_layers_ == 2) | 1883 if (num_draw_layers_ == 2) |
1890 EndTest(); | 1884 EndTest(); |
1891 } | 1885 } |
1892 | 1886 |
1893 virtual void AfterTest() OVERRIDE { | 1887 virtual void AfterTest() OVERRIDE {} |
1894 // Check that we didn't commit twice between first and second draw. | |
1895 EXPECT_EQ(1, num_commit_complete_); | |
1896 } | |
1897 | 1888 |
1898 private: | 1889 private: |
1899 FakeContentLayerClient client_; | 1890 FakeContentLayerClient client_; |
1900 scoped_refptr<Layer> content_layer_; | 1891 scoped_refptr<Layer> content_layer_; |
1901 int num_commit_complete_; | 1892 int num_commit_complete_; |
1902 int num_draw_layers_; | 1893 int num_draw_layers_; |
1903 }; | 1894 }; |
1904 | 1895 |
1905 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousInvalidate); | 1896 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousInvalidate); |
1906 | 1897 |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2264 settings->using_synchronous_renderer_compositor = true; | 2255 settings->using_synchronous_renderer_compositor = true; |
2265 } | 2256 } |
2266 | 2257 |
2267 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 2258 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
2268 | 2259 |
2269 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 2260 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
2270 // The BeginFrame notification is turned off now but will get enabled | 2261 // The BeginFrame notification is turned off now but will get enabled |
2271 // once we return. End test while it's enabled. | 2262 // once we return. End test while it's enabled. |
2272 ImplThreadTaskRunner()->PostTask( | 2263 ImplThreadTaskRunner()->PostTask( |
2273 FROM_HERE, | 2264 FROM_HERE, |
2274 base::Bind(&LayerTreeHostTestBeginFrameNotification::EndTest, | 2265 base::Bind( |
2275 base::Unretained(this))); | 2266 &LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled:: |
| 2267 EndTest, |
| 2268 base::Unretained(this))); |
2276 } | 2269 } |
2277 | 2270 |
2278 virtual void AfterTest() OVERRIDE {} | 2271 virtual void AfterTest() OVERRIDE {} |
2279 }; | 2272 }; |
2280 | 2273 |
2281 MULTI_THREAD_TEST_F( | 2274 MULTI_THREAD_TEST_F( |
2282 LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled); | 2275 LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled); |
2283 | 2276 |
2284 class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation | 2277 class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation |
2285 : public LayerTreeHostTest { | 2278 : public LayerTreeHostTest { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2517 root->AddChild(child); | 2510 root->AddChild(child); |
2518 | 2511 |
2519 layer_tree_host()->SetRootLayer(root); | 2512 layer_tree_host()->SetRootLayer(root); |
2520 LayerTreeHostTest::SetupTree(); | 2513 LayerTreeHostTest::SetupTree(); |
2521 } | 2514 } |
2522 | 2515 |
2523 virtual void BeginTest() OVERRIDE { | 2516 virtual void BeginTest() OVERRIDE { |
2524 PostSetNeedsCommitToMainThread(); | 2517 PostSetNeedsCommitToMainThread(); |
2525 } | 2518 } |
2526 | 2519 |
2527 virtual void DidCommitAndDrawFrame() OVERRIDE { | 2520 virtual void DidCommit() OVERRIDE { WaitForCallback(); } |
2528 WaitForCallback(); | |
2529 } | |
2530 | 2521 |
2531 void WaitForCallback() { | 2522 void WaitForCallback() { |
2532 base::MessageLoop::current()->PostTask( | 2523 base::MessageLoop::current()->PostTask( |
2533 FROM_HERE, | 2524 FROM_HERE, |
2534 base::Bind( | 2525 base::Bind( |
2535 &LayerTreeHostTestAsyncReadback::NextStep, | 2526 &LayerTreeHostTestAsyncReadback::NextStep, |
2536 base::Unretained(this))); | 2527 base::Unretained(this))); |
2537 } | 2528 } |
2538 | 2529 |
2539 void NextStep() { | 2530 void NextStep() { |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3059 layer_tree_host()->SetNeedsRedraw(); | 3050 layer_tree_host()->SetNeedsRedraw(); |
3060 break; | 3051 break; |
3061 case 3: | 3052 case 3: |
3062 // CompositeAndReadback in Round 4, first commit. | 3053 // CompositeAndReadback in Round 4, first commit. |
3063 EXPECT_EQ(2, frame_); | 3054 EXPECT_EQ(2, frame_); |
3064 break; | 3055 break; |
3065 case 4: | 3056 case 4: |
3066 // Round 4 done. | 3057 // Round 4 done. |
3067 EXPECT_EQ(2, frame_); | 3058 EXPECT_EQ(2, frame_); |
3068 layer_tree_host()->SetNeedsCommit(); | 3059 layer_tree_host()->SetNeedsCommit(); |
| 3060 // We can't SetNeedsRedraw immediately because it will race the commit. |
| 3061 break; |
| 3062 case 5: |
| 3063 EXPECT_EQ(2, frame_); |
3069 layer_tree_host()->SetNeedsRedraw(); | 3064 layer_tree_host()->SetNeedsRedraw(); |
3070 break; | 3065 break; |
3071 } | 3066 } |
3072 } | 3067 } |
3073 | 3068 |
3074 virtual void DidCompleteSwapBuffers() OVERRIDE { | 3069 virtual void DidCompleteSwapBuffers() OVERRIDE { |
3075 int commit = layer_tree_host()->source_frame_number(); | 3070 int commit = layer_tree_host()->source_frame_number(); |
3076 ++frame_; | 3071 ++frame_; |
3077 char pixels[4] = {0}; | 3072 char pixels[4] = {0}; |
3078 switch (frame_) { | 3073 switch (frame_) { |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3379 child2_->AddChild(leaf_picture_layer_); | 3374 child2_->AddChild(leaf_picture_layer_); |
3380 if (leaf_content_layer_) | 3375 if (leaf_content_layer_) |
3381 child2_->AddChild(leaf_content_layer_); | 3376 child2_->AddChild(leaf_content_layer_); |
3382 | 3377 |
3383 other_root_ = PushPropertiesCountingLayer::Create(); | 3378 other_root_ = PushPropertiesCountingLayer::Create(); |
3384 | 3379 |
3385 // Don't set the root layer here. | 3380 // Don't set the root layer here. |
3386 LayerTreeHostTest::SetupTree(); | 3381 LayerTreeHostTest::SetupTree(); |
3387 } | 3382 } |
3388 | 3383 |
3389 virtual void DidCommitAndDrawFrame() OVERRIDE { | 3384 virtual void DidCommit() OVERRIDE { |
3390 ++num_commits_; | 3385 ++num_commits_; |
3391 | 3386 |
3392 EXPECT_EQ(expected_push_properties_root_, root_->push_properties_count()); | 3387 EXPECT_EQ(expected_push_properties_root_, root_->push_properties_count()); |
3393 EXPECT_EQ(expected_push_properties_child_, child_->push_properties_count()); | 3388 EXPECT_EQ(expected_push_properties_child_, child_->push_properties_count()); |
3394 EXPECT_EQ(expected_push_properties_grandchild_, | 3389 EXPECT_EQ(expected_push_properties_grandchild_, |
3395 grandchild_->push_properties_count()); | 3390 grandchild_->push_properties_count()); |
3396 EXPECT_EQ(expected_push_properties_child2_, | 3391 EXPECT_EQ(expected_push_properties_child2_, |
3397 child2_->push_properties_count()); | 3392 child2_->push_properties_count()); |
3398 EXPECT_EQ(expected_push_properties_other_root_, | 3393 EXPECT_EQ(expected_push_properties_other_root_, |
3399 other_root_->push_properties_count()); | 3394 other_root_->push_properties_count()); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3573 bool has_thumb = false; | 3568 bool has_thumb = false; |
3574 scrollbar_layer_ = | 3569 scrollbar_layer_ = |
3575 FakeScrollbarLayer::Create(paint_scrollbar, has_thumb, root_->id()); | 3570 FakeScrollbarLayer::Create(paint_scrollbar, has_thumb, root_->id()); |
3576 | 3571 |
3577 root_->AddChild(scrollbar_layer_); | 3572 root_->AddChild(scrollbar_layer_); |
3578 | 3573 |
3579 layer_tree_host()->SetRootLayer(root_); | 3574 layer_tree_host()->SetRootLayer(root_); |
3580 LayerTreeHostTest::SetupTree(); | 3575 LayerTreeHostTest::SetupTree(); |
3581 } | 3576 } |
3582 | 3577 |
3583 virtual void DidCommitAndDrawFrame() OVERRIDE { | 3578 virtual void DidCommit() OVERRIDE { |
3584 switch (layer_tree_host()->source_frame_number()) { | 3579 switch (layer_tree_host()->source_frame_number()) { |
3585 case 0: | 3580 case 0: |
3586 break; | 3581 break; |
3587 case 1: { | 3582 case 1: { |
3588 // During update, the ignore_set_needs_commit_ bit is set to true to | 3583 // During update, the ignore_set_needs_commit_ bit is set to true to |
3589 // avoid causing a second commit to be scheduled. If a property change | 3584 // avoid causing a second commit to be scheduled. If a property change |
3590 // is made during this, however, it needs to be pushed in the upcoming | 3585 // is made during this, however, it needs to be pushed in the upcoming |
3591 // commit. | 3586 // commit. |
3592 scoped_ptr<base::AutoReset<bool> > ignore = | 3587 scoped_ptr<base::AutoReset<bool> > ignore = |
3593 scrollbar_layer_->IgnoreSetNeedsCommit(); | 3588 scrollbar_layer_->IgnoreSetNeedsCommit(); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3656 size_t expected_push_properties_root_; | 3651 size_t expected_push_properties_root_; |
3657 size_t expected_push_properties_child_; | 3652 size_t expected_push_properties_child_; |
3658 size_t expected_push_properties_grandchild1_; | 3653 size_t expected_push_properties_grandchild1_; |
3659 size_t expected_push_properties_grandchild2_; | 3654 size_t expected_push_properties_grandchild2_; |
3660 size_t expected_push_properties_grandchild3_; | 3655 size_t expected_push_properties_grandchild3_; |
3661 }; | 3656 }; |
3662 | 3657 |
3663 class LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush | 3658 class LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush |
3664 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { | 3659 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { |
3665 protected: | 3660 protected: |
3666 virtual void DidCommitAndDrawFrame() OVERRIDE { | 3661 virtual void DidCommit() OVERRIDE { |
3667 int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; | 3662 int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; |
3668 switch (last_source_frame_number) { | 3663 switch (last_source_frame_number) { |
3669 case 0: | 3664 case 0: |
3670 EXPECT_FALSE(root_->needs_push_properties()); | 3665 EXPECT_FALSE(root_->needs_push_properties()); |
3671 EXPECT_FALSE(root_->descendant_needs_push_properties()); | 3666 EXPECT_FALSE(root_->descendant_needs_push_properties()); |
3672 EXPECT_FALSE(child_->needs_push_properties()); | 3667 EXPECT_FALSE(child_->needs_push_properties()); |
3673 EXPECT_FALSE(child_->descendant_needs_push_properties()); | 3668 EXPECT_FALSE(child_->descendant_needs_push_properties()); |
3674 EXPECT_FALSE(grandchild1_->needs_push_properties()); | 3669 EXPECT_FALSE(grandchild1_->needs_push_properties()); |
3675 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); | 3670 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); |
3676 EXPECT_FALSE(grandchild2_->needs_push_properties()); | 3671 EXPECT_FALSE(grandchild2_->needs_push_properties()); |
(...skipping 19 matching lines...) Expand all Loading... |
3696 break; | 3691 break; |
3697 } | 3692 } |
3698 } | 3693 } |
3699 }; | 3694 }; |
3700 | 3695 |
3701 MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush); | 3696 MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush); |
3702 | 3697 |
3703 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion | 3698 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion |
3704 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { | 3699 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { |
3705 protected: | 3700 protected: |
3706 virtual void DidCommitAndDrawFrame() OVERRIDE { | 3701 virtual void DidCommit() OVERRIDE { |
3707 int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; | 3702 int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; |
3708 switch (last_source_frame_number) { | 3703 switch (last_source_frame_number) { |
3709 case 0: | 3704 case 0: |
3710 layer_tree_host()->SetRootLayer(root_); | 3705 layer_tree_host()->SetRootLayer(root_); |
3711 break; | 3706 break; |
3712 case 1: | 3707 case 1: |
3713 EXPECT_FALSE(root_->needs_push_properties()); | 3708 EXPECT_FALSE(root_->needs_push_properties()); |
3714 EXPECT_FALSE(root_->descendant_needs_push_properties()); | 3709 EXPECT_FALSE(root_->descendant_needs_push_properties()); |
3715 EXPECT_FALSE(child_->needs_push_properties()); | 3710 EXPECT_FALSE(child_->needs_push_properties()); |
3716 EXPECT_FALSE(child_->descendant_needs_push_properties()); | 3711 EXPECT_FALSE(child_->descendant_needs_push_properties()); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3779 break; | 3774 break; |
3780 } | 3775 } |
3781 } | 3776 } |
3782 }; | 3777 }; |
3783 | 3778 |
3784 MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion); | 3779 MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion); |
3785 | 3780 |
3786 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence | 3781 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence |
3787 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { | 3782 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { |
3788 protected: | 3783 protected: |
3789 virtual void DidCommitAndDrawFrame() OVERRIDE { | 3784 virtual void DidCommit() OVERRIDE { |
3790 int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; | 3785 int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; |
3791 switch (last_source_frame_number) { | 3786 switch (last_source_frame_number) { |
3792 case 0: | 3787 case 0: |
3793 layer_tree_host()->SetRootLayer(root_); | 3788 layer_tree_host()->SetRootLayer(root_); |
3794 grandchild1_->set_persist_needs_push_properties(true); | 3789 grandchild1_->set_persist_needs_push_properties(true); |
3795 grandchild2_->set_persist_needs_push_properties(true); | 3790 grandchild2_->set_persist_needs_push_properties(true); |
3796 break; | 3791 break; |
3797 case 1: | 3792 case 1: |
3798 EXPECT_FALSE(root_->needs_push_properties()); | 3793 EXPECT_FALSE(root_->needs_push_properties()); |
3799 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3794 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
(...skipping 27 matching lines...) Expand all Loading... |
3827 } | 3822 } |
3828 } | 3823 } |
3829 }; | 3824 }; |
3830 | 3825 |
3831 MULTI_THREAD_TEST_F( | 3826 MULTI_THREAD_TEST_F( |
3832 LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence); | 3827 LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence); |
3833 | 3828 |
3834 class LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree | 3829 class LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree |
3835 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { | 3830 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { |
3836 protected: | 3831 protected: |
3837 virtual void DidCommitAndDrawFrame() OVERRIDE { | 3832 virtual void DidCommit() OVERRIDE { |
3838 int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; | 3833 int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; |
3839 switch (last_source_frame_number) { | 3834 switch (last_source_frame_number) { |
3840 case 0: | 3835 case 0: |
3841 layer_tree_host()->SetRootLayer(root_); | 3836 layer_tree_host()->SetRootLayer(root_); |
3842 break; | 3837 break; |
3843 case 1: | 3838 case 1: |
3844 EXPECT_FALSE(root_->needs_push_properties()); | 3839 EXPECT_FALSE(root_->needs_push_properties()); |
3845 EXPECT_FALSE(root_->descendant_needs_push_properties()); | 3840 EXPECT_FALSE(root_->descendant_needs_push_properties()); |
3846 EXPECT_FALSE(child_->needs_push_properties()); | 3841 EXPECT_FALSE(child_->needs_push_properties()); |
3847 EXPECT_FALSE(child_->descendant_needs_push_properties()); | 3842 EXPECT_FALSE(child_->descendant_needs_push_properties()); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3895 } | 3890 } |
3896 } | 3891 } |
3897 }; | 3892 }; |
3898 | 3893 |
3899 MULTI_THREAD_TEST_F( | 3894 MULTI_THREAD_TEST_F( |
3900 LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree); | 3895 LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree); |
3901 | 3896 |
3902 class LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild | 3897 class LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild |
3903 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { | 3898 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { |
3904 protected: | 3899 protected: |
3905 virtual void DidCommitAndDrawFrame() OVERRIDE { | 3900 virtual void DidCommit() OVERRIDE { |
3906 int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; | 3901 int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; |
3907 switch (last_source_frame_number) { | 3902 switch (last_source_frame_number) { |
3908 case 0: | 3903 case 0: |
3909 layer_tree_host()->SetRootLayer(root_); | 3904 layer_tree_host()->SetRootLayer(root_); |
3910 break; | 3905 break; |
3911 case 1: | 3906 case 1: |
3912 EXPECT_FALSE(root_->needs_push_properties()); | 3907 EXPECT_FALSE(root_->needs_push_properties()); |
3913 EXPECT_FALSE(root_->descendant_needs_push_properties()); | 3908 EXPECT_FALSE(root_->descendant_needs_push_properties()); |
3914 EXPECT_FALSE(child_->needs_push_properties()); | 3909 EXPECT_FALSE(child_->needs_push_properties()); |
3915 EXPECT_FALSE(child_->descendant_needs_push_properties()); | 3910 EXPECT_FALSE(child_->descendant_needs_push_properties()); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3959 } | 3954 } |
3960 } | 3955 } |
3961 }; | 3956 }; |
3962 | 3957 |
3963 MULTI_THREAD_TEST_F( | 3958 MULTI_THREAD_TEST_F( |
3964 LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild); | 3959 LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild); |
3965 | 3960 |
3966 class LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent | 3961 class LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent |
3967 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { | 3962 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { |
3968 protected: | 3963 protected: |
3969 virtual void DidCommitAndDrawFrame() OVERRIDE { | 3964 virtual void DidCommit() OVERRIDE { |
3970 int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; | 3965 int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; |
3971 switch (last_source_frame_number) { | 3966 switch (last_source_frame_number) { |
3972 case 0: | 3967 case 0: |
3973 layer_tree_host()->SetRootLayer(root_); | 3968 layer_tree_host()->SetRootLayer(root_); |
3974 break; | 3969 break; |
3975 case 1: | 3970 case 1: |
3976 EXPECT_FALSE(root_->needs_push_properties()); | 3971 EXPECT_FALSE(root_->needs_push_properties()); |
3977 EXPECT_FALSE(root_->descendant_needs_push_properties()); | 3972 EXPECT_FALSE(root_->descendant_needs_push_properties()); |
3978 EXPECT_FALSE(child_->needs_push_properties()); | 3973 EXPECT_FALSE(child_->needs_push_properties()); |
3979 EXPECT_FALSE(child_->descendant_needs_push_properties()); | 3974 EXPECT_FALSE(child_->descendant_needs_push_properties()); |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4344 int num_will_begin_frames_; | 4339 int num_will_begin_frames_; |
4345 int num_impl_commits_; | 4340 int num_impl_commits_; |
4346 }; | 4341 }; |
4347 | 4342 |
4348 // Commits can only be aborted when using the thread proxy. | 4343 // Commits can only be aborted when using the thread proxy. |
4349 MULTI_THREAD_TEST_F(LayerTreeHostTestAbortEvictedTextures); | 4344 MULTI_THREAD_TEST_F(LayerTreeHostTestAbortEvictedTextures); |
4350 | 4345 |
4351 } // namespace | 4346 } // namespace |
4352 | 4347 |
4353 } // namespace cc | 4348 } // namespace cc |
OLD | NEW |