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

Unified Diff: dm/DM.cpp

Issue 2209593004: Add an SVG DM source (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: GN fix Created 4 years, 4 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 | « BUILD.gn ('k') | dm/DMSrcSink.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 4387fde1e179ccf54364cae13638c595953f711f..fcc3c552eac3442efc7482857f397a1f51bed943 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -73,6 +73,8 @@ DEFINE_int32(shard, 0, "Which shard do I run?");
DEFINE_string(mskps, "", "Directory to read mskps from, or a single mskp file.");
+DEFINE_string(svgs, "", "Directory to read SVGs from, or a single SVG file.");
+
using namespace DM;
using sk_gpu_test::GrContextFactory;
using sk_gpu_test::GLTestContext;
@@ -710,35 +712,32 @@ static bool brd_supported(const char* ext) {
return false;
}
-static bool gather_srcs() {
- for (const skiagm::GMRegistry* r = skiagm::GMRegistry::Head(); r; r = r->next()) {
- push_src("gm", "", new GMSrc(r->factory()));
- }
- for (int i = 0; i < FLAGS_skps.count(); i++) {
- const char* path = FLAGS_skps[i];
+template <typename T>
+void gather_file_srcs(const SkCommandLineFlags::StringArray& flags, const char* ext) {
+ for (int i = 0; i < flags.count(); i++) {
+ const char* path = flags[i];
if (sk_isdir(path)) {
- SkOSFile::Iter it(path, "skp");
+ SkOSFile::Iter it(path, ext);
for (SkString file; it.next(&file); ) {
- push_src("skp", "", new SKPSrc(SkOSPath::Join(path, file.c_str())));
+ push_src(ext, "", new T(SkOSPath::Join(path, file.c_str())));
}
} else {
- push_src("skp", "", new SKPSrc(path));
+ push_src(ext, "", new T(path));
}
}
+}
- for (int i = 0; i < FLAGS_mskps.count(); i++) {
- const char* path = FLAGS_mskps[i];
- if (sk_isdir(path)) {
- SkOSFile::Iter it(path, "mskp");
- for (SkString file; it.next(&file);) {
- push_src("mskp", "",
- new MSKPSrc(SkOSPath::Join(path, file.c_str())));
- }
- } else {
- push_src("mskp", "", new MSKPSrc(path));
- }
+static bool gather_srcs() {
+ for (const skiagm::GMRegistry* r = skiagm::GMRegistry::Head(); r; r = r->next()) {
+ push_src("gm", "", new GMSrc(r->factory()));
}
+ gather_file_srcs<SKPSrc>(FLAGS_skps, "skp");
+ gather_file_srcs<MSKPSrc>(FLAGS_mskps, "mskp");
+#if defined(SK_XML)
+ gather_file_srcs<SVGSrc>(FLAGS_svgs, "svg");
+#endif
+
SkTArray<SkString> images;
if (!CollectImages(FLAGS_images, &images)) {
return false;
« no previous file with comments | « BUILD.gn ('k') | dm/DMSrcSink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698