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

Unified Diff: printing/pdf_metafile_skia.cc

Issue 1819683002: Use sk_sp-based picture recording APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: skspify GetPicture/GetFlattenedPicture Created 4 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 | « content/renderer/gpu/gpu_benchmarking_extension.cc ('k') | skia/ext/analysis_canvas_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/pdf_metafile_skia.cc
diff --git a/printing/pdf_metafile_skia.cc b/printing/pdf_metafile_skia.cc
index 6ba04c739a707927dc286307c50dc34e80a52bdd..104970e1cecf45319cbc20a3b909b7b98ed37145 100644
--- a/printing/pdf_metafile_skia.cc
+++ b/printing/pdf_metafile_skia.cc
@@ -51,7 +51,7 @@ struct Page {
SkSize page_size_;
SkRect content_area_;
float scale_factor_;
- skia::RefPtr<SkPicture> content_;
+ sk_sp<SkPicture> content_;
};
bool WriteAssetToBuffer(const SkStreamAsset* asset,
@@ -144,7 +144,7 @@ bool PdfMetafileSkia::FinishPage() {
return false;
DCHECK(!(data_->pages_.back().content_));
data_->pages_.back().content_ =
- skia::AdoptRef(data_->recorder_.endRecordingAsPicture());
+ data_->recorder_.finishRecordingAsPicture();
return true;
}
@@ -173,7 +173,7 @@ bool PdfMetafileSkia::FinishDocument() {
page.page_size_.width(), page.page_size_.height(), &page.content_area_);
// No need to save/restore, since this canvas is not reused after endPage()
canvas->scale(page.scale_factor_, page.scale_factor_);
- canvas->drawPicture(page.content_.get());
+ canvas->drawPicture(page.content_);
pdf_doc->endPage();
}
if (!pdf_doc->close())
« no previous file with comments | « content/renderer/gpu/gpu_benchmarking_extension.cc ('k') | skia/ext/analysis_canvas_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698