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

Unified Diff: cc/layers/layer_impl_unittest.cc

Issue 2690753002: cc: Move render surface ownership from layers to the effect tree (Closed)
Patch Set: Only update surfaces when can_render_to_separate_surface changes Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/layer_iterator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl_unittest.cc
diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc
index a353a2032dadc1dd951aa423838e8e463596d051..b51fae0069a063ef3f43ab304907bc76f0ce59d9 100644
--- a/cc/layers/layer_impl_unittest.cc
+++ b/cc/layers/layer_impl_unittest.cc
@@ -249,7 +249,6 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
host_impl.active_tree()->SetRootLayerForTesting(
LayerImpl::Create(host_impl.active_tree(), 1));
LayerImpl* root = host_impl.active_tree()->root_layer_for_testing();
- root->SetHasRenderSurface(true);
std::unique_ptr<LayerImpl> layer_ptr =
LayerImpl::Create(host_impl.active_tree(), 2);
LayerImpl* layer = layer_ptr.get();
@@ -277,13 +276,11 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
// verified.
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetDrawsContent(true));
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer2->SetDrawsContent(true));
- // Render surface functions should not trigger update draw properties, because
- // creating render surface is part of update draw properties.
- VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true));
- VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(false));
+
// Create a render surface, because we must have a render surface if we have
// filters.
- VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true));
+ layer->test_properties()->force_render_surface = true;
+ host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting();
// Related filter functions.
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
@@ -307,6 +304,8 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(large_size));
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(large_size));
host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting();
+ host_impl.active_tree()->set_needs_update_draw_properties();
+ host_impl.active_tree()->UpdateDrawProperties(false /* update_lcd_text */);
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->ScrollBy(arbitrary_vector2d));
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->ScrollBy(gfx::Vector2d()));
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
@@ -322,6 +321,8 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
// Unrelated functions, always set to new values, always set needs update.
host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting();
+ host_impl.active_tree()->set_needs_update_draw_properties();
+ host_impl.active_tree()->UpdateDrawProperties(false /* update_lcd_text */);
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetMasksToBounds(true);
layer->NoteLayerPropertyChanged());
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetContentsOpaque(true);
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/layer_iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698