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..93377575a7362f81b5618b8aa80405a55b0b5849 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,20 +35,44 @@ class TileTask; |
| // thread. |
| class CC_EXPORT ImageDecodeCache { |
| public: |
| + enum class ImageDecodeType { kInRaster, kCheckerImaging, kJSDecode }; |
|
vmpstr
2017/05/30 20:15:12
I think we should be consistent wrt to what we cal
Khushal
2017/05/31 18:21:20
Done.
|
| + |
| + static devtools_instrumentation::ScopedImageDecodeTask::DecodeTaskType |
| + ToScopedDecodeTaskType(ImageDecodeType decode_type) { |
| + using ScopedTaskType = |
| + devtools_instrumentation::ScopedImageDecodeTask::DecodeTaskType; |
| + switch (decode_type) { |
| + case ImageDecodeType::kInRaster: |
| + return ScopedTaskType::kInRaster; |
| + case ImageDecodeType::kCheckerImaging: |
| + return ScopedTaskType::kCheckerImaging; |
| + case ImageDecodeType::kJSDecode: |
| + return ScopedTaskType::kJSDecode; |
| + } |
| + NOTREACHED(); |
| + return ScopedTaskType::kInRaster; |
| + } |
| + |
| // 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, |
| + ImageDecodeType type) |
| : prepare_tiles_id(prepare_tiles_id), |
| - requesting_tile_bin(requesting_tile_bin) {} |
| - TracingInfo() : TracingInfo(0, TilePriority::NOW) {} |
| + requesting_tile_bin(requesting_tile_bin), |
| + type(type) {} |
| + TracingInfo() |
| + : TracingInfo(0, TilePriority::NOW, ImageDecodeType::kInRaster) {} |
| // 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; |
| + |
| + // The task type for in-raster and out of raster decode tasks. |
| + const ImageDecodeType type; |
| }; |
| virtual ~ImageDecodeCache() {} |
| @@ -68,6 +93,7 @@ class CC_EXPORT ImageDecodeCache { |
| // the right GPU context for upload. |
| virtual bool GetOutOfRasterDecodeTaskForImageAndRef( |
| const DrawImage& image, |
| + ImageDecodeType decode_type, |
| scoped_refptr<TileTask>* task) = 0; |
| // Unrefs an image. When the tile is finished, this should be called for every |