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

Side by Side Diff: cc/resources/picture_pile.cc

Issue 379823002: cc: skipping a horizontal sort by checking the value of vertical_density (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove TODO comment line Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/resources/picture_pile.h" 5 #include "cc/resources/picture_pile.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 std::vector<gfx::Rect> invalid_tiles_vertical = invalid_tiles; 109 std::vector<gfx::Rect> invalid_tiles_vertical = invalid_tiles;
110 std::sort(invalid_tiles_vertical.begin(), 110 std::sort(invalid_tiles_vertical.begin(),
111 invalid_tiles_vertical.end(), 111 invalid_tiles_vertical.end(),
112 rect_sort_y); 112 rect_sort_y);
113 113
114 float vertical_density; 114 float vertical_density;
115 std::vector<gfx::Rect> vertical_clustering; 115 std::vector<gfx::Rect> vertical_clustering;
116 vertical_density = do_clustering(invalid_tiles_vertical, 116 vertical_density = do_clustering(invalid_tiles_vertical,
117 &vertical_clustering); 117 &vertical_clustering);
118 118
119 if (vertical_density == 1) {
vmpstr 2014/07/09 23:29:11 nit: 1.f
hyunki 2014/07/09 23:43:44 Done.
120 *record_rects = vertical_clustering;
121 return vertical_density;
122 }
123
119 // Now try again with a horizontal sort, see which one is best 124 // Now try again with a horizontal sort, see which one is best
120 // TODO(humper): Heuristics for skipping this step?
121 std::vector<gfx::Rect> invalid_tiles_horizontal = invalid_tiles; 125 std::vector<gfx::Rect> invalid_tiles_horizontal = invalid_tiles;
vmpstr 2014/07/09 23:29:11 Is this used? I think this might have been a typo,
hyunki 2014/07/09 23:43:44 Sure. I think it is used. And possibly rename inva
122 std::sort(invalid_tiles_vertical.begin(), 126 std::sort(invalid_tiles_vertical.begin(),
123 invalid_tiles_vertical.end(), 127 invalid_tiles_vertical.end(),
124 rect_sort_x); 128 rect_sort_x);
125 129
126 float horizontal_density; 130 float horizontal_density;
127 std::vector<gfx::Rect> horizontal_clustering; 131 std::vector<gfx::Rect> horizontal_clustering;
128 horizontal_density = do_clustering(invalid_tiles_vertical, 132 horizontal_density = do_clustering(invalid_tiles_vertical,
129 &horizontal_clustering); 133 &horizontal_clustering);
130 134
131 if (vertical_density < horizontal_density) { 135 if (vertical_density < horizontal_density) {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 } 308 }
305 DCHECK(found_tile_for_recorded_picture); 309 DCHECK(found_tile_for_recorded_picture);
306 } 310 }
307 311
308 has_any_recordings_ = true; 312 has_any_recordings_ = true;
309 DCHECK(CanRasterSlowTileCheck(recorded_viewport_)); 313 DCHECK(CanRasterSlowTileCheck(recorded_viewport_));
310 return true; 314 return true;
311 } 315 }
312 316
313 } // namespace cc 317 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698