Index: cc/tiles/tile_manager.cc |
diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc |
index ea9b32c3523f664ec2576a7b1bce47bb939ef247..5752db7d9ac43086de037653875e6546015191b1 100644 |
--- a/cc/tiles/tile_manager.cc |
+++ b/cc/tiles/tile_manager.cc |
@@ -37,11 +37,23 @@ namespace { |
// a tile is of solid color. |
const bool kUseColorEstimator = true; |
+// TODO(enne): remove this eventually once there is enough new data from |
+// the other two raster task timers. |
DEFINE_SCOPED_UMA_HISTOGRAM_AREA_TIMER( |
ScopedRasterTaskTimer, |
"Compositing.%s.RasterTask.RasterUs", |
vmpstr
2016/10/03 17:33:13
This is also being monitored by some system, can y
|
"Compositing.%s.RasterTask.RasterPixelsPerMs"); |
+DEFINE_SCOPED_UMA_HISTOGRAM_AREA_TIMER( |
+ ScopedSoftwareRasterTaskTimer, |
+ "Compositing.%s.RasterTask.SoftwareRasterUs", |
+ "Compositing.%s.RasterTask.SoftwareRasterPixelsPerMs"); |
+ |
+DEFINE_SCOPED_UMA_HISTOGRAM_AREA_TIMER( |
+ ScopedGpuRasterTaskTimer, |
+ "Compositing.%s.RasterTask.GpuRasterUs", |
+ "Compositing.%s.RasterTask.GpuRasterPixelsPerMs"); |
+ |
class RasterTaskImpl : public TileTask { |
public: |
RasterTaskImpl(TileManager* tile_manager, |
@@ -54,8 +66,8 @@ class RasterTaskImpl : public TileTask { |
uint64_t source_prepare_tiles_id, |
std::unique_ptr<RasterBuffer> raster_buffer, |
TileTask::Vector* dependencies, |
- bool supports_concurrent_execution) |
- : TileTask(supports_concurrent_execution, dependencies), |
+ bool is_gpu_rasterization) |
+ : TileTask(!is_gpu_rasterization, dependencies), |
tile_manager_(tile_manager), |
tile_(tile), |
resource_(resource), |
@@ -70,6 +82,7 @@ class RasterTaskImpl : public TileTask { |
tile_tracing_id_(static_cast<void*>(tile)), |
new_content_id_(tile->id()), |
source_frame_number_(tile->source_frame_number()), |
+ is_gpu_rasterization_(is_gpu_rasterization), |
raster_buffer_(std::move(raster_buffer)) { |
DCHECK(origin_thread_checker_.CalledOnValidThread()); |
} |
@@ -84,14 +97,27 @@ class RasterTaskImpl : public TileTask { |
frame_viewer_instrumentation::ScopedRasterTask raster_task( |
tile_tracing_id_, tile_resolution_, source_frame_number_, layer_id_); |
- ScopedRasterTaskTimer timer; |
- timer.SetArea(content_rect_.size().GetArea()); |
DCHECK(raster_source_); |
- raster_buffer_->Playback(raster_source_.get(), content_rect_, |
- invalid_content_rect_, new_content_id_, |
- contents_scale_, playback_settings_); |
+ int area = content_rect_.size().GetArea(); |
+ if (is_gpu_rasterization_) { |
enne (OOO)
2016/10/03 17:11:36
Scoped timers, what are you going to do. Certainl
vmpstr
2016/10/03 17:33:13
Maybe something like
base::Optional<ScopedGpuRast
|
+ ScopedRasterTaskTimer timer; |
+ ScopedGpuRasterTaskTimer timer_gpu; |
+ timer.SetArea(area); |
+ timer_gpu.SetArea(area); |
+ raster_buffer_->Playback(raster_source_.get(), content_rect_, |
+ invalid_content_rect_, new_content_id_, |
+ contents_scale_, playback_settings_); |
+ } else { |
+ ScopedRasterTaskTimer timer; |
+ ScopedSoftwareRasterTaskTimer timer_software; |
+ timer.SetArea(area); |
+ timer_software.SetArea(area); |
+ raster_buffer_->Playback(raster_source_.get(), content_rect_, |
+ invalid_content_rect_, new_content_id_, |
+ contents_scale_, playback_settings_); |
+ } |
} |
// Overridden from TileTask: |
@@ -133,6 +159,7 @@ class RasterTaskImpl : public TileTask { |
void* tile_tracing_id_; |
uint64_t new_content_id_; |
int source_frame_number_; |
+ bool is_gpu_rasterization_; |
std::unique_ptr<RasterBuffer> raster_buffer_; |
DISALLOW_COPY_AND_ASSIGN(RasterTaskImpl); |
@@ -973,7 +1000,6 @@ scoped_refptr<TileTask> TileManager::CreateRasterTask( |
prepare_tiles_count_, prioritized_tile.priority().priority_bin); |
image_manager_.GetTasksForImagesAndRef(&images, &decode_tasks, tracing_info); |
- bool supports_concurrent_execution = !use_gpu_rasterization_; |
std::unique_ptr<RasterBuffer> raster_buffer = |
raster_buffer_provider_->AcquireBufferForRaster( |
resource, resource_content_id, tile->invalidated_id()); |
@@ -981,7 +1007,7 @@ scoped_refptr<TileTask> TileManager::CreateRasterTask( |
this, tile, resource, prioritized_tile.raster_source(), playback_settings, |
prioritized_tile.priority().resolution, invalidated_rect, |
prepare_tiles_count_, std::move(raster_buffer), &decode_tasks, |
- supports_concurrent_execution)); |
+ use_gpu_rasterization_)); |
} |
void TileManager::OnRasterTaskCompleted( |