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

Side by Side Diff: cc/damage_tracker_unittest.cc

Issue 11360093: Mark layers that can use LCD text based on layer transform and opacity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase with TOT, addressed comments Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/layer.h » ('j') | cc/layer_tree_host_common.cc » ('J')
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/damage_tracker.h" 5 #include "cc/damage_tracker.h"
6 6
7 #include "cc/layer_impl.h" 7 #include "cc/layer_impl.h"
8 #include "cc/layer_sorter.h" 8 #include "cc/layer_sorter.h"
9 #include "cc/layer_tree_host_common.h" 9 #include "cc/layer_tree_host_common.h"
10 #include "cc/math_util.h" 10 #include "cc/math_util.h"
(...skipping 14 matching lines...) Expand all
25 { 25 {
26 LayerSorter layerSorter; 26 LayerSorter layerSorter;
27 int dummyMaxTextureSize = 512; 27 int dummyMaxTextureSize = 512;
28 28
29 // Sanity check: The test itself should create the root layer's render surfa ce, so 29 // Sanity check: The test itself should create the root layer's render surfa ce, so
30 // that the surface (and its damage tracker) can persist acros s multiple 30 // that the surface (and its damage tracker) can persist acros s multiple
31 // calls to this function. 31 // calls to this function.
32 ASSERT_TRUE(root->renderSurface()); 32 ASSERT_TRUE(root->renderSurface());
33 ASSERT_FALSE(renderSurfaceLayerList.size()); 33 ASSERT_FALSE(renderSurfaceLayerList.size());
34 34
35 LayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, 1, &la yerSorter, dummyMaxTextureSize, renderSurfaceLayerList); 35 LayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, 1, &la yerSorter, dummyMaxTextureSize, false, renderSurfaceLayerList);
36 } 36 }
37 37
38 void clearDamageForAllSurfaces(LayerImpl* layer) 38 void clearDamageForAllSurfaces(LayerImpl* layer)
39 { 39 {
40 if (layer->renderSurface()) 40 if (layer->renderSurface())
41 layer->renderSurface()->damageTracker()->didDrawDamagedArea(); 41 layer->renderSurface()->damageTracker()->didDrawDamagedArea();
42 42
43 // Recursively clear damage for any existing surface. 43 // Recursively clear damage for any existing surface.
44 for (size_t i = 0; i < layer->children().size(); ++i) 44 for (size_t i = 0; i < layer->children().size(); ++i)
45 clearDamageForAllSurfaces(layer->children()[i]); 45 clearDamageForAllSurfaces(layer->children()[i]);
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 EXPECT_TRUE(rootDamageRect.IsEmpty()); 1150 EXPECT_TRUE(rootDamageRect.IsEmpty());
1151 1151
1152 // Damage should remain empty even after one frame, since there's yet no new damage 1152 // Damage should remain empty even after one frame, since there's yet no new damage
1153 emulateDrawingOneFrame(root.get()); 1153 emulateDrawingOneFrame(root.get());
1154 rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect() ; 1154 rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect() ;
1155 EXPECT_TRUE(rootDamageRect.IsEmpty()); 1155 EXPECT_TRUE(rootDamageRect.IsEmpty());
1156 } 1156 }
1157 1157
1158 } // namespace 1158 } // namespace
1159 } // namespace cc 1159 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layer.h » ('j') | cc/layer_tree_host_common.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698