The gm output on different font platforms is so different
that comparing images in Gold has little value. Separate the
images by appending platform information to the gm name to
group somewhat similar images together.
Note that this does not attempt to make sure that all images
generated by Gold are nearly pixel identical; it only reduces
the number of nonsensical comparisons.
R=bungeman@google.com
Review URL: https://codereview.chromium.org/
1245643002
} else {
fFM.reset(SkFontMgr::RefDefault());
}
+ fName.append(sk_tool_utils::platform_os_name());
+ fName.append(sk_tool_utils::platform_extra_config("GDI"));
}
protected:
protected:
SkString onShortName() override {
- return SkString("fontmgr_match");
+ SkString name("fontmgr_match");
+ name.append(sk_tool_utils::platform_os_name());
+ name.append(sk_tool_utils::platform_extra_config("GDI"));
+ return name;
}
SkISize onISize() override {
if (scale != 1 || skew != 0) {
fName.appendf("_%g_%g", scale, skew);
}
+ fName.append(sk_tool_utils::platform_os_name());
+ fName.append(sk_tool_utils::platform_extra_config("GDI"));
fFM.reset(SkFontMgr::RefDefault());
}
DEFINE_string(picture, "", "Path to single picture.");
DEFINE_bool(sort, false, "Sort samples by title.");
DEFINE_bool(list, false, "List samples?");
+DEFINE_string(key, "", ""); // dummy to enable gm tests that have platform-specific names
#ifdef SAMPLE_PDF_FILE_VIEWER
DEFINE_string(pdfPath, "", "Path to direcotry of pdf files.");
#endif
DEFINE_int32(msaa, 0, "Number of msaa samples.");
DEFINE_bool2(fullscreen, f, true, "Run fullscreen.");
DEFINE_bool2(verbose, v, false, "enable verbose output from the test driver.");
+DEFINE_string(key, "", ""); // dummy to enable gm tests that have platform-specific names
static SkString humanize(double ms) {
if (FLAGS_verbose) {
#include "SkBitmap.h"
#include "SkCanvas.h"
+#include "SkCommonFlags.h"
#include "SkShader.h"
#include "SkTestScalerContext.h"
#include "SkTextBlob.h"
namespace sk_tool_utils {
+const char* platform_os_name() {
+ for (int index = 0; index < FLAGS_key.count(); index += 2) {
+ if (!strcmp("os", FLAGS_key[index])) {
+ return FLAGS_key[index + 1];
+ }
+ }
+ // when running SampleApp or dm without a --key pair, omit the platform name
+ return "";
+}
+
+const char* platform_extra_config(const char* config) {
+ for (int index = 0; index < FLAGS_key.count(); index += 2) {
+ if (!strcmp("extra_config", FLAGS_key[index]) && !strcmp(config, FLAGS_key[index + 1])) {
+ return config;
+ }
+ }
+ return "";
+}
+
const char* colortype_name(SkColorType ct) {
switch (ct) {
case kUnknown_SkColorType: return "Unknown";
const char* colortype_name(SkColorType);
SkColor color_to_565(SkColor color);
+ const char* platform_os_name();
+ const char* platform_extra_config(const char* config);
/**
* Sets the paint to use a platform-independent text renderer if FLAGS_portableFonts is set.