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

Unified Diff: printing/pdf_metafile_skia.h

Issue 704813002: PdfMetafileSkia gives out a SkCanvas, not a SkBaseDevice. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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 | « chrome/renderer/printing/print_web_view_helper_pdf_win.cc ('k') | printing/pdf_metafile_skia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/pdf_metafile_skia.h
diff --git a/printing/pdf_metafile_skia.h b/printing/pdf_metafile_skia.h
index bc75abd77939a42120fb96c0c50a661f7f0f1b30..58e928b0025454570b4b1bec9e247eb389c4d9d2 100644
--- a/printing/pdf_metafile_skia.h
+++ b/printing/pdf_metafile_skia.h
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "build/build_config.h"
#include "printing/metafile.h"
+#include "skia/ext/vector_canvas.h"
#if defined(OS_WIN)
#include <windows.h>
@@ -62,6 +63,8 @@ class PRINTING_EXPORT PdfMetafileSkia : public Metafile {
const MacRenderPageParams& params) const override;
#endif
+ bool SaveTo(base::File* file) const override;
+
#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
// TODO(vitalybuka): replace with SaveTo().
bool SaveToFD(const base::FileDescriptor& fd) const;
@@ -71,17 +74,18 @@ class PRINTING_EXPORT PdfMetafileSkia : public Metafile {
scoped_ptr<PdfMetafileSkia> GetMetafileForCurrentPage();
// This method calls StartPage and then returns an appropriate
- // VectorPlatformDevice implementation bound to the context created by
- // StartPage or NULL on error.
- SkBaseDevice* StartPageForVectorCanvas(const gfx::Size& page_size,
- const gfx::Rect& content_area,
- const float& scale_factor);
+ // VectorCanvas implementation bound to the context created by
+ // StartPage or NULL on error. The skia::VectorCanvas pointer that
+ // is returned is owned by this PdfMetafileSkia object and does not
+ // need to be ref()ed or unref()ed. The canvas will remain valid
+ // until FinishPage() or FinishDocument() is called.
+ skia::VectorCanvas* GetVectorCanvasForNewPage(const gfx::Size& page_size,
+ const gfx::Rect& content_area,
+ const float& scale_factor);
+
private:
scoped_ptr<PdfMetafileSkiaData> data_;
- // True when finish page is outstanding for current page.
- bool page_outstanding_;
-
DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia);
};
« no previous file with comments | « chrome/renderer/printing/print_web_view_helper_pdf_win.cc ('k') | printing/pdf_metafile_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698