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

Unified Diff: cc/resources/tile_manager.cc

Issue 213093003: cc: Skip analysis for narrow layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/picture_pile_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « cc/resources/picture_pile_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698