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

Unified Diff: experimental/PdfViewer/inc/SkPdfTokenLooper.h

Issue 79773002: Move PdfTokenLooper into its own file. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | « no previous file | experimental/PdfViewer/src/SkPdfRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/PdfViewer/inc/SkPdfTokenLooper.h
diff --git a/experimental/PdfViewer/inc/SkPdfTokenLooper.h b/experimental/PdfViewer/inc/SkPdfTokenLooper.h
new file mode 100644
index 0000000000000000000000000000000000000000..abbc53f7cc2a2ef51a67836aff87ee19bd4379a7
--- /dev/null
+++ b/experimental/PdfViewer/inc/SkPdfTokenLooper.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkPdfTokenLooper_DEFINED
+#define SkPdfTokenLooper_DEFINED
+
+class SkCanvas;
+class SkPdfNativeTokenizer;
+class SkPdfContext;
+
+class PdfTokenLooper {
+protected:
+ PdfTokenLooper* fParent;
+ SkPdfNativeTokenizer* fTokenizer;
+ SkPdfContext* fPdfContext;
+ SkCanvas* fCanvas;
+
+public:
+ PdfTokenLooper(PdfTokenLooper* parent,
+ SkPdfNativeTokenizer* tokenizer,
+ SkPdfContext* pdfContext,
+ SkCanvas* canvas)
+ : fParent(parent), fTokenizer(tokenizer), fPdfContext(pdfContext), fCanvas(canvas) {}
+
+ virtual ~PdfTokenLooper() {}
+
+ virtual SkPdfResult consumeToken(PdfToken& token) = 0;
+ virtual void loop() = 0;
+
+ void setUp(PdfTokenLooper* parent) {
+ fParent = parent;
+ fTokenizer = parent->fTokenizer;
+ fPdfContext = parent->fPdfContext;
+ fCanvas = parent->fCanvas;
+ }
+
+ SkPdfNativeTokenizer* tokenizer() { return fTokenizer; }
+};
+#endif // SkPdfTokenLooper_DEFINED
« no previous file with comments | « no previous file | experimental/PdfViewer/src/SkPdfRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698