Chromium Code Reviews| Index: cc/playback/discardable_image_map.h |
| diff --git a/cc/playback/discardable_image_map.h b/cc/playback/discardable_image_map.h |
| index adae86248074cf55fec472076a52369a56fe49b0..b0eaa63fd2c8a7fdcd1b1efeae08ce22bb09863f 100644 |
| --- a/cc/playback/discardable_image_map.h |
| +++ b/cc/playback/discardable_image_map.h |
| @@ -5,10 +5,12 @@ |
| #ifndef CC_PLAYBACK_DISCARDABLE_IMAGE_MAP_H_ |
| #define CC_PLAYBACK_DISCARDABLE_IMAGE_MAP_H_ |
| +#include <unordered_map> |
| #include <utility> |
| #include <vector> |
| #include "cc/base/cc_export.h" |
| +#include "cc/base/region.h" |
| #include "cc/base/rtree.h" |
| #include "cc/playback/draw_image.h" |
| #include "third_party/skia/include/core/SkCanvas.h" |
| @@ -18,6 +20,9 @@ |
| namespace cc { |
| +// A map of SkImage id to the region for this image. |
| +using ImageToRegionMap = std::unordered_map<uint32_t, Region>; |
|
vmpstr
2016/11/15 18:57:54
Can you put this as a member of DiscardableImageMa
Khushal
2016/11/16 05:01:58
Done.
|
| + |
| // Helper function to apply the matrix to the rect and return the result. |
| SkRect MapRect(const SkMatrix& matrix, const SkRect& src); |
| @@ -46,6 +51,7 @@ class CC_EXPORT DiscardableImageMap { |
| void GetDiscardableImagesInRect(const gfx::Rect& rect, |
| const gfx::SizeF& raster_scales, |
| std::vector<DrawImage>* images) const; |
| + Region GetRegionForImage(const SkImage* image) const; |
| private: |
| friend class ScopedMetadataGenerator; |
| @@ -55,6 +61,8 @@ class CC_EXPORT DiscardableImageMap { |
| void EndGeneratingMetadata(); |
| std::vector<std::pair<DrawImage, gfx::Rect>> all_images_; |
| + ImageToRegionMap image_to_region_; |
|
vmpstr
2016/11/15 18:57:54
nit: image_id_to_region_map_
Khushal
2016/11/16 05:01:58
Done.
|
| + |
| RTree images_rtree_; |
| }; |