aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/sk_tool_utils.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-07-20 13:38:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-20 13:38:56 -0700
commit6531c3619f08cc83aad34883c5f00f6a358c9fad (patch)
tree5dd35fd7ef486272a17c424bdb4702279d264631 /tools/sk_tool_utils.cpp
parent973ae86a824c6c1ece428d6777d0bce648f3f20c (diff)
Generate platform specific fontmgr gm.
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
Diffstat (limited to 'tools/sk_tool_utils.cpp')
-rw-r--r--tools/sk_tool_utils.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp
index 4d0e0bde68..b06fcda3a6 100644
--- a/tools/sk_tool_utils.cpp
+++ b/tools/sk_tool_utils.cpp
@@ -10,6 +10,7 @@
#include "SkBitmap.h"
#include "SkCanvas.h"
+#include "SkCommonFlags.h"
#include "SkShader.h"
#include "SkTestScalerContext.h"
#include "SkTextBlob.h"
@@ -19,6 +20,25 @@ DEFINE_bool(resourceFonts, false, "Use resource fonts");
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";