Generate gm/Android.mk, minus JSON.
When running gyp_to_android.py, generate the makefile for gm.
For now, remove json functionality and do not depend on json. This
allows us to build and run until solving skbug.com/2448.
gm/gm_expectations.cpp:
gm/gm_expectations.h:
gm/gmmain.cpp:
Remove all json functionality when SK_BUILD_JSON_WRITER is not defined.
This flag is not defined when SK_BUILD_FOR_ANDROID is defined.
gyp/gm.gyp:
Depend on skia and cutils.
platform_tools/android/bin/gyp_to_android.py:
Generate gm/Android.mk.
platform_tools/android/gyp_gen/makefile_writer.py:
Build gm/Android.mk when building external/skia.
Depends on https://codereview.chromium.org/282053002/
BUG=skia:2447
BUG=skia:2448
R=epoger@google.com
Author: scroggo@google.com
Review URL: https://codereview.chromium.org/281303003
git-svn-id: http://skia.googlecode.com/svn/trunk@14767 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gm_expectations.cpp b/gm/gm_expectations.cpp
index 28493dd..d2d629e 100644
--- a/gm/gm_expectations.cpp
+++ b/gm/gm_expectations.cpp
@@ -31,6 +31,7 @@
namespace skiagm {
+#ifdef SK_BUILD_JSON_WRITER
Json::Value CreateJsonTree(Json::Value expectedResults,
Json::Value actualResultsFailed,
Json::Value actualResultsFailureIgnored,
@@ -46,7 +47,7 @@
root[kJsonKey_ExpectedResults] = expectedResults;
return root;
}
-
+#endif
// GmResultDigest class...
@@ -54,6 +55,7 @@
fIsValid = SkBitmapHasher::ComputeDigest(bitmap, &fHashDigest);
}
+#ifdef SK_BUILD_JSON_WRITER
GmResultDigest::GmResultDigest(const Json::Value &jsonTypeValuePair) {
fIsValid = false;
if (!jsonTypeValuePair.isArray()) {
@@ -78,6 +80,7 @@
}
}
}
+#endif
bool GmResultDigest::isValid() const {
return fIsValid;
@@ -89,6 +92,7 @@
return (this->fIsValid && other.fIsValid && (this->fHashDigest == other.fHashDigest));
}
+#ifdef SK_BUILD_JSON_WRITER
Json::Value GmResultDigest::asJsonTypeValuePair() const {
// TODO(epoger): The current implementation assumes that the
// result digest is always of type kJsonKey_Hashtype_Bitmap_64bitMD5
@@ -101,6 +105,7 @@
}
return jsonTypeValuePair;
}
+#endif
SkString GmResultDigest::getHashType() const {
// TODO(epoger): The current implementation assumes that the
@@ -135,6 +140,7 @@
fAllowedResultDigests.push_back(bitmapAndDigest.fDigest);
}
+#ifdef SK_BUILD_JSON_WRITER
Expectations::Expectations(Json::Value jsonElement) {
if (jsonElement.empty()) {
fIgnoreFailure = kDefaultIgnoreFailure;
@@ -167,6 +173,7 @@
}
}
}
+#endif
bool Expectations::match(GmResultDigest actualGmResultDigest) const {
for (int i=0; i < this->fAllowedResultDigests.count(); i++) {
@@ -178,6 +185,7 @@
return false;
}
+#ifdef SK_BUILD_JSON_WRITER
Json::Value Expectations::asJsonValue() const {
Json::Value allowedDigestArray;
if (!this->fAllowedResultDigests.empty()) {
@@ -191,7 +199,7 @@
jsonExpectations[kJsonKey_ExpectedResults_IgnoreFailure] = this->ignoreFailure();
return jsonExpectations;
}
-
+#endif
// IndividualImageExpectationsSource class...
@@ -211,6 +219,7 @@
}
+#ifdef SK_BUILD_JSON_WRITER
// JsonExpectationsSource class...
JsonExpectationsSource::JsonExpectationsSource(const char *jsonPath) {
@@ -240,5 +249,5 @@
}
return true;
}
-
+#endif
}