Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 952893003: Update from https://crrev.com/317530 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix gn for nacl Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_common.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "cc/animation/layer_animation_controller.h" 10 #include "cc/animation/layer_animation_controller.h"
(...skipping 5659 matching lines...) Expand 10 before | Expand all | Expand 10 after
5670 // We should have one render surface and two layers. The child 5670 // We should have one render surface and two layers. The child
5671 // layer should be included even though it is transparent. 5671 // layer should be included even though it is transparent.
5672 ASSERT_EQ(1u, render_surface_layer_list.size()); 5672 ASSERT_EQ(1u, render_surface_layer_list.size());
5673 ASSERT_EQ(2u, root->render_surface()->layer_list().size()); 5673 ASSERT_EQ(2u, root->render_surface()->layer_list().size());
5674 } 5674 }
5675 5675
5676 using LCDTextTestParam = std::tr1::tuple<bool, bool, bool>; 5676 using LCDTextTestParam = std::tr1::tuple<bool, bool, bool>;
5677 class LCDTextTest 5677 class LCDTextTest
5678 : public LayerTreeHostCommonTestBase, 5678 : public LayerTreeHostCommonTestBase,
5679 public testing::TestWithParam<LCDTextTestParam> { 5679 public testing::TestWithParam<LCDTextTestParam> {
5680 public:
5681 LCDTextTest()
5682 : host_impl_(&proxy_, &shared_bitmap_manager_),
5683 root_(nullptr),
5684 child_(nullptr),
5685 grand_child_(nullptr) {}
5686
5680 protected: 5687 protected:
5681 void SetUp() override { 5688 void SetUp() override {
5682 can_use_lcd_text_ = std::tr1::get<0>(GetParam()); 5689 can_use_lcd_text_ = std::tr1::get<0>(GetParam());
5683 layers_always_allowed_lcd_text_ = std::tr1::get<1>(GetParam()); 5690 layers_always_allowed_lcd_text_ = std::tr1::get<1>(GetParam());
5684 5691
5685 root_ = Layer::Create(); 5692 scoped_ptr<LayerImpl> root_ptr =
5686 child_ = Layer::Create(); 5693 LayerImpl::Create(host_impl_.active_tree(), 1);
5687 grand_child_ = Layer::Create(); 5694 scoped_ptr<LayerImpl> child_ptr =
5688 child_->AddChild(grand_child_.get()); 5695 LayerImpl::Create(host_impl_.active_tree(), 2);
5689 root_->AddChild(child_.get()); 5696 scoped_ptr<LayerImpl> grand_child_ptr =
5697 LayerImpl::Create(host_impl_.active_tree(), 3);
5698
5699 // Stash raw pointers to look at later.
5700 root_ = root_ptr.get();
5701 child_ = child_ptr.get();
5702 grand_child_ = grand_child_ptr.get();
5703
5704 child_->AddChild(grand_child_ptr.Pass());
5705 root_->AddChild(child_ptr.Pass());
5706 host_impl_.active_tree()->SetRootLayer(root_ptr.Pass());
5690 5707
5691 root_->SetContentsOpaque(true); 5708 root_->SetContentsOpaque(true);
5692 child_->SetContentsOpaque(true); 5709 child_->SetContentsOpaque(true);
5693 grand_child_->SetContentsOpaque(true); 5710 grand_child_->SetContentsOpaque(true);
5694 5711
5695 gfx::Transform identity_matrix; 5712 gfx::Transform identity_matrix;
5696 SetLayerPropertiesForTesting(root_.get(), 5713 SetLayerPropertiesForTesting(root_, identity_matrix, gfx::Point3F(),
5697 identity_matrix, 5714 gfx::PointF(), gfx::Size(1, 1), true, false,
5698 gfx::Point3F(), 5715 true);
5699 gfx::PointF(), 5716 SetLayerPropertiesForTesting(child_, identity_matrix, gfx::Point3F(),
5700 gfx::Size(1, 1), 5717 gfx::PointF(), gfx::Size(1, 1), true, false,
5701 true, 5718 std::tr1::get<2>(GetParam()));
5719 SetLayerPropertiesForTesting(grand_child_, identity_matrix, gfx::Point3F(),
5720 gfx::PointF(), gfx::Size(1, 1), true, false,
5702 false); 5721 false);
5703 SetLayerPropertiesForTesting(child_.get(),
5704 identity_matrix,
5705 gfx::Point3F(),
5706 gfx::PointF(),
5707 gfx::Size(1, 1),
5708 true,
5709 false);
5710 SetLayerPropertiesForTesting(grand_child_.get(),
5711 identity_matrix,
5712 gfx::Point3F(),
5713 gfx::PointF(),
5714 gfx::Size(1, 1),
5715 true,
5716 false);
5717
5718 child_->SetForceRenderSurface(std::tr1::get<2>(GetParam()));
5719
5720 host_ = CreateFakeLayerTreeHost();
5721 host_->SetRootLayer(root_);
5722 } 5722 }
5723 5723
5724 bool can_use_lcd_text_; 5724 bool can_use_lcd_text_;
5725 bool layers_always_allowed_lcd_text_; 5725 bool layers_always_allowed_lcd_text_;
5726 scoped_ptr<FakeLayerTreeHost> host_; 5726
5727 scoped_refptr<Layer> root_; 5727 FakeImplProxy proxy_;
5728 scoped_refptr<Layer> child_; 5728 TestSharedBitmapManager shared_bitmap_manager_;
5729 scoped_refptr<Layer> grand_child_; 5729 FakeLayerTreeHostImpl host_impl_;
5730
5731 LayerImpl* root_;
5732 LayerImpl* child_;
5733 LayerImpl* grand_child_;
5730 }; 5734 };
5731 5735
5732 TEST_P(LCDTextTest, CanUseLCDText) { 5736 TEST_P(LCDTextTest, CanUseLCDText) {
5733 bool expect_lcd_text = can_use_lcd_text_ || layers_always_allowed_lcd_text_; 5737 bool expect_lcd_text = can_use_lcd_text_ || layers_always_allowed_lcd_text_;
5734 bool expect_not_lcd_text = layers_always_allowed_lcd_text_; 5738 bool expect_not_lcd_text = layers_always_allowed_lcd_text_;
5735 5739
5736 // Case 1: Identity transform. 5740 // Case 1: Identity transform.
5737 gfx::Transform identity_matrix; 5741 gfx::Transform identity_matrix;
5738 ExecuteCalculateDrawProperties(root_.get(), 1.f, 1.f, NULL, can_use_lcd_text_, 5742 ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL, can_use_lcd_text_,
5739 layers_always_allowed_lcd_text_); 5743 layers_always_allowed_lcd_text_);
5740 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text()); 5744 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text());
5741 EXPECT_EQ(expect_lcd_text, child_->can_use_lcd_text()); 5745 EXPECT_EQ(expect_lcd_text, child_->can_use_lcd_text());
5742 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text()); 5746 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text());
5743 5747
5744 // Case 2: Integral translation. 5748 // Case 2: Integral translation.
5745 gfx::Transform integral_translation; 5749 gfx::Transform integral_translation;
5746 integral_translation.Translate(1.0, 2.0); 5750 integral_translation.Translate(1.0, 2.0);
5747 child_->SetTransform(integral_translation); 5751 child_->SetTransform(integral_translation);
5748 ExecuteCalculateDrawProperties(root_.get(), 1.f, 1.f, NULL, can_use_lcd_text_, 5752 ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL, can_use_lcd_text_,
5749 layers_always_allowed_lcd_text_); 5753 layers_always_allowed_lcd_text_);
5750 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text()); 5754 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text());
5751 EXPECT_EQ(expect_lcd_text, child_->can_use_lcd_text()); 5755 EXPECT_EQ(expect_lcd_text, child_->can_use_lcd_text());
5752 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text()); 5756 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text());
5753 5757
5754 // Case 3: Non-integral translation. 5758 // Case 3: Non-integral translation.
5755 gfx::Transform non_integral_translation; 5759 gfx::Transform non_integral_translation;
5756 non_integral_translation.Translate(1.5, 2.5); 5760 non_integral_translation.Translate(1.5, 2.5);
5757 child_->SetTransform(non_integral_translation); 5761 child_->SetTransform(non_integral_translation);
5758 ExecuteCalculateDrawProperties(root_.get(), 1.f, 1.f, NULL, can_use_lcd_text_, 5762 ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL, can_use_lcd_text_,
5759 layers_always_allowed_lcd_text_); 5763 layers_always_allowed_lcd_text_);
5760 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text()); 5764 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text());
5761 EXPECT_EQ(expect_not_lcd_text, child_->can_use_lcd_text()); 5765 EXPECT_EQ(expect_not_lcd_text, child_->can_use_lcd_text());
5762 EXPECT_EQ(expect_not_lcd_text, grand_child_->can_use_lcd_text()); 5766 EXPECT_EQ(expect_not_lcd_text, grand_child_->can_use_lcd_text());
5763 5767
5764 // Case 4: Rotation. 5768 // Case 4: Rotation.
5765 gfx::Transform rotation; 5769 gfx::Transform rotation;
5766 rotation.Rotate(10.0); 5770 rotation.Rotate(10.0);
5767 child_->SetTransform(rotation); 5771 child_->SetTransform(rotation);
5768 ExecuteCalculateDrawProperties(root_.get(), 1.f, 1.f, NULL, can_use_lcd_text_, 5772 ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL, can_use_lcd_text_,
5769 layers_always_allowed_lcd_text_); 5773 layers_always_allowed_lcd_text_);
5770 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text()); 5774 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text());
5771 EXPECT_EQ(expect_not_lcd_text, child_->can_use_lcd_text()); 5775 EXPECT_EQ(expect_not_lcd_text, child_->can_use_lcd_text());
5772 EXPECT_EQ(expect_not_lcd_text, grand_child_->can_use_lcd_text()); 5776 EXPECT_EQ(expect_not_lcd_text, grand_child_->can_use_lcd_text());
5773 5777
5774 // Case 5: Scale. 5778 // Case 5: Scale.
5775 gfx::Transform scale; 5779 gfx::Transform scale;
5776 scale.Scale(2.0, 2.0); 5780 scale.Scale(2.0, 2.0);
5777 child_->SetTransform(scale); 5781 child_->SetTransform(scale);
5778 ExecuteCalculateDrawProperties(root_.get(), 1.f, 1.f, NULL, can_use_lcd_text_, 5782 ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL, can_use_lcd_text_,
5779 layers_always_allowed_lcd_text_); 5783 layers_always_allowed_lcd_text_);
5780 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text()); 5784 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text());
5781 EXPECT_EQ(expect_not_lcd_text, child_->can_use_lcd_text()); 5785 EXPECT_EQ(expect_not_lcd_text, child_->can_use_lcd_text());
5782 EXPECT_EQ(expect_not_lcd_text, grand_child_->can_use_lcd_text()); 5786 EXPECT_EQ(expect_not_lcd_text, grand_child_->can_use_lcd_text());
5783 5787
5784 // Case 6: Skew. 5788 // Case 6: Skew.
5785 gfx::Transform skew; 5789 gfx::Transform skew;
5786 skew.SkewX(10.0); 5790 skew.SkewX(10.0);
5787 child_->SetTransform(skew); 5791 child_->SetTransform(skew);
5788 ExecuteCalculateDrawProperties(root_.get(), 1.f, 1.f, NULL, can_use_lcd_text_, 5792 ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL, can_use_lcd_text_,
5789 layers_always_allowed_lcd_text_); 5793 layers_always_allowed_lcd_text_);
5790 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text()); 5794 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text());
5791 EXPECT_EQ(expect_not_lcd_text, child_->can_use_lcd_text()); 5795 EXPECT_EQ(expect_not_lcd_text, child_->can_use_lcd_text());
5792 EXPECT_EQ(expect_not_lcd_text, grand_child_->can_use_lcd_text()); 5796 EXPECT_EQ(expect_not_lcd_text, grand_child_->can_use_lcd_text());
5793 5797
5794 // Case 7: Translucent. 5798 // Case 7: Translucent.
5795 child_->SetTransform(identity_matrix); 5799 child_->SetTransform(identity_matrix);
5796 child_->SetOpacity(0.5f); 5800 child_->SetOpacity(0.5f);
5797 ExecuteCalculateDrawProperties(root_.get(), 1.f, 1.f, NULL, can_use_lcd_text_, 5801 ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL, can_use_lcd_text_,
5798 layers_always_allowed_lcd_text_); 5802 layers_always_allowed_lcd_text_);
5799 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text()); 5803 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text());
5800 EXPECT_EQ(expect_not_lcd_text, child_->can_use_lcd_text()); 5804 EXPECT_EQ(expect_not_lcd_text, child_->can_use_lcd_text());
5801 EXPECT_EQ(expect_not_lcd_text, grand_child_->can_use_lcd_text()); 5805 EXPECT_EQ(expect_not_lcd_text, grand_child_->can_use_lcd_text());
5802 5806
5803 // Case 8: Sanity check: restore transform and opacity. 5807 // Case 8: Sanity check: restore transform and opacity.
5804 child_->SetTransform(identity_matrix); 5808 child_->SetTransform(identity_matrix);
5805 child_->SetOpacity(1.f); 5809 child_->SetOpacity(1.f);
5806 ExecuteCalculateDrawProperties(root_.get(), 1.f, 1.f, NULL, can_use_lcd_text_, 5810 ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL, can_use_lcd_text_,
5807 layers_always_allowed_lcd_text_); 5811 layers_always_allowed_lcd_text_);
5808 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text()); 5812 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text());
5809 EXPECT_EQ(expect_lcd_text, child_->can_use_lcd_text()); 5813 EXPECT_EQ(expect_lcd_text, child_->can_use_lcd_text());
5810 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text()); 5814 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text());
5811 5815
5812 // Case 9: Non-opaque content. 5816 // Case 9: Non-opaque content.
5813 child_->SetContentsOpaque(false); 5817 child_->SetContentsOpaque(false);
5814 ExecuteCalculateDrawProperties(root_.get(), 1.f, 1.f, NULL, can_use_lcd_text_, 5818 ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL, can_use_lcd_text_,
5815 layers_always_allowed_lcd_text_); 5819 layers_always_allowed_lcd_text_);
5816 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text()); 5820 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text());
5817 EXPECT_EQ(expect_not_lcd_text, child_->can_use_lcd_text()); 5821 EXPECT_EQ(expect_not_lcd_text, child_->can_use_lcd_text());
5818 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text()); 5822 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text());
5819 5823
5820 // Case 10: Sanity check: restore content opaqueness. 5824 // Case 10: Sanity check: restore content opaqueness.
5821 child_->SetContentsOpaque(true); 5825 child_->SetContentsOpaque(true);
5822 ExecuteCalculateDrawProperties(root_.get(), 1.f, 1.f, NULL, can_use_lcd_text_, 5826 ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL, can_use_lcd_text_,
5823 layers_always_allowed_lcd_text_); 5827 layers_always_allowed_lcd_text_);
5824 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text()); 5828 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text());
5825 EXPECT_EQ(expect_lcd_text, child_->can_use_lcd_text()); 5829 EXPECT_EQ(expect_lcd_text, child_->can_use_lcd_text());
5826 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text()); 5830 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text());
5827 } 5831 }
5828 5832
5829 TEST_P(LCDTextTest, CanUseLCDTextWithAnimation) { 5833 TEST_P(LCDTextTest, CanUseLCDTextWithAnimation) {
5830 bool expect_lcd_text = can_use_lcd_text_ || layers_always_allowed_lcd_text_; 5834 bool expect_lcd_text = can_use_lcd_text_ || layers_always_allowed_lcd_text_;
5831 5835
5832 // Sanity check: Make sure can_use_lcd_text_ is set on each node. 5836 // Sanity check: Make sure can_use_lcd_text_ is set on each node.
5833 ExecuteCalculateDrawProperties(root_.get(), 1.f, 1.f, NULL, can_use_lcd_text_, 5837 ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL, can_use_lcd_text_,
5834 layers_always_allowed_lcd_text_); 5838 layers_always_allowed_lcd_text_);
5835 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text()); 5839 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text());
5836 EXPECT_EQ(expect_lcd_text, child_->can_use_lcd_text()); 5840 EXPECT_EQ(expect_lcd_text, child_->can_use_lcd_text());
5837 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text()); 5841 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text());
5838 5842
5839 // Add opacity animation. 5843 // Add opacity animation.
5840 child_->SetOpacity(0.9f); 5844 child_->SetOpacity(0.9f);
5841 AddOpacityTransitionToController( 5845 AddOpacityTransitionToController(
5842 child_->layer_animation_controller(), 10.0, 0.9f, 0.1f, false); 5846 child_->layer_animation_controller(), 10.0, 0.9f, 0.1f, false);
5843 5847
5844 ExecuteCalculateDrawProperties(root_.get(), 1.f, 1.f, NULL, can_use_lcd_text_, 5848 ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL, can_use_lcd_text_,
5845 layers_always_allowed_lcd_text_); 5849 layers_always_allowed_lcd_text_);
5846 // Text AA should not be adjusted while animation is active. 5850 // Text AA should not be adjusted while animation is active.
5847 // Make sure LCD text AA setting remains unchanged. 5851 // Make sure LCD text AA setting remains unchanged.
5848 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text()); 5852 EXPECT_EQ(expect_lcd_text, root_->can_use_lcd_text());
5849 EXPECT_EQ(expect_lcd_text, child_->can_use_lcd_text()); 5853 EXPECT_EQ(expect_lcd_text, child_->can_use_lcd_text());
5850 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text()); 5854 EXPECT_EQ(expect_lcd_text, grand_child_->can_use_lcd_text());
5851 } 5855 }
5852 5856
5853 INSTANTIATE_TEST_CASE_P(LayerTreeHostCommonTest, 5857 INSTANTIATE_TEST_CASE_P(LayerTreeHostCommonTest,
5854 LCDTextTest, 5858 LCDTextTest,
(...skipping 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after
7964 // |grand_parent|, |parent|, and |child| have scale-affecting animations. 7968 // |grand_parent|, |parent|, and |child| have scale-affecting animations.
7965 EXPECT_EQ(5.f, 7969 EXPECT_EQ(5.f,
7966 grand_parent->draw_properties().maximum_animation_contents_scale); 7970 grand_parent->draw_properties().maximum_animation_contents_scale);
7967 EXPECT_EQ(0.f, 7971 EXPECT_EQ(0.f,
7968 parent_raw->draw_properties().maximum_animation_contents_scale); 7972 parent_raw->draw_properties().maximum_animation_contents_scale);
7969 EXPECT_EQ(0.f, child_raw->draw_properties().maximum_animation_contents_scale); 7973 EXPECT_EQ(0.f, child_raw->draw_properties().maximum_animation_contents_scale);
7970 EXPECT_EQ( 7974 EXPECT_EQ(
7971 0.f, grand_child_raw->draw_properties().maximum_animation_contents_scale); 7975 0.f, grand_child_raw->draw_properties().maximum_animation_contents_scale);
7972 7976
7973 grand_parent->layer_animation_controller()->AbortAnimations( 7977 grand_parent->layer_animation_controller()->AbortAnimations(
7974 Animation::Transform); 7978 Animation::TRANSFORM);
7975 parent_raw->layer_animation_controller()->AbortAnimations( 7979 parent_raw->layer_animation_controller()->AbortAnimations(
7976 Animation::Transform); 7980 Animation::TRANSFORM);
7977 child_raw->layer_animation_controller()->AbortAnimations( 7981 child_raw->layer_animation_controller()->AbortAnimations(
7978 Animation::Transform); 7982 Animation::TRANSFORM);
7979 7983
7980 TransformOperations perspective; 7984 TransformOperations perspective;
7981 perspective.AppendPerspective(10.f); 7985 perspective.AppendPerspective(10.f);
7982 7986
7983 AddAnimatedTransformToLayer( 7987 AddAnimatedTransformToLayer(
7984 child_raw, 1.0, TransformOperations(), perspective); 7988 child_raw, 1.0, TransformOperations(), perspective);
7985 ExecuteCalculateDrawProperties(grand_parent.get()); 7989 ExecuteCalculateDrawProperties(grand_parent.get());
7986 7990
7987 // |child| has a scale-affecting animation but computing the maximum of this 7991 // |child| has a scale-affecting animation but computing the maximum of this
7988 // animation is not supported. 7992 // animation is not supported.
7989 EXPECT_EQ(0.f, 7993 EXPECT_EQ(0.f,
7990 grand_parent->draw_properties().maximum_animation_contents_scale); 7994 grand_parent->draw_properties().maximum_animation_contents_scale);
7991 EXPECT_EQ(0.f, 7995 EXPECT_EQ(0.f,
7992 parent_raw->draw_properties().maximum_animation_contents_scale); 7996 parent_raw->draw_properties().maximum_animation_contents_scale);
7993 EXPECT_EQ(0.f, child_raw->draw_properties().maximum_animation_contents_scale); 7997 EXPECT_EQ(0.f, child_raw->draw_properties().maximum_animation_contents_scale);
7994 EXPECT_EQ( 7998 EXPECT_EQ(
7995 0.f, grand_child_raw->draw_properties().maximum_animation_contents_scale); 7999 0.f, grand_child_raw->draw_properties().maximum_animation_contents_scale);
7996 8000
7997 child_raw->layer_animation_controller()->AbortAnimations( 8001 child_raw->layer_animation_controller()->AbortAnimations(
7998 Animation::Transform); 8002 Animation::TRANSFORM);
7999 8003
8000 gfx::Transform scale_matrix; 8004 gfx::Transform scale_matrix;
8001 scale_matrix.Scale(1.f, 2.f); 8005 scale_matrix.Scale(1.f, 2.f);
8002 grand_parent->SetTransform(scale_matrix); 8006 grand_parent->SetTransform(scale_matrix);
8003 parent_raw->SetTransform(scale_matrix); 8007 parent_raw->SetTransform(scale_matrix);
8004 AddAnimatedTransformToLayer(parent_raw, 1.0, TransformOperations(), scale); 8008 AddAnimatedTransformToLayer(parent_raw, 1.0, TransformOperations(), scale);
8005 ExecuteCalculateDrawProperties(grand_parent.get()); 8009 ExecuteCalculateDrawProperties(grand_parent.get());
8006 8010
8007 // |grand_parent| and |parent| each have scale 2.f. |parent| has a scale 8011 // |grand_parent| and |parent| each have scale 2.f. |parent| has a scale
8008 // animation with maximum scale 5.f. 8012 // animation with maximum scale 5.f.
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
8666 8670
8667 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 8671 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
8668 8672
8669 gfx::Rect affected_by_delta(0, 0, root_size.width(), 8673 gfx::Rect affected_by_delta(0, 0, root_size.width(),
8670 root_size.height() + 50); 8674 root_size.height() + 50);
8671 EXPECT_EQ(affected_by_delta, sublayer->visible_content_rect()); 8675 EXPECT_EQ(affected_by_delta, sublayer->visible_content_rect());
8672 } 8676 }
8673 8677
8674 } // namespace 8678 } // namespace
8675 } // namespace cc 8679 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698