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..e176d6323ca4aec3e1f2bf3e7824e9919e4159f0 100644 |
| --- a/cc/base/devtools_instrumentation.h |
| +++ b/cc/base/devtools_instrumentation.h |
| @@ -58,9 +58,14 @@ class CC_BASE_EXPORT ScopedLayerTask { |
| class CC_BASE_EXPORT ScopedImageDecodeTask { |
| public: |
| enum Type { SOFTWARE, GPU }; |
|
vmpstr
2017/05/30 20:15:12
Can you change this to be consistent with the nami
Khushal
2017/05/31 18:21:20
Done.
|
| - |
| - ScopedImageDecodeTask(const void* imagePtr, Type type) |
| - : type_(type), start_time_(base::TimeTicks::Now()) { |
| + enum DecodeTaskType { kInRaster, kCheckerImaging, kJSDecode }; |
| + |
| + ScopedImageDecodeTask(const void* imagePtr, |
|
vmpstr
2017/05/30 20:15:12
image_ptr while here
Khushal
2017/05/31 18:21:20
Done.
|
| + Type type, |
| + DecodeTaskType task_type) |
| + : type_(type), |
| + task_type_(task_type), |
| + start_time_(base::TimeTicks::Now()) { |
| TRACE_EVENT_BEGIN1(internal::kCategory, internal::kImageDecodeTask, |
| internal::kPixelRefId, |
| reinterpret_cast<uint64_t>(imagePtr)); |
| @@ -68,20 +73,54 @@ class CC_BASE_EXPORT ScopedImageDecodeTask { |
| ~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 SOFTWARE: |
| + UMA_HISTOGRAM_COUNTS_1M( |
| + "Renderer4.ImageDecodeTaskDurationUs.Software", |
| + duration.InMicroseconds()); |
| + break; |
| + case GPU: |
| + UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Gpu", |
| + duration.InMicroseconds()); |
| + break; |
| + } |
| + break; |
| + case kCheckerImaging: |
| + switch (type_) { |
| + case SOFTWARE: |
| + UMA_HISTOGRAM_COUNTS_1M( |
| + "Renderer4.ImageDecodeTaskDurationUs.CheckerImaging.Software", |
| + duration.InMicroseconds()); |
| + break; |
| + case GPU: |
| + UMA_HISTOGRAM_COUNTS_1M( |
| + "Renderer4.ImageDecodeTaskDurationUs.CheckerImaging.Gpu", |
| + duration.InMicroseconds()); |
| + break; |
| + } |
| break; |
| - case GPU: |
| - UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Gpu", |
| - duration.InMicroseconds()); |
| + case kJSDecode: |
| + switch (type_) { |
| + case SOFTWARE: |
| + UMA_HISTOGRAM_COUNTS_1M( |
| + "Renderer4.ImageDecodeTaskDurationUs.JSDecode.Software", |
| + duration.InMicroseconds()); |
| + break; |
| + case GPU: |
| + UMA_HISTOGRAM_COUNTS_1M( |
| + "Renderer4.ImageDecodeTaskDurationUs.JSDecode.Gpu", |
| + duration.InMicroseconds()); |
| + break; |
| + } |
| break; |
| } |
| } |
| private: |
| const Type type_; |
| + const DecodeTaskType task_type_; |
| const base::TimeTicks start_time_; |
| DISALLOW_COPY_AND_ASSIGN(ScopedImageDecodeTask); |
| }; |