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

Unified Diff: tools/render_pdfs_main.cpp

Issue 17113004: Replace SkPicture(SkStream) constructors with a factory. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove a change in behavior Created 7 years, 6 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 | « tools/pinspect.cpp ('k') | tools/render_pictures_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/render_pdfs_main.cpp
diff --git a/tools/render_pdfs_main.cpp b/tools/render_pdfs_main.cpp
index 1821548aa34bc901d5c8a13c11acca5322cfc949..f4435021c3b7c41690836999045cc5666170fdc4 100644
--- a/tools/render_pdfs_main.cpp
+++ b/tools/render_pdfs_main.cpp
@@ -9,7 +9,6 @@
#include "SkDevice.h"
#include "SkForceLinking.h"
#include "SkGraphics.h"
-#include "SkImageDecoder.h"
#include "SkImageEncoder.h"
#include "SkOSFile.h"
#include "SkPicture.h"
@@ -169,11 +168,9 @@ static bool render_pdf(const SkString& inputPath, const SkString& outputDir,
return false;
}
- bool success = false;
- SkAutoTUnref<SkPicture>
- picture(SkNEW_ARGS(SkPicture, (&inputStream, &success, &SkImageDecoder::DecodeMemory)));
+ SkAutoTUnref<SkPicture> picture(SkPicture::CreateFromStream(&inputStream));
- if (!success) {
+ if (NULL == picture.get()) {
SkDebugf("Could not read an SkPicture from %s\n", inputPath.c_str());
return false;
}
@@ -185,7 +182,7 @@ static bool render_pdf(const SkString& inputPath, const SkString& outputDir,
renderer.render();
- success = write_output(outputDir, inputFilename, renderer);
+ bool success = write_output(outputDir, inputFilename, renderer);
renderer.end();
return success;
« no previous file with comments | « tools/pinspect.cpp ('k') | tools/render_pictures_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698