Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Unified Diff: cc/playback/discardable_image_map.h

Issue 2656983006: cc: Add image to rect map in DiscardableImageMap. (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/playback/discardable_image_map.h
diff --git a/cc/playback/discardable_image_map.h b/cc/playback/discardable_image_map.h
index b521fff04ce503c6949a0cbc17343f7d69c5a68d..abbf08bc0e7a52b4e767c96ccfbf280f2a5e9443 100644
--- a/cc/playback/discardable_image_map.h
+++ b/cc/playback/discardable_image_map.h
@@ -5,12 +5,14 @@
#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/rtree.h"
#include "cc/playback/draw_image.h"
+#include "cc/playback/image_id.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "ui/gfx/geometry/rect.h"
@@ -46,6 +48,7 @@ class CC_EXPORT DiscardableImageMap {
void GetDiscardableImagesInRect(const gfx::Rect& rect,
float contents_scale,
std::vector<DrawImage>* images) const;
+ gfx::Rect GetRectForImage(ImageId image_id) const;
private:
friend class ScopedMetadataGenerator;
@@ -55,6 +58,8 @@ class CC_EXPORT DiscardableImageMap {
void EndGeneratingMetadata();
std::vector<std::pair<DrawImage, gfx::Rect>> all_images_;
+ std::unordered_map<ImageId, gfx::Rect> image_id_to_rect_;
+
RTree images_rtree_;
};
« no previous file with comments | « cc/BUILD.gn ('k') | cc/playback/discardable_image_map.cc » ('j') | cc/playback/image_id.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698