Index: cc/tile_manager.cc |
diff --git a/cc/tile_manager.cc b/cc/tile_manager.cc |
index 2a426d35608af31d4ae3e9fcd7ff1bd4c3740e20..fa54ebdfcd963de1d8bc3cc96e92fa4119a92acf 100644 |
--- a/cc/tile_manager.cc |
+++ b/cc/tile_manager.cc |
@@ -657,6 +657,7 @@ void TileManager::DispatchOneRasterTask(scoped_refptr<Tile> tile) { |
resource_id), |
tile->content_rect_, |
tile->contents_scale(), |
+ use_cheapness_estimator_, |
tile->picture_pile(), |
&rendering_stats_); |
TileManager::OnRasterTaskCompleted(tile, resource.Pass(), |
@@ -670,7 +671,8 @@ void TileManager::DispatchOneRasterTask(scoped_refptr<Tile> tile) { |
resource_pool_->resource_provider()->mapPixelBuffer( |
resource_id), |
tile->content_rect_, |
- tile->contents_scale()), |
+ tile->contents_scale(), |
+ use_cheapness_estimator_), |
base::Bind(&TileManager::OnRasterTaskCompletedByWorker, |
base::Unretained(this), |
tile, |
@@ -776,6 +778,7 @@ void TileManager::DidTileBinChange(Tile* tile, |
void TileManager::RunRasterTask(uint8* buffer, |
const gfx::Rect& rect, |
float contents_scale, |
+ bool use_cheapness_estimator, |
PicturePileImpl* picture_pile, |
RenderingStats* stats) { |
TRACE_EVENT0("cc", "TileManager::RunRasterTask"); |
@@ -802,6 +805,21 @@ void TileManager::RunRasterTask(uint8* buffer, |
duration.InMilliseconds(), |
0, 10, 10 |
); |
+ |
+ if (use_cheapness_estimator) { |
+ bool is_cheap = picture_pile->IsCheapInRect (rect, contents_scale); |
+ bool is_correct_estimate = false; |
+ |
+ // Cheap means less than 1ms |
+ if ((is_cheap && duration.InMillisecondsF() <= 1.0f) || |
+ (!is_cheap && duration.InMillisecondsF() > 1.0f)) |
+ is_correct_estimate = true; |
+ |
+ UMA_HISTOGRAM_BOOLEAN( |
+ "Renderer4.CheapnessPredictorAccuracy", |
+ is_correct_estimate |
+ ); |
+ } |
} |
} |