Commit 3e9481d0 authored by vmpstr's avatar vmpstr Committed by Commit bot

cc: Mark tiles as processed for solid color analysis.

This patch ensures we don't process tiles for solid color analysis
many times. This wasn't as much of an issue before we separated raster
and decode images, since we'd only process a tile once. Now, we can
visit tiles more than once.

This shows pretty significant gains on perftests.
Before:
*RESULT prepare_tiles: 2_100= 2236.82763671875 runs/s
*RESULT prepare_tiles: 2_500= 8168.21533203125 runs/s
*RESULT prepare_tiles: 2_1000= 10103.5654296875 runs/s
*RESULT prepare_tiles: 10_100= 8856.08984375 runs/s
*RESULT prepare_tiles: 10_500= 8581.669921875 runs/s
*RESULT prepare_tiles: 10_1000= 8932.677734375 runs/s
*RESULT prepare_tiles: 50_100= 3708.318359375 runs/s
*RESULT prepare_tiles: 50_500= 3758.5810546875 runs/s
*RESULT prepare_tiles: 50_1000= 3686.30078125 runs/s

After:
*RESULT prepare_tiles: 2_100= 9835.1611328125 runs/s
*RESULT prepare_tiles: 2_500= 20325.25390625 runs/s
*RESULT prepare_tiles: 2_1000= 21301.900390625 runs/s
*RESULT prepare_tiles: 10_100= 16529.826171875 runs/s
*RESULT prepare_tiles: 10_500= 16585.15625 runs/s
*RESULT prepare_tiles: 10_1000= 16813.125 runs/s
*RESULT prepare_tiles: 50_100= 4764.2998046875 runs/s
*RESULT prepare_tiles: 50_500= 4804.51220703125 runs/s
*RESULT prepare_tiles: 50_1000= 4789.98486328125 runs/s

However, I'll also be changing the tests to actually reset this state
when I change the perftests to test specific scenarios.

R=enne
BUG=645569
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2334003007
Cr-Commit-Position: refs/heads/master@{#418662}
parent efd2bb86
...@@ -32,6 +32,7 @@ Tile::Tile(TileManager* tile_manager, ...@@ -32,6 +32,7 @@ Tile::Tile(TileManager* tile_manager,
tiling_j_index_(info.tiling_j_index), tiling_j_index_(info.tiling_j_index),
required_for_activation_(false), required_for_activation_(false),
required_for_draw_(false), required_for_draw_(false),
is_solid_color_analysis_performed_(false),
id_(tile_manager->GetUniqueTileId()), id_(tile_manager->GetUniqueTileId()),
invalidated_id_(0), invalidated_id_(0),
scheduled_priority_(0) {} scheduled_priority_(0) {}
......
...@@ -107,6 +107,13 @@ class CC_EXPORT Tile { ...@@ -107,6 +107,13 @@ class CC_EXPORT Tile {
bool HasRasterTask() const { return !!raster_task_.get(); } bool HasRasterTask() const { return !!raster_task_.get(); }
void set_solid_color_analysis_performed(bool performed) {
is_solid_color_analysis_performed_ = performed;
}
bool is_solid_color_analysis_performed() const {
return is_solid_color_analysis_performed_;
}
private: private:
friend class TileManager; friend class TileManager;
friend class FakeTileManager; friend class FakeTileManager;
...@@ -134,6 +141,7 @@ class CC_EXPORT Tile { ...@@ -134,6 +141,7 @@ class CC_EXPORT Tile {
const int tiling_j_index_; const int tiling_j_index_;
bool required_for_activation_ : 1; bool required_for_activation_ : 1;
bool required_for_draw_ : 1; bool required_for_draw_ : 1;
bool is_solid_color_analysis_performed_ : 1;
Id id_; Id id_;
...@@ -144,7 +152,6 @@ class CC_EXPORT Tile { ...@@ -144,7 +152,6 @@ class CC_EXPORT Tile {
Id invalidated_id_; Id invalidated_id_;
unsigned scheduled_priority_; unsigned scheduled_priority_;
scoped_refptr<TileTask> raster_task_; scoped_refptr<TileTask> raster_task_;
DISALLOW_COPY_AND_ASSIGN(Tile); DISALLOW_COPY_AND_ASSIGN(Tile);
......
...@@ -632,11 +632,13 @@ TileManager::PrioritizedWorkToSchedule TileManager::AssignGpuMemoryToTiles() { ...@@ -632,11 +632,13 @@ TileManager::PrioritizedWorkToSchedule TileManager::AssignGpuMemoryToTiles() {
} }
bool tile_is_needed_now = priority.priority_bin == TilePriority::NOW; bool tile_is_needed_now = priority.priority_bin == TilePriority::NOW;
if (tile->use_picture_analysis() && kUseColorEstimator) { if (!tile->is_solid_color_analysis_performed() &&
tile->use_picture_analysis() && kUseColorEstimator) {
// We analyze for solid color here, to decide to continue // We analyze for solid color here, to decide to continue
// or drop the tile for scheduling and raster. // or drop the tile for scheduling and raster.
// TODO(sohanjg): Check if we could use a shared analysis // TODO(sohanjg): Check if we could use a shared analysis
// canvas which is reset between tiles. // canvas which is reset between tiles.
tile->set_solid_color_analysis_performed(true);
SkColor color = SK_ColorTRANSPARENT; SkColor color = SK_ColorTRANSPARENT;
bool is_solid_color = bool is_solid_color =
prioritized_tile.raster_source()->PerformSolidColorAnalysis( prioritized_tile.raster_source()->PerformSolidColorAnalysis(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment