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

Unified Diff: cc/resources/picture_pile_impl.h

Issue 14230007: cc: Do GatherPixelRefs from skia at record time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unittests + enne's review 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
Index: cc/resources/picture_pile_impl.h
diff --git a/cc/resources/picture_pile_impl.h b/cc/resources/picture_pile_impl.h
index 352772d83cae7cd5afbcc045fcaaa1f8beb5da42..467aa40667fa01b1a37c6eb1becaa2d8ce50302e 100644
--- a/cc/resources/picture_pile_impl.h
+++ b/cc/resources/picture_pile_impl.h
@@ -37,11 +37,6 @@ class CC_EXPORT PicturePileImpl : public PicturePileBase {
gfx::Rect canvas_rect,
float contents_scale);
- void GatherPixelRefs(
- gfx::Rect content_rect,
- float contents_scale,
- std::list<skia::LazyPixelRef*>& pixel_refs);
-
skia::RefPtr<SkPicture> GetFlattenedPicture();
struct CC_EXPORT Analysis {
@@ -61,8 +56,30 @@ class CC_EXPORT PicturePileImpl : public PicturePileBase {
float contents_scale,
Analysis* analysis);
+ class CC_EXPORT LazyPixelRefIterator {
+ public:
+ LazyPixelRefIterator(gfx::Rect content_rect,
+ float contents_scale,
+ const PicturePileImpl* picture_pile);
+ ~LazyPixelRefIterator();
+
+ skia::LazyPixelRef* operator->() const { return current_pixel_ref_; }
+ skia::LazyPixelRef* operator*() const { return current_pixel_ref_; }
+ LazyPixelRefIterator& operator++();
+ operator bool() const { return !!current_pixel_ref_; }
+
+ private:
+ const PicturePileImpl* picture_pile_;
+ gfx::Rect layer_rect_;
+ TilingData::Iterator tile_iterator_;
+ Picture::LazyPixelRefIterator picture_refs_iterator_;
+ PictureList picture_list_;
+ skia::LazyPixelRef* current_pixel_ref_;
+ };
+
protected:
friend class PicturePile;
+ friend class LazyPixelRefIterator;
explicit PicturePileImpl(bool enable_lcd_text);
PicturePileImpl(const PicturePileBase* other, bool enable_lcd_text);

Powered by Google App Engine
This is Rietveld 408576698