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

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

Issue 2051013002: cc : Push layer lists instead of layer tree at commit and activation (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
« no previous file with comments | « cc/tiles/tile_manager_unittest.cc ('k') | cc/trees/layer_tree_host_common.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/trees/damage_tracker.h" 5 #include "cc/trees/damage_tracker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/layers/layer_impl.h" 10 #include "cc/layers/layer_impl.h"
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface(); 872 LayerImpl* root = CreateAndSetUpTestTreeWithOneSurface();
873 873
874 ClearDamageForAllSurfaces(root); 874 ClearDamageForAllSurfaces(root);
875 { 875 {
876 std::unique_ptr<LayerImpl> child2 = 876 std::unique_ptr<LayerImpl> child2 =
877 LayerImpl::Create(host_impl_.active_tree(), 3); 877 LayerImpl::Create(host_impl_.active_tree(), 3);
878 child2->SetPosition(gfx::PointF(400.f, 380.f)); 878 child2->SetPosition(gfx::PointF(400.f, 380.f));
879 child2->SetBounds(gfx::Size(6, 8)); 879 child2->SetBounds(gfx::Size(6, 8));
880 child2->SetDrawsContent(true); 880 child2->SetDrawsContent(true);
881 root->AddChild(std::move(child2)); 881 root->AddChild(std::move(child2));
882 root->layer_tree_impl()->BuildLayerListForTesting();
882 host_impl_.active_tree()->ResetAllChangeTracking(); 883 host_impl_.active_tree()->ResetAllChangeTracking();
883 LayerImpl* child2_ptr = host_impl_.active_tree()->LayerById(3); 884 LayerImpl* child2_ptr = host_impl_.active_tree()->LayerById(3);
884 // Sanity check the initial conditions of the test, if these asserts 885 // Sanity check the initial conditions of the test, if these asserts
885 // trigger, it means the test no longer actually covers the intended 886 // trigger, it means the test no longer actually covers the intended
886 // scenario. 887 // scenario.
887 ASSERT_FALSE(child2_ptr->LayerPropertyChanged()); 888 ASSERT_FALSE(child2_ptr->LayerPropertyChanged());
888 ASSERT_TRUE(child2_ptr->update_rect().IsEmpty()); 889 ASSERT_TRUE(child2_ptr->update_rect().IsEmpty());
889 } 890 }
890 root->layer_tree_impl()->property_trees()->needs_rebuild = true; 891 root->layer_tree_impl()->property_trees()->needs_rebuild = true;
891 EmulateDrawingOneFrame(root); 892 EmulateDrawingOneFrame(root);
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 gfx::Rect root_damage_rect = 1626 gfx::Rect root_damage_rect =
1626 root->render_surface()->damage_tracker()->current_damage_rect(); 1627 root->render_surface()->damage_tracker()->current_damage_rect();
1627 gfx::Rect damage_we_care_about = gfx::Rect(i, i); 1628 gfx::Rect damage_we_care_about = gfx::Rect(i, i);
1628 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); 1629 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right());
1629 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); 1630 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom());
1630 } 1631 }
1631 } 1632 }
1632 1633
1633 } // namespace 1634 } // namespace
1634 } // namespace cc 1635 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/tile_manager_unittest.cc ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698