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

Unified Diff: cc/picture_pile_impl.cc

Issue 11731002: Implement a method to access the non-composited content root layer picture pile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase. Created 7 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
« no previous file with comments | « cc/picture_pile_impl.h ('k') | cc/proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture_pile_impl.cc
diff --git a/cc/picture_pile_impl.cc b/cc/picture_pile_impl.cc
index 571dcc6a09e55af20064e2dd06b20d67f0a6081e..cb4ff2b76fe85f4bf9d3b15ce3d99e65b6d64e21 100644
--- a/cc/picture_pile_impl.cc
+++ b/cc/picture_pile_impl.cc
@@ -97,4 +97,29 @@ void PicturePileImpl::GatherPixelRefs(
}
}
+skia::RefPtr<SkPicture> PicturePileImpl::GetFlattenedPicture() {
+ TRACE_EVENT0("cc", "PicturePileImpl::GetFlattenedPicture");
+
+ gfx::Rect layer_rect;
+ for (PicturePile::Pile::const_iterator i = pile_.begin();
+ i != pile_.end(); ++i) {
+ layer_rect.Union((*i)->LayerRect());
+ }
+
+ skia::RefPtr<SkPicture> picture = skia::AdoptRef(new SkPicture);
+ if (layer_rect.IsEmpty())
+ return picture;
+
+ SkCanvas* canvas = picture->beginRecording(
+ layer_rect.width(),
+ layer_rect.height(),
+ SkPicture::kUsePathBoundsForClip_RecordingFlag);
+
+ RenderingStats stats;
+ Raster(canvas, layer_rect, 1.0, &stats);
+ picture->endRecording();
+
+ return picture;
+}
+
} // namespace cc
« no previous file with comments | « cc/picture_pile_impl.h ('k') | cc/proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698