blob: d0e33842025767bd1fb1fb60855a651f587dfaa2 [file] [log] [blame]
edisonn@google.com222382b2013-07-10 22:33:10 +00001/*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8
edisonn@google.com15b11182013-07-11 14:43:15 +00009#ifndef SkPdfRenderer_DEFINED
10#define SkPdfRenderer_DEFINED
edisonn@google.com222382b2013-07-10 22:33:10 +000011
12class SkCanvas;
13class SkNativeParsedPDF;
14
15// TODO(edisonn): move in another file
16class SkPdfRenderer : public SkRefCnt {
17 SkNativeParsedPDF* fPdfDoc;
18public:
19 SkPdfRenderer() : fPdfDoc(NULL) {}
20 virtual ~SkPdfRenderer() {unload();}
21
22 // TODO(edisonn): add options to render forms, or not
23 bool renderPage(int page, SkCanvas* canvas) const;
24
25 bool load(const SkString inputFileName);
26 bool loaded() const {return fPdfDoc != NULL;}
27 int pages() const;
28 void unload();
29 SkRect MediaBox(int page) const;
edisonn@google.com7b328fd2013-07-11 12:53:06 +000030 size_t bytesUsed() const;
edisonn@google.com222382b2013-07-10 22:33:10 +000031};
32
33void reportPdfRenderStats();
34
edisonn@google.com15b11182013-07-11 14:43:15 +000035#endif // SkPdfRenderer_DEFINED