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

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

Issue 1599673002: compositor-worker: Remove code from cc_blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix blink_platform_unittests 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
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/layer_unittest.cc » ('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/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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // changed. 200 // changed.
201 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetBounds(arbitrary_size)); 201 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetBounds(arbitrary_size));
202 202
203 // Changing these properties does not cause the layer to be marked as changed 203 // Changing these properties does not cause the layer to be marked as changed
204 // but does cause the layer to need to push properties. 204 // but does cause the layer to need to push properties.
205 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( 205 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE(
206 root->SetIsRootForIsolatedGroup(true)); 206 root->SetIsRootForIsolatedGroup(true));
207 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( 207 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE(
208 root->SetElementId(2)); 208 root->SetElementId(2));
209 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( 209 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE(
210 root->SetMutableProperties(kMutablePropertyOpacity)); 210 root->SetMutableProperties(MutableProperty::kOpacity));
211 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( 211 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE(
212 root->SetScrollParent(scroll_parent.get())); 212 root->SetScrollParent(scroll_parent.get()));
213 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( 213 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE(
214 root->SetScrollChildren(scroll_children)); 214 root->SetScrollChildren(scroll_children));
215 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( 215 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE(
216 root->SetClipParent(clip_parent.get())); 216 root->SetClipParent(clip_parent.get()));
217 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( 217 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE(
218 root->SetClipChildren(clip_children)); 218 root->SetClipChildren(clip_children));
219 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( 219 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE(
220 root->SetNumDescendantsThatDrawContent(10)); 220 root->SetNumDescendantsThatDrawContent(10));
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetOpacity(arbitrary_number)); 378 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetOpacity(arbitrary_number));
379 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( 379 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(
380 layer->SetBlendMode(arbitrary_blend_mode)); 380 layer->SetBlendMode(arbitrary_blend_mode));
381 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( 381 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(
382 layer->SetIsRootForIsolatedGroup(true)); 382 layer->SetIsRootForIsolatedGroup(true));
383 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( 383 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(
384 layer->SetTransform(arbitrary_transform)); 384 layer->SetTransform(arbitrary_transform));
385 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(arbitrary_size)); 385 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(arbitrary_size));
386 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetElementId(2)); 386 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetElementId(2));
387 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( 387 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(
388 layer->SetMutableProperties(kMutablePropertyTransform)); 388 layer->SetMutableProperties(MutableProperty::kTransform));
389 } 389 }
390 390
391 TEST(LayerImplTest, SafeOpaqueBackgroundColor) { 391 TEST(LayerImplTest, SafeOpaqueBackgroundColor) {
392 FakeImplTaskRunnerProvider task_runner_provider; 392 FakeImplTaskRunnerProvider task_runner_provider;
393 TestSharedBitmapManager shared_bitmap_manager; 393 TestSharedBitmapManager shared_bitmap_manager;
394 TestTaskGraphRunner task_graph_runner; 394 TestTaskGraphRunner task_graph_runner;
395 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); 395 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d();
396 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, 396 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager,
397 &task_graph_runner); 397 &task_graph_runner);
398 host_impl.SetVisible(true); 398 host_impl.SetVisible(true);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 601
602 pending_layer->PushPropertiesTo(layer()); 602 pending_layer->PushPropertiesTo(layer());
603 603
604 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); 604 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset());
605 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), 605 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(),
606 pending_layer->CurrentScrollOffset()); 606 pending_layer->CurrentScrollOffset());
607 } 607 }
608 608
609 } // namespace 609 } // namespace
610 } // namespace cc 610 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698