Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(440)

Unified Diff: tools/render_pictures_main.cpp

Issue 6392066: Added pipe as a rendering option for render_pictures. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 12 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/tools.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/render_pictures_main.cpp
diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp
index 70be7edb78e7c89fe9f73238d2c253dbae59fcbe..5356cb631aa91e8f5b19d1133d3d24e8481536bc 100644
--- a/tools/render_pictures_main.cpp
+++ b/tools/render_pictures_main.cpp
@@ -7,8 +7,10 @@
#include "SkBitmap.h"
+#include "SamplePipeControllers.h"
#include "SkCanvas.h"
#include "SkColorPriv.h"
+#include "SkGPipe.h"
#include "SkImageEncoder.h"
#include "SkOSFile.h"
#include "SkPicture.h"
@@ -76,6 +78,22 @@ static void write_output(const SkString& outputDir, const SkString& inputFilenam
}
}
+static void pipe_run(SkPicture* picture, SkCanvas* canvas) {
+ PipeController pipeController(canvas);
+ SkGPipeWriter writer;
+ SkCanvas* pipeCanvas = writer.startRecording(&pipeController);
+ pipeCanvas->drawPicture(*picture);
+ writer.endRecording();
+}
+
+static void pipe_render(SkPicture* picture, SkBitmap* bitmap) {
+ sk_tools::setup_bitmap(bitmap, picture->width(), picture->height());
+
+ SkCanvas canvas(*bitmap);
+
+ pipe_run(picture, &canvas);
+}
+
static void render_picture(const SkString& inputPath, const SkString& outputDir,
RenderFunc renderFunc) {
SkString inputFilename;
@@ -117,7 +135,11 @@ static void parse_commandline(int argc, char* const argv[], SkTArray<SkString>*
char* const* stop = argv + argc;
for (++argv; argv < stop; ++argv) {
- inputs->push_back(SkString(*argv));
+ if (0 == strcmp(*argv, "--pipe")) {
+ *renderFunc = pipe_render;
+ } else {
+ inputs->push_back(SkString(*argv));
+ }
}
}
« no previous file with comments | « gyp/tools.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b