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..d0bf7be7220f9d6b968ddcd1f299f3d62efdf82a 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() = default; |
// ID for the current prepare tiles call. |
- const uint64_t prepare_tiles_id; |
+ const uint64_t prepare_tiles_id = 0; |
// The bin of the tile that caused this image to be requested. |
- const TilePriority::PriorityBin requesting_tile_bin; |
+ const TilePriority::PriorityBin requesting_tile_bin = TilePriority::NOW; |
+ |
+ // Whether the decode is requested as a part of tile rasterization. |
+ const TaskType task_type = TaskType::kInRaster; |
}; |
+ 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 |