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/trees/damage_tracker_unittest.cc

Issue 373113003: Keeping track of descendants that draw content instead of recalcualting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/fake_layer_tree_host_impl.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 "cc/base/math_util.h" 7 #include "cc/base/math_util.h"
8 #include "cc/layers/layer_impl.h" 8 #include "cc/layers/layer_impl.h"
9 #include "cc/output/filter_operation.h" 9 #include "cc/output/filter_operation.h"
10 #include "cc/output/filter_operations.h" 10 #include "cc/output/filter_operations.h"
(...skipping 12 matching lines...) Expand all
23 namespace { 23 namespace {
24 24
25 void ExecuteCalculateDrawProperties(LayerImpl* root, 25 void ExecuteCalculateDrawProperties(LayerImpl* root,
26 LayerImplList* render_surface_layer_list) { 26 LayerImplList* render_surface_layer_list) {
27 // Sanity check: The test itself should create the root layer's render 27 // Sanity check: The test itself should create the root layer's render
28 // surface, so that the surface (and its damage tracker) can 28 // surface, so that the surface (and its damage tracker) can
29 // persist across multiple calls to this function. 29 // persist across multiple calls to this function.
30 ASSERT_TRUE(root->render_surface()); 30 ASSERT_TRUE(root->render_surface());
31 ASSERT_FALSE(render_surface_layer_list->size()); 31 ASSERT_FALSE(render_surface_layer_list->size());
32 32
33 FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(root);
33 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( 34 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
34 root, root->bounds(), render_surface_layer_list); 35 root, root->bounds(), render_surface_layer_list);
35 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 36 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
36 } 37 }
37 38
38 void ClearDamageForAllSurfaces(LayerImpl* layer) { 39 void ClearDamageForAllSurfaces(LayerImpl* layer) {
39 if (layer->render_surface()) 40 if (layer->render_surface())
40 layer->render_surface()->damage_tracker()->DidDrawDamagedArea(); 41 layer->render_surface()->damage_tracker()->DidDrawDamagedArea();
41 42
42 // Recursively clear damage for any existing surface. 43 // Recursively clear damage for any existing surface.
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 gfx::Rect root_damage_rect = 1462 gfx::Rect root_damage_rect =
1462 root->render_surface()->damage_tracker()->current_damage_rect(); 1463 root->render_surface()->damage_tracker()->current_damage_rect();
1463 gfx::Rect damage_we_care_about = gfx::Rect(i, i); 1464 gfx::Rect damage_we_care_about = gfx::Rect(i, i);
1464 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); 1465 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right());
1465 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); 1466 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom());
1466 } 1467 }
1467 } 1468 }
1468 1469
1469 } // namespace 1470 } // namespace
1470 } // namespace cc 1471 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698