Chromium Code Reviews| Index: cc/base/devtools_instrumentation.h |
| diff --git a/cc/base/devtools_instrumentation.h b/cc/base/devtools_instrumentation.h |
| index 40e2d9efd708851bbb56a374b094ec57048c9008..42a49504799eff67cff028170a44a2c83c63273c 100644 |
| --- a/cc/base/devtools_instrumentation.h |
| +++ b/cc/base/devtools_instrumentation.h |
| @@ -57,31 +57,56 @@ class CC_BASE_EXPORT ScopedLayerTask { |
| class CC_BASE_EXPORT ScopedImageDecodeTask { |
| public: |
| - enum Type { SOFTWARE, GPU }; |
| - |
| - ScopedImageDecodeTask(const void* imagePtr, Type type) |
| - : type_(type), start_time_(base::TimeTicks::Now()) { |
| + enum DecodeType { kSoftware, kGpu }; |
| + enum TaskType { kInRaster, kOutOfRaster }; |
| + |
| + ScopedImageDecodeTask(const void* image_ptr, |
| + DecodeType type, |
| + TaskType task_type) |
| + : type_(type), |
|
vmpstr
2017/06/01 21:40:56
nit: decode_type_(decode_type)
Khushal
2017/06/01 23:45:09
Done.
|
| + task_type_(task_type), |
| + start_time_(base::TimeTicks::Now()) { |
| TRACE_EVENT_BEGIN1(internal::kCategory, internal::kImageDecodeTask, |
| internal::kPixelRefId, |
| - reinterpret_cast<uint64_t>(imagePtr)); |
| + reinterpret_cast<uint64_t>(image_ptr)); |
| } |
| ~ScopedImageDecodeTask() { |
| TRACE_EVENT_END0(internal::kCategory, internal::kImageDecodeTask); |
| base::TimeDelta duration = base::TimeTicks::Now() - start_time_; |
| - switch (type_) { |
| - case SOFTWARE: |
| - UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Software", |
| - duration.InMicroseconds()); |
| + switch (task_type_) { |
| + case kInRaster: |
| + switch (type_) { |
| + case kSoftware: |
| + UMA_HISTOGRAM_COUNTS_1M( |
| + "Renderer4.ImageDecodeTaskDurationUs.Software", |
| + duration.InMicroseconds()); |
| + break; |
| + case kGpu: |
| + UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Gpu", |
| + duration.InMicroseconds()); |
| + break; |
| + } |
| break; |
| - case GPU: |
| - UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Gpu", |
| - duration.InMicroseconds()); |
| + case kOutOfRaster: |
| + switch (type_) { |
| + case kSoftware: |
| + UMA_HISTOGRAM_COUNTS_1M( |
| + "Renderer4.ImageDecodeTaskDurationUs.OutOfRaster.Software", |
| + duration.InMicroseconds()); |
| + break; |
| + case kGpu: |
| + UMA_HISTOGRAM_COUNTS_1M( |
| + "Renderer4.ImageDecodeTaskDurationUs.OutOfRaster.Gpu", |
| + duration.InMicroseconds()); |
| + break; |
| + } |
| break; |
| } |
| } |
| private: |
| - const Type type_; |
| + const DecodeType type_; |
| + const TaskType task_type_; |
| const base::TimeTicks start_time_; |
| DISALLOW_COPY_AND_ASSIGN(ScopedImageDecodeTask); |
| }; |