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

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

Issue 2035863003: cc: Add mask and replica layer ids to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ' Created 4 years, 6 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 layer->layer_tree_impl() 300 layer->layer_tree_impl()
301 ->property_trees() 301 ->property_trees()
302 ->scroll_tree.SetScrollOffsetDeltaForTesting(layer->id(), 302 ->scroll_tree.SetScrollOffsetDeltaForTesting(layer->id(),
303 gfx::Vector2dF()); 303 gfx::Vector2dF());
304 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetCurrentScrollOffset( 304 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetCurrentScrollOffset(
305 gfx::ScrollOffset(arbitrary_vector2d.x(), arbitrary_vector2d.y()))); 305 gfx::ScrollOffset(arbitrary_vector2d.x(), arbitrary_vector2d.y())));
306 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetCurrentScrollOffset( 306 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetCurrentScrollOffset(
307 gfx::ScrollOffset(arbitrary_vector2d.x(), arbitrary_vector2d.y()))); 307 gfx::ScrollOffset(arbitrary_vector2d.x(), arbitrary_vector2d.y())));
308 308
309 // Unrelated functions, always set to new values, always set needs update. 309 // Unrelated functions, always set to new values, always set needs update.
310 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
311 layer->SetMaskLayer(LayerImpl::Create(host_impl.active_tree(), 4));
312 layer->NoteLayerPropertyChanged());
313 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); 310 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting();
314 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetMasksToBounds(true); 311 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetMasksToBounds(true);
315 layer->NoteLayerPropertyChanged()); 312 layer->NoteLayerPropertyChanged());
316 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetContentsOpaque(true); 313 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetContentsOpaque(true);
317 layer->NoteLayerPropertyChanged()); 314 layer->NoteLayerPropertyChanged());
318 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
319 layer->SetReplicaLayer(LayerImpl::Create(host_impl.active_tree(), 5));
320 layer->NoteLayerPropertyChanged());
321 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer2->SetPosition(arbitrary_point_f); 315 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer2->SetPosition(arbitrary_point_f);
322 layer->NoteLayerPropertyChanged()); 316 layer->NoteLayerPropertyChanged());
323 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->Set3dSortingContextId(1); 317 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->Set3dSortingContextId(1);
324 layer->NoteLayerPropertyChanged()); 318 layer->NoteLayerPropertyChanged());
325 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( 319 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
326 layer->SetBackgroundColor(arbitrary_color)); 320 layer->SetBackgroundColor(arbitrary_color));
327 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( 321 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
328 layer->SetBackgroundFilters(arbitrary_filters)); 322 layer->SetBackgroundFilters(arbitrary_filters));
329 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( 323 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
330 layer->OnOpacityAnimated(arbitrary_number)); 324 layer->OnOpacityAnimated(arbitrary_number));
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 567
574 pending_layer->PushPropertiesTo(layer()); 568 pending_layer->PushPropertiesTo(layer());
575 569
576 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); 570 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset());
577 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), 571 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(),
578 pending_layer->CurrentScrollOffset()); 572 pending_layer->CurrentScrollOffset());
579 } 573 }
580 574
581 } // namespace 575 } // namespace
582 } // namespace cc 576 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698