aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/gm_expectations.h
diff options
context:
space:
mode:
authorGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-08 19:14:23 +0000
committerGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-08 19:14:23 +0000
commit6843bdb7061364c100990e7e0feb3757fca08bb0 (patch)
treebd6a8529059cdfe4d8e7b26c5dfdd0cd1bcf337c /gm/gm_expectations.h
parent94b366a3e8ed7f03b4417f45999572399e6e591c (diff)
Write/compare against expectations in skimage tool.
skimage: Add two new modes: one to write expectations to a json file, and another to compare results against expectations. Use SkPATH_SEPARATOR instead of '/'. gm_expectations: Split into a static library so it can be used by skimage. Make functions non static and move function definitions into source file. Capitalize static member functions to follow the coding style guidelines. BUG=https://code.google.com/p/skia/issues/detail?id=1241 R=epoger@google.com Review URL: https://codereview.chromium.org/14670021 git-svn-id: http://skia.googlecode.com/svn/trunk@9069 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/gm_expectations.h')
-rw-r--r--gm/gm_expectations.h36
1 files changed, 11 insertions, 25 deletions
diff --git a/gm/gm_expectations.h b/gm/gm_expectations.h
index 2506a98127..0af18c1570 100644
--- a/gm/gm_expectations.h
+++ b/gm/gm_expectations.h
@@ -39,26 +39,12 @@ namespace skiagm {
return jsonValue.asUInt64();
}
- static void gm_fprintf(FILE *stream, const char format[], ...) {
- va_list args;
- va_start(args, format);
- fprintf(stream, "GM: ");
- vfprintf(stream, format, args);
- va_end(args);
- }
+ void gm_fprintf(FILE *stream, const char format[], ...);
- static SkString make_filename(const char path[],
- const char renderModeDescriptor[],
- const char *name,
- const char suffix[]) {
- SkString filename(path);
- if (filename.endsWith(SkPATH_SEPARATOR)) {
- filename.remove(filename.size() - 1, 1);
- }
- filename.appendf("%c%s%s.%s", SkPATH_SEPARATOR,
- name, renderModeDescriptor, suffix);
- return filename;
- }
+ SkString make_filename(const char path[],
+ const char renderModeDescriptor[],
+ const char *name,
+ const char suffix[]);
Json::Value ActualResultAsJsonValue(const SkHashDigest& result);
@@ -208,15 +194,15 @@ namespace skiagm {
*/
// TODO(epoger): Move this, into SkStream.[cpp|h] as attempted in
// https://codereview.appspot.com/7300071 ?
- // And maybe readFileIntoSkData() also?
- static SkData* readIntoSkData(SkStream &stream, size_t maxBytes);
+ // And maybe ReadFileIntoSkData() also?
+ static SkData* ReadIntoSkData(SkStream &stream, size_t maxBytes);
/**
- * Wrapper around readIntoSkData for files: reads the entire file into
+ * Wrapper around ReadIntoSkData for files: reads the entire file into
* an SkData object.
*/
- static SkData* readFileIntoSkData(SkFILEStream &stream) {
- return readIntoSkData(stream, stream.getLength());
+ static SkData* ReadFileIntoSkData(SkFILEStream &stream) {
+ return ReadIntoSkData(stream, stream.getLength());
}
/**
@@ -224,7 +210,7 @@ namespace skiagm {
*
* Returns true if successful.
*/
- static bool parse(const char *jsonPath, Json::Value *jsonRoot);
+ static bool Parse(const char *jsonPath, Json::Value *jsonRoot);
Json::Value fJsonRoot;
Json::Value fJsonExpectedResults;