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

Unified Diff: cc/resources/picture.h

Issue 14230007: cc: Do GatherPixelRefs from skia at record time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update to hash_map Created 7 years, 8 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
« no previous file with comments | « no previous file | cc/resources/picture.cc » ('j') | cc/resources/picture.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture.h
diff --git a/cc/resources/picture.h b/cc/resources/picture.h
index 8598fbf62b3c0a7ce983c9acd10737ef19e71d4a..e4a5a0015f54d202f170479ffba0f985f20e896b 100644
--- a/cc/resources/picture.h
+++ b/cc/resources/picture.h
@@ -6,11 +6,14 @@
#define CC_RESOURCES_PICTURE_H_
#include <list>
+#include <utility>
#include <vector>
#include "base/basictypes.h"
+#include "base/hash_tables.h"
#include "base/memory/ref_counted.h"
#include "cc/base/cc_export.h"
+#include "cc/base/hash_pair.h"
#include "skia/ext/lazy_pixel_ref.h"
#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkPixelRef.h"
@@ -60,14 +63,24 @@ class CC_EXPORT Picture
std::list<skia::LazyPixelRef*>& pixel_ref_list);
private:
+ typedef base::hash_map<
+ std::pair<int, int>,
+ std::list<skia::LazyPixelRef*> > PixelRefsMap;
+
explicit Picture(gfx::Rect layer_rect);
// This constructor assumes SkPicture is already ref'd and transfers
// ownership to this picture.
Picture(const skia::RefPtr<SkPicture>&,
gfx::Rect layer_rect,
- gfx::Rect opaque_rect);
+ gfx::Rect opaque_rect,
+ const PixelRefsMap& lazy_pixel_refs);
~Picture();
+ void GatherPixelRefsFromSkia(
+ const gfx::Rect& layer_rect,
+ std::list<skia::LazyPixelRef*>& pixel_ref_list);
+ void GatherAllPixelRefs();
+
gfx::Rect layer_rect_;
gfx::Rect opaque_rect_;
skia::RefPtr<SkPicture> picture_;
@@ -75,6 +88,8 @@ class CC_EXPORT Picture
typedef std::vector<scoped_refptr<Picture> > PictureVector;
PictureVector clones_;
+ PixelRefsMap lazy_pixel_refs_;
+
friend class base::RefCountedThreadSafe<Picture>;
DISALLOW_COPY_AND_ASSIGN(Picture);
};
« no previous file with comments | « no previous file | cc/resources/picture.cc » ('j') | cc/resources/picture.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698