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

Unified Diff: samplecode/SamplePdfFileViewer.cpp

Issue 18507004: sample app: fix break in pdf viewer (podofo was replaced by native parser) (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/SampleApp.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SamplePdfFileViewer.cpp
===================================================================
--- samplecode/SamplePdfFileViewer.cpp (revision 10004)
+++ samplecode/SamplePdfFileViewer.cpp (working copy)
@@ -29,7 +29,7 @@
#include "SkTypeface.h"
#include "SkXfermode.h"
-#include "SkPodofoParsedPDF.h"
+#include "SkPdfRenderer.h"
class PdfFileViewer : public SampleView {
private:
@@ -39,11 +39,14 @@
static SkPicture* LoadPdf(const char path[]) {
SkPicture* pic = NULL;
- SkPodofoParsedPDF doc(path);
- if (doc.pages()) {
+ SkPdfRenderer renderer;
+ SkString skpath;
+ skpath.append(path);
+ renderer.load(skpath);
+ if (renderer.loaded()) {
pic = SkNEW(SkPicture);
- SkCanvas* canvas = pic->beginRecording((int)doc.width(0), (int)doc.height(0));
- doc.drawPage(0, canvas);
+ SkCanvas* canvas = pic->beginRecording((int)renderer.MediaBox(0).width(), (int)renderer.MediaBox(0).height());
+ renderer.renderPage(0, canvas);
pic->endRecording();
}
return pic;
« no previous file with comments | « gyp/SampleApp.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698