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 #include "SkPdfContext.h" | 8 #include "SkPdfContext.h" |
9 #include "SkPdfNativeDoc.h" | 9 #include "SkPdfNativeDoc.h" |
10 #include "SkPdfReporter.h" | 10 #include "SkPdfReporter.h" |
11 #include "SkPdfTokenLooper.h" | 11 #include "SkPdfTokenLooper.h" |
12 | 12 |
13 /////////////////////////////////////////////////////////////////////////////// | 13 /////////////////////////////////////////////////////////////////////////////// |
14 | 14 |
15 class PdfMainLooper : public SkPdfTokenLooper { | 15 class PdfMainLooper : public SkPdfTokenLooper { |
16 public: | 16 public: |
17 PdfMainLooper(SkPdfNativeTokenizer* tokenizer, | 17 PdfMainLooper(SkPdfNativeTokenizer* tokenizer, |
18 SkPdfContext* pdfContext, | 18 SkPdfContext* pdfContext, |
19 SkCanvas* canvas) | 19 SkCanvas* canvas) |
20 : INHERITED(tokenizer, pdfContext, canvas) {} | 20 : INHERITED(tokenizer, pdfContext, canvas) {} |
21 | 21 |
22 virtual SkPdfResult consumeToken(PdfToken& token) SK_OVERRIDE; | 22 SkPdfResult consumeToken(PdfToken& token) SK_OVERRIDE; |
23 virtual void loop() SK_OVERRIDE; | 23 void loop() SK_OVERRIDE; |
24 | 24 |
25 private: | 25 private: |
26 typedef SkPdfTokenLooper INHERITED; | 26 typedef SkPdfTokenLooper INHERITED; |
27 }; | 27 }; |
28 | 28 |
29 /////////////////////////////////////////////////////////////////////////////// | 29 /////////////////////////////////////////////////////////////////////////////// |
30 | 30 |
31 SkPdfContext::SkPdfContext(SkPdfNativeDoc* doc) | 31 SkPdfContext::SkPdfContext(SkPdfNativeDoc* doc) |
32 : fPdfDoc(doc) | 32 : fPdfDoc(doc) |
33 { | 33 { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 return kOK_SkPdfResult; | 118 return kOK_SkPdfResult; |
119 } | 119 } |
120 | 120 |
121 void PdfMainLooper::loop() { | 121 void PdfMainLooper::loop() { |
122 PdfToken token; | 122 PdfToken token; |
123 while (fTokenizer->readToken(&token, true)) { | 123 while (fTokenizer->readToken(&token, true)) { |
124 this->consumeToken(token); | 124 this->consumeToken(token); |
125 } | 125 } |
126 } | 126 } |
OLD | NEW |