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

Unified Diff: experimental/PdfViewer/SkPdfRenderer.h

Issue 26912005: mode code cleanup (100c / l, comments) (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/PdfViewer/SkPdfGraphicsState.cpp ('k') | experimental/PdfViewer/SkPdfRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/PdfViewer/SkPdfRenderer.h
===================================================================
--- experimental/PdfViewer/SkPdfRenderer.h (revision 11625)
+++ experimental/PdfViewer/SkPdfRenderer.h (working copy)
@@ -9,9 +9,7 @@
#ifndef SkPdfRenderer_DEFINED
#define SkPdfRenderer_DEFINED
-// TODO(edisonn): how to remove this dependency? Should I remove the ref counting?
-#include "SkRefCnt.h"
-// TODO(edisonn): remove this dependency
+// TODO(edisonn): remove this dependency, and load only from a stream!
#include "SkString.h"
class SkBitmap;
@@ -26,22 +24,36 @@
kAll_SkPdfContent,
};
-// TODO(edisonn): move in another file
-class SkPdfRenderer : public SkRefCnt {
+// TODO(edisonn): add options to render forms, checkboxes, ...
+// TODO(edisonn): Add API for Forms viewing and editing
+// e.g. SkBitmap getPage(int page);
+// int formsCount();
+// SkForm getForm(int formID); // SkForm(SkRect, .. other data)
+// TODO (edisonn): Add intend when loading pdf, for example: for viewing, for parsing content, ...
+
+class SkPdfRenderer {
SkPdfNativeDoc* fPdfDoc;
public:
SkPdfRenderer() : fPdfDoc(NULL) {}
virtual ~SkPdfRenderer() {unload();}
- // TODO(edisonn): add options to render forms, or not
bool renderPage(int page, SkCanvas* canvas, const SkRect& dst) const;
+ // TODO(edisonn): deprecated, should be removed!
bool load(const SkString inputFileName);
+
bool load(SkStream* stream);
+
+ void unload();
+
bool loaded() const {return fPdfDoc != NULL;}
+
int pages() const;
- void unload();
+
SkRect MediaBox(int page) const;
+
+ // TODO(edisonn): for testing only, probably it should be removed, unless some client wants to
+ // let users know how much memory the PDF needs.
size_t bytesUsed() const;
};
« no previous file with comments | « experimental/PdfViewer/SkPdfGraphicsState.cpp ('k') | experimental/PdfViewer/SkPdfRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698