Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
| 9 #include "sk_tool_utils_flags.h" | 9 #include "sk_tool_utils_flags.h" |
| 10 | 10 |
| 11 #include "SkBitmap.h" | 11 #include "SkBitmap.h" |
| 12 #include "SkCanvas.h" | 12 #include "SkCanvas.h" |
| 13 #include "SkCommonFlags.h" | |
| 13 #include "SkShader.h" | 14 #include "SkShader.h" |
| 14 #include "SkTestScalerContext.h" | 15 #include "SkTestScalerContext.h" |
| 15 #include "SkTextBlob.h" | 16 #include "SkTextBlob.h" |
| 16 | 17 |
| 18 extern bool internal_tool_utils_win_gdi(); | |
|
bungeman-skia
2015/07/20 20:15:11
Not using this anymore?
caryclark
2015/07/20 20:28:12
Good catch. (Removed)
| |
| 19 | |
| 17 DEFINE_bool(portableFonts, false, "Use portable fonts"); | 20 DEFINE_bool(portableFonts, false, "Use portable fonts"); |
| 18 DEFINE_bool(resourceFonts, false, "Use resource fonts"); | 21 DEFINE_bool(resourceFonts, false, "Use resource fonts"); |
| 19 | 22 |
| 20 namespace sk_tool_utils { | 23 namespace sk_tool_utils { |
| 21 | 24 |
| 25 const char* platform_os_name() { | |
| 26 for (int index = 0; index < FLAGS_key.count(); index += 2) { | |
| 27 if (!strcmp("os", FLAGS_key[index])) { | |
| 28 return FLAGS_key[index + 1]; | |
| 29 } | |
| 30 } | |
| 31 // when running SampleApp or dm without a --key pair, omit the platform name | |
| 32 return ""; | |
| 33 } | |
| 34 | |
| 35 const char* platform_extra_config(const char* config) { | |
| 36 for (int index = 0; index < FLAGS_key.count(); index += 2) { | |
| 37 if (!strcmp("extra_config", FLAGS_key[index]) && !strcmp(config, FLAGS_k ey[index + 1])) { | |
| 38 return config; | |
| 39 } | |
| 40 } | |
| 41 return ""; | |
| 42 } | |
| 43 | |
| 22 const char* colortype_name(SkColorType ct) { | 44 const char* colortype_name(SkColorType ct) { |
| 23 switch (ct) { | 45 switch (ct) { |
| 24 case kUnknown_SkColorType: return "Unknown"; | 46 case kUnknown_SkColorType: return "Unknown"; |
| 25 case kAlpha_8_SkColorType: return "Alpha_8"; | 47 case kAlpha_8_SkColorType: return "Alpha_8"; |
| 26 case kIndex_8_SkColorType: return "Index_8"; | 48 case kIndex_8_SkColorType: return "Index_8"; |
| 27 case kARGB_4444_SkColorType: return "ARGB_4444"; | 49 case kARGB_4444_SkColorType: return "ARGB_4444"; |
| 28 case kRGB_565_SkColorType: return "RGB_565"; | 50 case kRGB_565_SkColorType: return "RGB_565"; |
| 29 case kRGBA_8888_SkColorType: return "RGBA_8888"; | 51 case kRGBA_8888_SkColorType: return "RGBA_8888"; |
| 30 case kBGRA_8888_SkColorType: return "BGRA_8888"; | 52 case kBGRA_8888_SkColorType: return "BGRA_8888"; |
| 31 default: | 53 default: |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 paint.textToGlyphs(text, len, glyphs.begin()); | 125 paint.textToGlyphs(text, len, glyphs.begin()); |
| 104 | 126 |
| 105 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); | 127 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); |
| 106 const SkTextBlobBuilder::RunBuffer& run = builder->allocRun(paint, glyphs.co unt(), x, y, | 128 const SkTextBlobBuilder::RunBuffer& run = builder->allocRun(paint, glyphs.co unt(), x, y, |
| 107 NULL); | 129 NULL); |
| 108 memcpy(run.glyphs, glyphs.begin(), glyphs.count() * sizeof(uint16_t)); | 130 memcpy(run.glyphs, glyphs.begin(), glyphs.count() * sizeof(uint16_t)); |
| 109 } | 131 } |
| 110 | 132 |
| 111 | 133 |
| 112 } // namespace sk_tool_utils | 134 } // namespace sk_tool_utils |
| OLD | NEW |