Add a simple tool for isolating a path from an SKP
BUG=skia:
Change-Id: I5ca9bbd43919e3f65ea940847c68f85cc78dfeda
Reviewed-on: https://skia-review.googlesource.com/10130
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 6b9a888..bd7d567 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -91,6 +91,17 @@
}
};
+extern SampleView* CreateSamplePathFinderView(const char filename[]);
+
+class PathFinderFactory : public SkViewFactory {
+ SkString fFilename;
+public:
+ PathFinderFactory(const SkString& filename) : fFilename(filename) {}
+ SkView* operator() () const override {
+ return CreateSamplePathFinderView(fFilename.c_str());
+ }
+};
+
extern SampleView* CreateSampleSVGFileView(const SkString& filename);
class SVGFileFactory : public SkViewFactory {
@@ -726,6 +737,7 @@
DEFINE_string(slide, "", "Start on this sample.");
DEFINE_string(pictureDir, "", "Read pictures from here.");
DEFINE_string(picture, "", "Path to single picture.");
+DEFINE_string(pathfinder, "", "SKP file with a single path to isolate.");
DEFINE_string(svg, "", "Path to single SVG file.");
DEFINE_string(svgDir, "", "Read SVGs from here.");
DEFINE_string(sequence, "", "Path to file containing the desired samples/gms to show.");
@@ -765,6 +777,11 @@
fCurrIndex = fSamples.count();
*fSamples.append() = new PictFileFactory(path);
}
+ if (!FLAGS_pathfinder.isEmpty()) {
+ SkString path(FLAGS_pathfinder[0]);
+ fCurrIndex = fSamples.count();
+ *fSamples.append() = new PathFinderFactory(path);
+ }
if (!FLAGS_svg.isEmpty()) {
SkString path(FLAGS_svg[0]);
fCurrIndex = fSamples.count();