Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: tools/sk_tool_utils.cpp

Issue 1245643002: Generate platform specific fontmgr gm. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add key placeholder to enable SampleApp and VisualBench to link Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/sk_tool_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/sk_tool_utils.cpp
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp
index 4d0e0bde68fffcb756454a4a1bb89b044c7e859c..b06fcda3a6d8d360ee60d657cae32bc8021c6df0 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";
« no previous file with comments | « tools/sk_tool_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698