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

Unified Diff: printing/metafile_skia_wrapper.cc

Issue 2686033005: Move metafile printing code from platform canvas to PaintCanvas (Closed)
Patch Set: Fix missing build_config include Created 3 years, 10 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 | « printing/metafile_skia_wrapper.h ('k') | printing/pdf_metafile_skia.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/metafile_skia_wrapper.cc
diff --git a/printing/metafile_skia_wrapper.cc b/printing/metafile_skia_wrapper.cc
index 5d3bd6e9d6cca0a227adddfbc46dd9904f57800f..3ba38f25958b06622c249e0d85b9b386f8823127 100644
--- a/printing/metafile_skia_wrapper.cc
+++ b/printing/metafile_skia_wrapper.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "printing/metafile_skia_wrapper.h"
-#include "skia/ext/platform_canvas.h"
#include "third_party/skia/include/core/SkMetaData.h"
#include "third_party/skia/include/core/SkRefCnt.h"
@@ -16,21 +15,21 @@ const char kMetafileKey[] = "CrMetafile";
} // namespace
// static
-void MetafileSkiaWrapper::SetMetafileOnCanvas(const SkCanvas& canvas,
+void MetafileSkiaWrapper::SetMetafileOnCanvas(cc::PaintCanvas* canvas,
PdfMetafileSkia* metafile) {
sk_sp<MetafileSkiaWrapper> wrapper;
// Can't use sk_make_sp<>() because the constructor is private.
if (metafile)
wrapper = sk_sp<MetafileSkiaWrapper>(new MetafileSkiaWrapper(metafile));
- SkMetaData& meta = skia::GetMetaData(canvas);
+ SkMetaData& meta = canvas->getMetaData();
meta.setRefCnt(kMetafileKey, wrapper.get());
}
// static
PdfMetafileSkia* MetafileSkiaWrapper::GetMetafileFromCanvas(
- const SkCanvas& canvas) {
- SkMetaData& meta = skia::GetMetaData(canvas);
+ cc::PaintCanvas* canvas) {
+ SkMetaData& meta = canvas->getMetaData();
SkRefCnt* value;
if (!meta.findRefCnt(kMetafileKey, &value) || !value)
return nullptr;
« no previous file with comments | « printing/metafile_skia_wrapper.h ('k') | printing/pdf_metafile_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698