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

Side by Side Diff: cc/layers/layer_unittest.cc

Issue 465853004: Moving RenderSurface creation outside of CalcDrawProps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
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/layers/layer.h" 5 #include "cc/layers/layer.h"
6 6
7 #include "cc/animation/keyframed_animation_curve.h" 7 #include "cc/animation/keyframed_animation_curve.h"
8 #include "cc/base/math_util.h" 8 #include "cc/base/math_util.h"
9 #include "cc/layers/layer_impl.h" 9 #include "cc/layers/layer_impl.h"
10 #include "cc/resources/layer_painter.h" 10 #include "cc/resources/layer_painter.h"
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetOpacity(0.75f)); 784 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetOpacity(0.75f));
785 785
786 EXPECT_FALSE(impl_layer->LayerPropertyChanged()); 786 EXPECT_FALSE(impl_layer->LayerPropertyChanged());
787 test_layer->PushPropertiesTo(impl_layer.get()); 787 test_layer->PushPropertiesTo(impl_layer.get());
788 EXPECT_FALSE(impl_layer->LayerPropertyChanged()); 788 EXPECT_FALSE(impl_layer->LayerPropertyChanged());
789 } 789 }
790 790
791 TEST_F(LayerTest, 791 TEST_F(LayerTest,
792 PushPropsDoesntCauseLayerPropertyChangedDuringImplOnlyFilterAnim) { 792 PushPropsDoesntCauseLayerPropertyChangedDuringImplOnlyFilterAnim) {
793 scoped_refptr<Layer> test_layer = Layer::Create(); 793 scoped_refptr<Layer> test_layer = Layer::Create();
794 test_layer->SetHasRenderSurface(true);
794 scoped_ptr<LayerImpl> impl_layer = 795 scoped_ptr<LayerImpl> impl_layer =
795 LayerImpl::Create(host_impl_.active_tree(), 1); 796 LayerImpl::Create(host_impl_.active_tree(), 1);
796 797
797 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, 798 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1,
798 layer_tree_host_->SetRootLayer(test_layer)); 799 layer_tree_host_->SetRootLayer(test_layer));
799 800
800 scoped_ptr<AnimationRegistrar> registrar = AnimationRegistrar::Create(); 801 scoped_ptr<AnimationRegistrar> registrar = AnimationRegistrar::Create();
801 impl_layer->layer_animation_controller()->SetAnimationRegistrar( 802 impl_layer->layer_animation_controller()->SetAnimationRegistrar(
802 registrar.get()); 803 registrar.get());
803 804
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 root_layer->AddChild(becomes_not_draws_content); 1249 root_layer->AddChild(becomes_not_draws_content);
1249 EXPECT_EQ(0, root_layer->NumDescendantsThatDrawContent()); 1250 EXPECT_EQ(0, root_layer->NumDescendantsThatDrawContent());
1250 1251
1251 becomes_draws_content->SetIsDrawable(true); 1252 becomes_draws_content->SetIsDrawable(true);
1252 root_layer->AddChild(becomes_draws_content); 1253 root_layer->AddChild(becomes_draws_content);
1253 EXPECT_EQ(1, root_layer->NumDescendantsThatDrawContent()); 1254 EXPECT_EQ(1, root_layer->NumDescendantsThatDrawContent());
1254 } 1255 }
1255 1256
1256 } // namespace 1257 } // namespace
1257 } // namespace cc 1258 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698