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

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

Issue 1921503005: cc: Move main thread hierarchy dependencies into PropertyTreeBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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/test/layer_tree_host_common_test.cc ('k') | cc/trees/draw_property_utils.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 18 matching lines...) Expand all
29 void ExecuteCalculateDrawProperties(LayerImpl* root, 29 void ExecuteCalculateDrawProperties(LayerImpl* root,
30 LayerImplList* render_surface_layer_list) { 30 LayerImplList* render_surface_layer_list) {
31 // Sanity check: The test itself should create the root layer's render 31 // Sanity check: The test itself should create the root layer's render
32 // surface, so that the surface (and its damage tracker) can 32 // surface, so that the surface (and its damage tracker) can
33 // persist across multiple calls to this function. 33 // persist across multiple calls to this function.
34 ASSERT_FALSE(render_surface_layer_list->size()); 34 ASSERT_FALSE(render_surface_layer_list->size());
35 35
36 FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(root); 36 FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(root);
37 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( 37 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
38 root, root->bounds(), render_surface_layer_list); 38 root, root->bounds(), render_surface_layer_list);
39 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 39 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs);
40 ASSERT_TRUE(root->render_surface()); 40 ASSERT_TRUE(root->render_surface());
41 } 41 }
42 42
43 void ClearDamageForAllSurfaces(LayerImpl* root) { 43 void ClearDamageForAllSurfaces(LayerImpl* root) {
44 for (auto* layer : *root->layer_tree_impl()) { 44 for (auto* layer : *root->layer_tree_impl()) {
45 if (layer->render_surface()) 45 if (layer->render_surface())
46 layer->render_surface()->damage_tracker()->DidDrawDamagedArea(); 46 layer->render_surface()->damage_tracker()->DidDrawDamagedArea();
47 } 47 }
48 } 48 }
49 49
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 gfx::Rect root_damage_rect = 1552 gfx::Rect root_damage_rect =
1553 root->render_surface()->damage_tracker()->current_damage_rect(); 1553 root->render_surface()->damage_tracker()->current_damage_rect();
1554 gfx::Rect damage_we_care_about = gfx::Rect(i, i); 1554 gfx::Rect damage_we_care_about = gfx::Rect(i, i);
1555 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); 1555 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right());
1556 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); 1556 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom());
1557 } 1557 }
1558 } 1558 }
1559 1559
1560 } // namespace 1560 } // namespace
1561 } // namespace cc 1561 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_host_common_test.cc ('k') | cc/trees/draw_property_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698