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

Side by Side Diff: tests/FontMgrAndroidParserTest.cpp

Issue 1726213004: Deduplicate axis value resolving code. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Convince gcc that the values are assigned before use. Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/ports/SkFontMgr_android_parser.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "Resources.h" 8 #include "Resources.h"
9 #include "SkCommandLineFlags.h" 9 #include "SkCommandLineFlags.h"
10 #include "SkFontMgr_android_parser.h" 10 #include "SkFontMgr_android_parser.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 SkDebugf(" basePath %s\n", fontFamilies[i]->fBasePath.c_str()); 82 SkDebugf(" basePath %s\n", fontFamilies[i]->fBasePath.c_str());
83 if (!fontFamilies[i]->fLanguage.getTag().isEmpty()) { 83 if (!fontFamilies[i]->fLanguage.getTag().isEmpty()) {
84 SkDebugf(" language %s\n", fontFamilies[i]->fLanguage.getTag().c_st r()); 84 SkDebugf(" language %s\n", fontFamilies[i]->fLanguage.getTag().c_st r());
85 } 85 }
86 for (int j = 0; j < fontFamilies[i]->fNames.count(); ++j) { 86 for (int j = 0; j < fontFamilies[i]->fNames.count(); ++j) {
87 SkDebugf(" name %s\n", fontFamilies[i]->fNames[j].c_str()); 87 SkDebugf(" name %s\n", fontFamilies[i]->fNames[j].c_str());
88 } 88 }
89 for (int j = 0; j < fontFamilies[i]->fFonts.count(); ++j) { 89 for (int j = 0; j < fontFamilies[i]->fFonts.count(); ++j) {
90 const FontFileInfo& ffi = fontFamilies[i]->fFonts[j]; 90 const FontFileInfo& ffi = fontFamilies[i]->fFonts[j];
91 SkDebugf(" file (%d) %s#%d\n", ffi.fWeight, ffi.fFileName.c_str(), ffi.fIndex); 91 SkDebugf(" file (%d) %s#%d", ffi.fWeight, ffi.fFileName.c_str(), ff i.fIndex);
92 for (const auto& axis : ffi.fAxes) {
93 SkDebugf(" @'%c%c%c%c'=%f",
94 (axis.fTag >> 24) & 0xFF,
95 (axis.fTag >> 16) & 0xFF,
96 (axis.fTag >> 8) & 0xFF,
97 (axis.fTag ) & 0xFF,
98 axis.fStyleValue);
99 }
100 SkDebugf("\n");
92 } 101 }
93 } 102 }
94 SkDebugf("\n\n"); 103 SkDebugf("\n\n");
95 } 104 }
96 105
97 template <int N, typename T> static double test_parse_fixed_r(skiatest::Reporter * reporter, 106 template <int N, typename T> static double test_parse_fixed_r(skiatest::Reporter * reporter,
98 double low, double high, double inc) 107 double low, double high, double inc)
99 { 108 {
100 double SK_FixedMax_double = nextafter(1 << (sizeof(T) * CHAR_BIT - N - 1), 0 .0); 109 double SK_FixedMax_double = nextafter(1 << (sizeof(T) * CHAR_BIT - N - 1), 0 .0);
101 double SK_FixedEpsilon_double = (1.0 / (1 << N)); 110 double SK_FixedEpsilon_double = (1.0 / (1 << N));
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } else { 207 } else {
199 resourcesMissing = true; 208 resourcesMissing = true;
200 } 209 }
201 v22FontFamilies.deleteAll(); 210 v22FontFamilies.deleteAll();
202 211
203 if (resourcesMissing) { 212 if (resourcesMissing) {
204 SkDebugf("---- Resource files missing for FontConfigParser test\n"); 213 SkDebugf("---- Resource files missing for FontConfigParser test\n");
205 } 214 }
206 } 215 }
207 216
OLDNEW
« no previous file with comments | « src/ports/SkFontMgr_android_parser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698