Chromium Code Reviews| Index: cc/tiles/image_decode_cache.h |
| diff --git a/cc/tiles/image_decode_cache.h b/cc/tiles/image_decode_cache.h |
| index 1b550a6b06e411718ea04d79d05d4cd6f351251d..5415025791564efa03062bd9263fdc76c6f61ec9 100644 |
| --- a/cc/tiles/image_decode_cache.h |
| +++ b/cc/tiles/image_decode_cache.h |
| @@ -6,6 +6,7 @@ |
| #define CC_TILES_IMAGE_DECODE_CACHE_H_ |
| #include "base/memory/ref_counted.h" |
| +#include "cc/base/devtools_instrumentation.h" |
| #include "cc/paint/draw_image.h" |
| #include "cc/tiles/decoded_draw_image.h" |
| #include "cc/tiles/tile_priority.h" |
| @@ -34,22 +35,43 @@ class TileTask; |
| // thread. |
| class CC_EXPORT ImageDecodeCache { |
| public: |
| + enum class TaskType { kInRaster, kOutOfRaster }; |
| + |
| // This information should be used strictly in tracing, UMA, and any other |
| // reporting systems. |
| struct TracingInfo { |
| TracingInfo(uint64_t prepare_tiles_id, |
| - TilePriority::PriorityBin requesting_tile_bin) |
| + TilePriority::PriorityBin requesting_tile_bin, |
| + TaskType task_type) |
| : prepare_tiles_id(prepare_tiles_id), |
| - requesting_tile_bin(requesting_tile_bin) {} |
| - TracingInfo() : TracingInfo(0, TilePriority::NOW) {} |
| + requesting_tile_bin(requesting_tile_bin), |
| + task_type(task_type) {} |
| + TracingInfo() : TracingInfo(0, TilePriority::NOW, TaskType::kInRaster) {} |
|
vmpstr
2017/06/01 21:40:56
While here, can you just = default this and put th
Khushal
2017/06/01 23:45:09
Done.
|
| // ID for the current prepare tiles call. |
| const uint64_t prepare_tiles_id; |
| // The bin of the tile that caused this image to be requested. |
| const TilePriority::PriorityBin requesting_tile_bin; |
| + |
| + // Whether the decode is requested as a part of tile rasterization. |
| + const TaskType task_type; |
| }; |
| + static devtools_instrumentation::ScopedImageDecodeTask::TaskType |
| + ToScopedTaskType(TaskType task_type) { |
| + using ScopedTaskType = |
| + devtools_instrumentation::ScopedImageDecodeTask::TaskType; |
| + switch (task_type) { |
| + case TaskType::kInRaster: |
| + return ScopedTaskType::kInRaster; |
| + case TaskType::kOutOfRaster: |
| + return ScopedTaskType::kOutOfRaster; |
| + } |
| + NOTREACHED(); |
| + return ScopedTaskType::kInRaster; |
| + } |
| + |
| virtual ~ImageDecodeCache() {} |
| // Fill in an TileTask which will decode the given image when run. In |