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

Side by Side Diff: experimental/PdfViewer/SkPdfRenderer.h

Issue 18093005: pdfviewer: some code cleanup in renderer (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | experimental/PdfViewer/SkPdfRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 SkPdfRenderer_DEFINED
10 #define SkPdfParser_DEFINED 10 #define SkPdfRenderer_DEFINED
11
12 #include "SkPdfBasics.h"
13 #include "SkPdfNativeTokenizer.h"
14
15 extern "C" PdfContext* gPdfContext;
16 extern "C" SkBitmap* gDumpBitmap;
17 extern "C" SkCanvas* gDumpCanvas;
18 11
19 class SkCanvas; 12 class SkCanvas;
20 class SkNativeParsedPDF; 13 class SkNativeParsedPDF;
21 14
22 // TODO(edisonn): move in another file 15 // TODO(edisonn): move in another file
23 class SkPdfRenderer : public SkRefCnt { 16 class SkPdfRenderer : public SkRefCnt {
24 SkNativeParsedPDF* fPdfDoc; 17 SkNativeParsedPDF* fPdfDoc;
25 public: 18 public:
26 SkPdfRenderer() : fPdfDoc(NULL) {} 19 SkPdfRenderer() : fPdfDoc(NULL) {}
27 virtual ~SkPdfRenderer() {unload();} 20 virtual ~SkPdfRenderer() {unload();}
28 21
29 // TODO(edisonn): add options to render forms, or not 22 // TODO(edisonn): add options to render forms, or not
30 bool renderPage(int page, SkCanvas* canvas) const; 23 bool renderPage(int page, SkCanvas* canvas) const;
31 24
32 bool load(const SkString inputFileName); 25 bool load(const SkString inputFileName);
33 bool loaded() const {return fPdfDoc != NULL;} 26 bool loaded() const {return fPdfDoc != NULL;}
34 int pages() const; 27 int pages() const;
35 void unload(); 28 void unload();
36 SkRect MediaBox(int page) const; 29 SkRect MediaBox(int page) const;
37 size_t bytesUsed() const; 30 size_t bytesUsed() const;
38 }; 31 };
39 32
40 void reportPdfRenderStats(); 33 void reportPdfRenderStats();
41 34
42 #endif // SkPdfParser_DEFINED 35 #endif // SkPdfRenderer_DEFINED
OLDNEW
« no previous file with comments | « no previous file | experimental/PdfViewer/SkPdfRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698