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 SkPdfParser_DEFINED | 9 #ifndef SkPdfParser_DEFINED |
10 #define SkPdfParser_DEFINED | 10 #define SkPdfParser_DEFINED |
(...skipping 13 matching lines...) Expand all Loading... |
24 PdfContext* fPdfContext; | 24 PdfContext* fPdfContext; |
25 SkCanvas* fCanvas; | 25 SkCanvas* fCanvas; |
26 | 26 |
27 public: | 27 public: |
28 PdfTokenLooper(PdfTokenLooper* parent, | 28 PdfTokenLooper(PdfTokenLooper* parent, |
29 SkPdfNativeTokenizer* tokenizer, | 29 SkPdfNativeTokenizer* tokenizer, |
30 PdfContext* pdfContext, | 30 PdfContext* pdfContext, |
31 SkCanvas* canvas) | 31 SkCanvas* canvas) |
32 : fParent(parent), fTokenizer(tokenizer), fPdfContext(pdfContext), fCanv
as(canvas) {} | 32 : fParent(parent), fTokenizer(tokenizer), fPdfContext(pdfContext), fCanv
as(canvas) {} |
33 | 33 |
| 34 virtual ~PdfTokenLooper() {} |
| 35 |
34 virtual PdfResult consumeToken(PdfToken& token) = 0; | 36 virtual PdfResult consumeToken(PdfToken& token) = 0; |
35 virtual void loop() = 0; | 37 virtual void loop() = 0; |
36 | 38 |
37 void setUp(PdfTokenLooper* parent) { | 39 void setUp(PdfTokenLooper* parent) { |
38 fParent = parent; | 40 fParent = parent; |
39 fTokenizer = parent->fTokenizer; | 41 fTokenizer = parent->fTokenizer; |
40 fPdfContext = parent->fPdfContext; | 42 fPdfContext = parent->fPdfContext; |
41 fCanvas = parent->fCanvas; | 43 fCanvas = parent->fCanvas; |
42 } | 44 } |
43 }; | 45 }; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 class SkPdfViewer : public SkRefCnt { | 79 class SkPdfViewer : public SkRefCnt { |
78 public: | 80 public: |
79 | 81 |
80 bool load(const SkString inputFileName, SkPicture* out); | 82 bool load(const SkString inputFileName, SkPicture* out); |
81 bool write(void*) const { return false; } | 83 bool write(void*) const { return false; } |
82 }; | 84 }; |
83 | 85 |
84 void reportPdfRenderStats(); | 86 void reportPdfRenderStats(); |
85 | 87 |
86 #endif // SkPdfParser_DEFINED | 88 #endif // SkPdfParser_DEFINED |
OLD | NEW |