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

Side by Side Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 1801853002: Transfer LayerImpl ownership to LayerTreeImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more asan. Created 4 years, 9 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/trees/layer_tree_host_common_perftest.cc ('k') | cc/trees/layer_tree_host_impl.h » ('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/trees/layer_tree_host_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 3559 matching lines...) Expand 10 before | Expand all | Expand 10 after
3570 root->AddChild(std::move(child)); 3570 root->AddChild(std::move(child));
3571 root->AddChild(std::move(occluding_child)); 3571 root->AddChild(std::move(occluding_child));
3572 host_impl.active_tree()->SetRootLayer(std::move(root)); 3572 host_impl.active_tree()->SetRootLayer(std::move(root));
3573 host_impl.SetVisible(true); 3573 host_impl.SetVisible(true);
3574 host_impl.InitializeRenderer(output_surface.get()); 3574 host_impl.InitializeRenderer(output_surface.get());
3575 host_impl.active_tree()->BuildPropertyTreesForTesting(); 3575 host_impl.active_tree()->BuildPropertyTreesForTesting();
3576 bool update_lcd_text = false; 3576 bool update_lcd_text = false;
3577 host_impl.active_tree()->UpdateDrawProperties(update_lcd_text); 3577 host_impl.active_tree()->UpdateDrawProperties(update_lcd_text);
3578 3578
3579 LayerImpl* grand_child_ptr = 3579 LayerImpl* grand_child_ptr =
3580 host_impl.active_tree()->root_layer()->children()[0]->children()[0].get(); 3580 host_impl.active_tree()->root_layer()->children()[0]->children()[0];
3581 3581
3582 // Though all layers have invertible transforms, matrix multiplication using 3582 // Though all layers have invertible transforms, matrix multiplication using
3583 // floating-point math makes the draw transform uninvertible. 3583 // floating-point math makes the draw transform uninvertible.
3584 EXPECT_FALSE(grand_child_ptr->DrawTransform().IsInvertible()); 3584 EXPECT_FALSE(grand_child_ptr->DrawTransform().IsInvertible());
3585 3585
3586 // Since |grand_child| has an uninvertible draw transform, it is treated as 3586 // Since |grand_child| has an uninvertible draw transform, it is treated as
3587 // unoccluded (even though |occluding_child| comes later in draw order, and 3587 // unoccluded (even though |occluding_child| comes later in draw order, and
3588 // hence potentially occludes it). 3588 // hence potentially occludes it).
3589 gfx::Rect layer_bounds = gfx::Rect(grand_child_ptr->bounds()); 3589 gfx::Rect layer_bounds = gfx::Rect(grand_child_ptr->bounds());
3590 EXPECT_EQ( 3590 EXPECT_EQ(
(...skipping 6351 matching lines...) Expand 10 before | Expand all | Expand 10 after
9942 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); 9942 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index());
9943 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); 9943 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index());
9944 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); 9944 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index());
9945 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); 9945 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index());
9946 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); 9946 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index());
9947 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); 9947 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index());
9948 } 9948 }
9949 9949
9950 } // namespace 9950 } // namespace
9951 } // namespace cc 9951 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_perftest.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698