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

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

Issue 1588093004: Compute if a layer is drawn without LayerTree hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
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_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "cc/animation/mutable_properties.h" 7 #include "cc/animation/mutable_properties.h"
8 #include "cc/layers/painted_scrollbar_layer_impl.h" 8 #include "cc/layers/painted_scrollbar_layer_impl.h"
9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" 9 #include "cc/layers/solid_color_scrollbar_layer_impl.h"
10 #include "cc/output/filter_operation.h" 10 #include "cc/output/filter_operation.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 root->SetReplicaLayer(LayerImpl::Create(host_impl.active_tree(), 10))); 172 root->SetReplicaLayer(LayerImpl::Create(host_impl.active_tree(), 10)));
173 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetPosition(arbitrary_point_f)); 173 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetPosition(arbitrary_point_f));
174 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetShouldFlattenTransform(false)); 174 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetShouldFlattenTransform(false));
175 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->Set3dSortingContextId(1)); 175 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->Set3dSortingContextId(1));
176 EXECUTE_AND_VERIFY_SUBTREE_CHANGED( 176 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(
177 root->SetDoubleSided(false)); // constructor initializes it to "true". 177 root->SetDoubleSided(false)); // constructor initializes it to "true".
178 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->ScrollBy(arbitrary_vector2d)); 178 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->ScrollBy(arbitrary_vector2d));
179 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetScrollDelta(gfx::Vector2d())); 179 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetScrollDelta(gfx::Vector2d()));
180 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->PushScrollOffsetFromMainThread( 180 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->PushScrollOffsetFromMainThread(
181 gfx::ScrollOffset(arbitrary_vector2d))); 181 gfx::ScrollOffset(arbitrary_vector2d)));
182 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetHideLayerAndSubtree(true));
183 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetOpacity(arbitrary_number)); 182 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetOpacity(arbitrary_number));
184 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetBlendMode(arbitrary_blend_mode)); 183 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetBlendMode(arbitrary_blend_mode));
185 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetTransform(arbitrary_transform)); 184 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetTransform(arbitrary_transform));
186 185
187 // Changing these properties only affects the layer itself. 186 // Changing these properties only affects the layer itself.
188 EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetDrawsContent(true)); 187 EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetDrawsContent(true));
189 EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED( 188 EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(
190 root->SetBackgroundColor(arbitrary_color)); 189 root->SetBackgroundColor(arbitrary_color));
191 EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED( 190 EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(
192 root->SetBackgroundFilters(arbitrary_filters)); 191 root->SetBackgroundFilters(arbitrary_filters));
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 600
602 pending_layer->PushPropertiesTo(layer()); 601 pending_layer->PushPropertiesTo(layer());
603 602
604 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); 603 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset());
605 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), 604 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(),
606 pending_layer->CurrentScrollOffset()); 605 pending_layer->CurrentScrollOffset());
607 } 606 }
608 607
609 } // namespace 608 } // namespace
610 } // namespace cc 609 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698