Chromium Code Reviews| Index: cc/resources/picture_pile.cc |
| diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc |
| index 6341e88b3688889df468543cecf2c652136f20c9..648bc51ec97e73ee52c33c51109e189b678597c8 100644 |
| --- a/cc/resources/picture_pile.cc |
| +++ b/cc/resources/picture_pile.cc |
| @@ -116,16 +116,20 @@ float ClusterTiles(const std::vector<gfx::Rect>& invalid_tiles, |
| vertical_density = do_clustering(invalid_tiles_vertical, |
| &vertical_clustering); |
| + if (vertical_density == 1.f) { |
|
vmpstr
2014/07/09 23:47:14
nit: Add a comment here please explaining that if
hyunki
2014/07/09 23:51:27
Done.
|
| + *record_rects = vertical_clustering; |
| + return vertical_density; |
| + } |
| + |
| // Now try again with a horizontal sort, see which one is best |
| - // TODO(humper): Heuristics for skipping this step? |
| std::vector<gfx::Rect> invalid_tiles_horizontal = invalid_tiles; |
| - std::sort(invalid_tiles_vertical.begin(), |
| - invalid_tiles_vertical.end(), |
| + std::sort(invalid_tiles_horizontal.begin(), |
| + invalid_tiles_horizontal.end(), |
| rect_sort_x); |
| float horizontal_density; |
| std::vector<gfx::Rect> horizontal_clustering; |
| - horizontal_density = do_clustering(invalid_tiles_vertical, |
| + horizontal_density = do_clustering(invalid_tiles_horizontal, |
| &horizontal_clustering); |
| if (vertical_density < horizontal_density) { |