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

Unified Diff: cc/layers/content_layer.cc

Issue 23049007: Implemented printToSkPicture without using WebViewBenchmarkSupport. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: deleted comment Created 7 years, 4 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/layers/content_layer.cc
diff --git a/cc/layers/content_layer.cc b/cc/layers/content_layer.cc
index 2053ecbeac10f10610d30aa1be167270aa5808cf..7ad848ea12453d8cbec8134b046d5623292bf0dc 100644
--- a/cc/layers/content_layer.cc
+++ b/cc/layers/content_layer.cc
@@ -145,4 +145,19 @@ bool ContentLayer::SupportsLCDText() const {
return true;
}
+skia::RefPtr<SkPicture> ContentLayer::GetPicture() const {
+ if (!DrawsContent())
+ return skia::RefPtr<SkPicture>();
+
+ int width = bounds().width();
+ int height = bounds().height();
+ gfx::RectF opaque;
+
+ skia::RefPtr<SkPicture> picture = skia::AdoptRef(new SkPicture);
+ SkCanvas* canvas = picture->beginRecording(width, height);
+ client_->PaintContents(canvas, gfx::Rect(width, height), &opaque);
+ picture->endRecording();
+ return picture;
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698