aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-16 18:11:51 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-16 18:11:51 +0000
commit120c99993e60e7aedb0838f09d6f1b1d2f576c78 (patch)
tree9b9df3631f8f0e76fb9ece63d4462ff3fc76c797 /dm
parent25c1066e4d23cf7cb1795c78987f4fde08282b46 (diff)
Generate Android.mk for DM.
ifdef out code that won't build where we don't have jsoncpp. Include ctype instead of string.h for tolower. Depends on https://codereview.chromium.org/282053002/ BUG=skia:2447 R=mtklein@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/290603002 git-svn-id: http://skia.googlecode.com/svn/trunk@14768 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'dm')
-rw-r--r--dm/DM.cpp9
-rw-r--r--dm/DMExpectations.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/dm/DM.cpp b/dm/DM.cpp
index f4eefa685c..8df0ab101f 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -21,7 +21,7 @@
#include "DMTestTask.h"
#include "DMWriteTask.h"
-#include <string.h>
+#include <ctype.h>
using skiagm::GM;
using skiagm::GMRegistry;
@@ -32,7 +32,10 @@ DEFINE_int32(threads, -1, "Threads for CPU work. Default NUM_CPUS.");
DEFINE_int32(gpuThreads, 1, "Threads for GPU work.");
DEFINE_string2(expectations, r, "",
"If a directory, compare generated images against images under this path. "
- "If a file, compare generated images against JSON expectations at this path.");
+#ifdef SK_BUILD_JSON_WRITER
+ "If a file, compare generated images against JSON expectations at this path."
+#endif
+);
DEFINE_string2(resources, i, "resources", "Path to resources directory.");
DEFINE_string(match, "", "[~][^]substring[$] [...] of GM name to run.\n"
"Multiple matches may be separated by spaces.\n"
@@ -225,7 +228,9 @@ int tool_main(int argc, char** argv) {
if (sk_isdir(path)) {
expectations.reset(SkNEW_ARGS(DM::WriteTask::Expectations, (path)));
} else {
+#ifdef SK_BUILD_JSON_WRITER
expectations.reset(SkNEW_ARGS(DM::JsonExpectations, (path)));
+#endif
}
}
}
diff --git a/dm/DMExpectations.h b/dm/DMExpectations.h
index 238d1c5bea..5509709104 100644
--- a/dm/DMExpectations.h
+++ b/dm/DMExpectations.h
@@ -19,6 +19,7 @@ public:
bool check(const Task&, SkBitmap) const SK_OVERRIDE { return true; }
};
+#ifdef SK_BUILD_JSON_WRITER
class JsonExpectations : public Expectations {
public:
explicit JsonExpectations(const char* path) : fGMExpectations(path) {}
@@ -40,6 +41,7 @@ public:
private:
skiagm::JsonExpectationsSource fGMExpectations;
};
+#endif
} // namespace DM