Chromium Code Reviews| Index: cc/tiles/tile_manager.cc |
| diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc |
| index 9804da00fb6b93eeb4875904a5890d7bce320bde..8a42726241d6396821dda672b13590ce8658616b 100644 |
| --- a/cc/tiles/tile_manager.cc |
| +++ b/cc/tiles/tile_manager.cc |
| @@ -51,7 +51,6 @@ class RasterTaskImpl : public RasterTask { |
| uint64_t previous_content_id, |
| uint64_t resource_content_id, |
| int source_frame_number, |
| - bool analyze_picture, |
| const base::Callback< |
| void(const DisplayListRasterSource::SolidColorAnalysis&, |
| bool)>& reply, |
| @@ -70,7 +69,6 @@ class RasterTaskImpl : public RasterTask { |
| previous_content_id_(previous_content_id), |
| resource_content_id_(resource_content_id), |
| source_frame_number_(source_frame_number), |
| - analyze_picture_(analyze_picture), |
| reply_(reply) {} |
| // Overridden from Task: |
| @@ -81,12 +79,6 @@ class RasterTaskImpl : public RasterTask { |
| DCHECK(raster_source_.get()); |
| DCHECK(raster_buffer_); |
| - if (analyze_picture_) { |
| - Analyze(raster_source_.get()); |
| - if (analysis_.is_solid_color) |
| - return; |
| - } |
| - |
| Raster(raster_source_.get()); |
| } |
| @@ -105,18 +97,6 @@ class RasterTaskImpl : public RasterTask { |
| ~RasterTaskImpl() override { DCHECK(!raster_buffer_); } |
| private: |
| - void Analyze(const DisplayListRasterSource* raster_source) { |
| - frame_viewer_instrumentation::ScopedAnalyzeTask analyze_task( |
| - tile_, tile_resolution_, source_frame_number_, layer_id_); |
| - |
| - DCHECK(raster_source); |
| - |
| - raster_source->PerformSolidColorAnalysis(content_rect_, contents_scale_, |
| - &analysis_); |
| - // Clear the flag if we're not using the estimator. |
| - analysis_.is_solid_color &= kUseColorEstimator; |
| - } |
| - |
| void Raster(const DisplayListRasterSource* raster_source) { |
| frame_viewer_instrumentation::ScopedRasterTask raster_task( |
| tile_, tile_resolution_, source_frame_number_, layer_id_); |
| @@ -145,7 +125,6 @@ class RasterTaskImpl : public RasterTask { |
| uint64_t previous_content_id_; |
| uint64_t resource_content_id_; |
| int source_frame_number_; |
| - bool analyze_picture_; |
| const base::Callback<void(const DisplayListRasterSource::SolidColorAnalysis&, |
| bool)> reply_; |
| scoped_ptr<RasterBuffer> raster_buffer_; |
| @@ -586,6 +565,17 @@ void TileManager::AssignGpuMemoryToTiles( |
| break; |
| } |
| + // We analyze for solid color here, to decide to continue |
| + // or drop the tile for scheduling and raster. |
| + SkColor color = SK_ColorTRANSPARENT; |
|
vmpstr
2015/12/29 21:24:23
You'll need to skip this block if use_picture_anal
sohanjg
2015/12/30 12:45:47
Done.
|
| + bool is_solid_color = |
| + prioritized_tile.raster_source()->PerformSolidColorAnalysis( |
| + tile->content_rect(), tile->contents_scale(), &color); |
| + if (is_solid_color) { |
| + tile->draw_info().set_solid_color(color); |
| + continue; |
| + } |
| + |
| // We won't be able to schedule this tile, so break out early. |
| if (tiles_that_need_to_be_rasterized->size() >= |
| scheduled_raster_task_limit) { |
| @@ -819,7 +809,6 @@ scoped_refptr<RasterTask> TileManager::CreateRasterTask( |
| prioritized_tile.priority().resolution, tile->layer_id(), |
| prepare_tiles_count_, static_cast<const void*>(tile), tile->id(), |
| tile->invalidated_id(), resource_content_id, tile->source_frame_number(), |
| - tile->use_picture_analysis(), |
| base::Bind(&TileManager::OnRasterTaskCompleted, base::Unretained(this), |
| tile->id(), resource), |
| &decode_tasks)); |
| @@ -858,21 +847,11 @@ void TileManager::UpdateTileDrawInfo( |
| ++flush_stats_.completed_count; |
| - if (analysis.is_solid_color) { |
| - draw_info.set_solid_color(analysis.solid_color); |
| - if (resource) { |
| - // TODO(ericrk): If more partial raster work is done in the future, it may |
| - // be worth returning the resource to the pool with its previous ID (not |
| - // currently tracked). crrev.com/1370333002/#ps40001 has a possible method |
| - // of achieving this. |
| - resource_pool_->ReleaseResource(resource, 0 /* content_id */); |
| - } |
| - } else { |
| - DCHECK(resource); |
| - draw_info.set_use_resource(); |
| - draw_info.resource_ = resource; |
| - draw_info.contents_swizzled_ = DetermineResourceRequiresSwizzle(tile); |
| - } |
| + DCHECK(resource); |
| + draw_info.set_use_resource(); |
| + draw_info.resource_ = resource; |
| + draw_info.contents_swizzled_ = DetermineResourceRequiresSwizzle(tile); |
| + |
| DCHECK(draw_info.IsReadyToDraw()); |
| draw_info.set_was_ever_ready_to_draw(); |