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..fc304d40b647f410c08fee1e7091ad519d705551 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,49 @@ class TileTask; |
| // thread. |
| class CC_EXPORT ImageDecodeCache { |
| public: |
| + enum class ImageDecodeType { |
| + IN_RASTER, |
|
danakj
2017/05/26 22:36:23
enums should be kFoo style now
Khushal
2017/05/26 23:17:35
Done.
|
| + OUT_OF_RASTER_CHECKER_IMAGING, |
| + OUT_OF_RASTER_JS_DECODE |
| + }; |
| + |
| + static devtools_instrumentation::ScopedImageDecodeTask::DecodeTaskType |
| + ToScopedDecodeTaskType(ImageDecodeType decode_type) { |
| + using ScopedTaskType = |
| + devtools_instrumentation::ScopedImageDecodeTask::DecodeTaskType; |
| + switch (decode_type) { |
| + case ImageDecodeType::IN_RASTER: |
| + return ScopedTaskType::IN_RASTER; |
| + case ImageDecodeType::OUT_OF_RASTER_CHECKER_IMAGING: |
| + return ScopedTaskType::CHECKER_IMAGING; |
|
danakj
2017/05/26 22:36:23
I think itd be less confusing if these names match
Khushal
2017/05/26 23:17:35
Done.
|
| + case ImageDecodeType::OUT_OF_RASTER_JS_DECODE: |
| + return ScopedTaskType::JS_DECODE_API; |
| + } |
| + NOTREACHED(); |
| + return ScopedTaskType::IN_RASTER; |
| + } |
| + |
| // This information should be used strictly in tracing, UMA, and any other |
| // reporting systems. |
| struct TracingInfo { |
|
danakj
2017/05/26 22:36:23
With these changes, this struct now has 4 construc
Khushal
2017/05/26 23:17:35
I just removed both.
|
| TracingInfo(uint64_t prepare_tiles_id, |
| - TilePriority::PriorityBin requesting_tile_bin) |
| + TilePriority::PriorityBin requesting_tile_bin, |
| + ImageDecodeType type = ImageDecodeType::IN_RASTER) |
| : prepare_tiles_id(prepare_tiles_id), |
| - requesting_tile_bin(requesting_tile_bin) {} |
| + requesting_tile_bin(requesting_tile_bin), |
| + type(type) {} |
| TracingInfo() : TracingInfo(0, TilePriority::NOW) {} |
| + explicit TracingInfo(ImageDecodeType type) |
| + : TracingInfo(0, TilePriority::NOW, type) {} |
| // 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 +98,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 |