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

Side by Side Diff: tools/PdfRenderer.h

Issue 463603002: clean up render_pdfs: (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: AnotherPatchSet Created 6 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 unified diff | Download patch
« no previous file with comments | « gyp/tools.gyp ('k') | tools/PdfRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef PdfRenderer_DEFINED
9 #define PdfRenderer_DEFINED
10
11 //
12 // PdfRender takes a SkPicture and writes it to a PDF file.
13 // An SkPicture can be built manually, or read from an SKP file.
14 //
15
16 #include "SkDocument.h"
17 #include "SkMath.h"
18 #include "SkPicture.h"
19 #include "SkTypes.h"
20 #include "SkTDArray.h"
21 #include "SkRefCnt.h"
22 #include "SkString.h"
23
24 class SkBitmap;
25 class SkCanvas;
26 class SkWStream;
27
28 namespace sk_tools {
29
30 class PdfRenderer : public SkRefCnt {
31 public:
32 virtual void init(SkPicture* pict, SkWStream* stream);
33 virtual void setup() {}
34 virtual bool render() = 0;
35 virtual void end();
36
37 PdfRenderer(SkPicture::EncodeBitmap encoder)
38 : fPicture(NULL)
39 , fEncoder(encoder)
40 , fPdfDoc(NULL)
41 {}
42
43 protected:
44 SkCanvas* setupCanvas(SkWStream* stream, int width, int height);
45
46 SkAutoTUnref<SkCanvas> fCanvas;
47 SkPicture* fPicture;
48 SkPicture::EncodeBitmap fEncoder;
49 SkAutoTUnref<SkDocument> fPdfDoc;
50
51 private:
52 typedef SkRefCnt INHERITED;
53 };
54
55 class SimplePdfRenderer : public PdfRenderer {
56 public:
57 SimplePdfRenderer(SkPicture::EncodeBitmap encoder)
58 : PdfRenderer(encoder) {}
59 virtual bool render() SK_OVERRIDE;
60
61 private:
62 typedef PdfRenderer INHERITED;
63 };
64
65 }
66
67 #endif // PdfRenderer_DEFINED
OLDNEW
« no previous file with comments | « gyp/tools.gyp ('k') | tools/PdfRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698