OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #ifndef SkPdfRenderer_DEFINED | 9 #ifndef SkPdfRenderer_DEFINED |
10 #define SkPdfRenderer_DEFINED | 10 #define SkPdfRenderer_DEFINED |
11 | 11 |
12 class SkCanvas; | 12 class SkCanvas; |
13 class SkNativeParsedPDF; | 13 class SkNativeParsedPDF; |
14 class SkRect; | |
14 | 15 |
15 // TODO(edisonn): move in another file | 16 // TODO(edisonn): move in another file |
16 class SkPdfRenderer : public SkRefCnt { | 17 class SkPdfRenderer : public SkRefCnt { |
17 SkNativeParsedPDF* fPdfDoc; | 18 SkNativeParsedPDF* fPdfDoc; |
18 public: | 19 public: |
19 SkPdfRenderer() : fPdfDoc(NULL) {} | 20 SkPdfRenderer() : fPdfDoc(NULL) {} |
20 virtual ~SkPdfRenderer() {unload();} | 21 virtual ~SkPdfRenderer() {unload();} |
21 | 22 |
22 // TODO(edisonn): add options to render forms, or not | 23 // TODO(edisonn): add options to render forms, or not |
23 bool renderPage(int page, SkCanvas* canvas) const; | 24 bool renderPage(int page, SkCanvas* canvas, const SkRect& dst) const; |
reed1
2013/07/11 15:27:13
Why is this better than just using the matrix on t
edisonn
2013/07/11 15:36:24
there is some magic I need to do to remap the matr
| |
24 | 25 |
25 bool load(const SkString inputFileName); | 26 bool load(const SkString inputFileName); |
26 bool loaded() const {return fPdfDoc != NULL;} | 27 bool loaded() const {return fPdfDoc != NULL;} |
27 int pages() const; | 28 int pages() const; |
28 void unload(); | 29 void unload(); |
29 SkRect MediaBox(int page) const; | 30 SkRect MediaBox(int page) const; |
30 size_t bytesUsed() const; | 31 size_t bytesUsed() const; |
31 }; | 32 }; |
32 | 33 |
33 void reportPdfRenderStats(); | 34 void reportPdfRenderStats(); |
34 | 35 |
35 #endif // SkPdfRenderer_DEFINED | 36 #endif // SkPdfRenderer_DEFINED |
OLD | NEW |