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

Unified Diff: cc/paint/skia_paint_canvas.cc

Issue 2757313002: Add PaintCanvas::drawDisplayItemList (Closed)
Patch Set: none Created 3 years, 9 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/paint/skia_paint_canvas.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/paint/skia_paint_canvas.cc
diff --git a/cc/paint/skia_paint_canvas.cc b/cc/paint/skia_paint_canvas.cc
index 03e05aed5ccb5d337a38f26dd13e1ad2cfab7d71..71dd8f6ceb37cd1a033cbcc709dabcaaa9532a77 100644
--- a/cc/paint/skia_paint_canvas.cc
+++ b/cc/paint/skia_paint_canvas.cc
@@ -5,6 +5,7 @@
#include "cc/paint/paint_canvas.h"
#include "base/memory/ptr_util.h"
+#include "cc/paint/display_item_list.h"
#include "cc/paint/paint_record.h"
#include "cc/paint/paint_recorder.h"
#include "third_party/skia/include/core/SkAnnotation.h"
@@ -265,6 +266,15 @@ void SkiaPaintCanvas::drawTextBlob(sk_sp<SkTextBlob> blob,
canvas_->drawTextBlob(blob.get(), x, y, ToSkPaint(flags));
}
+void SkiaPaintCanvas::drawDisplayItemList(
+ const SkRect& bounds,
+ const DisplayItemList* display_item_list) {
+ SkPictureRecorder recorder;
+ SkCanvas* canvas = recorder.beginRecording(bounds);
+ display_item_list->Raster(canvas, nullptr);
+ canvas_->drawPicture(recorder.finishRecordingAsPicture());
+}
+
void SkiaPaintCanvas::drawPicture(sk_sp<const PaintRecord> record,
const SkMatrix* matrix,
const PaintFlags* flags) {
« no previous file with comments | « cc/paint/skia_paint_canvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698