Index: cc/resources/tile_manager.cc |
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc |
index 8dc9c29ff0ae4527fc343c60bf58bf7b88a6092f..6ff314757b1257710ae9c624b4910335f57b8b88 100644 |
--- a/cc/resources/tile_manager.cc |
+++ b/cc/resources/tile_manager.cc |
@@ -32,6 +32,9 @@ namespace { |
// a tile is of solid color. |
const bool kUseColorEstimator = true; |
+// Minimum width/height of a pile that would require analysis for tiles. |
+const int kMinDimensionsForAnalysis = 256; |
+ |
class DisableLCDTextFilter : public SkDrawFilter { |
public: |
// SkDrawFilter interface. |
@@ -1163,7 +1166,18 @@ scoped_refptr<internal::RasterWorkerPoolTask> TileManager::CreateRasterTask( |
// It is drawn directly as a solid-color quad saving raster and upload cost. |
// The analysis step is however expensive and is not justified when doing |
// gpu rasterization where there is no upload. |
- bool analyze_picture = !tile->use_gpu_rasterization(); |
+ // |
+ // Additionally, we do not want to do the analysis if the layer that produced |
+ // this tile is narrow, since more likely than not the tile would not be |
+ // solid. We use the picture pile size as a proxy for layer size, since it |
+ // represents the recorded (and thus rasterizable) content. |
+ // Note that this last optimization is a heuristic that ensures that we don't |
+ // spend too much time analyzing tiles on a multitude of small layers, as it |
+ // is likely that these layers have some non-solid content. |
+ gfx::Size pile_size = tile->picture_pile()->size(); |
+ bool analyze_picture = !tile->use_gpu_rasterization() && |
+ std::min(pile_size.width(), pile_size.height()) >= |
+ kMinDimensionsForAnalysis; |
return make_scoped_refptr(new RasterWorkerPoolTaskImpl( |
const_resource, |