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

Side by Side Diff: src/utils/SkWhitelistTypefaces.cpp

Issue 1467533003: Eliminate SkFILE - it always is the same as FILE. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-11-20 (Friday) 14:01:26 EST Created 5 years, 1 month 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/utils/SkRTConf.cpp ('k') | tests/DataRefTest.cpp » ('j') | 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 2015 Google Inc. 2 * Copyright 2015 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 "SkChecksum.h" 8 #include "SkChecksum.h"
9 #include "SkFontDescriptor.h" 9 #include "SkFontDescriptor.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 const char checksumTrailer[] = 241 const char checksumTrailer[] =
242 "};" "\n" 242 "};" "\n"
243 "" "\n" 243 "" "\n"
244 "static const int whitelistCount = (int) SK_ARRAY_COUNT(whitelist);" "\n" ; 244 "static const int whitelistCount = (int) SK_ARRAY_COUNT(whitelist);" "\n" ;
245 245
246 246
247 #include "SkOSFile.h" 247 #include "SkOSFile.h"
248 248
249 bool GenerateChecksums() { 249 bool GenerateChecksums() {
250 SkFILE* file = sk_fopen(checksumFileName, kWrite_SkFILE_Flag); 250 FILE* file = sk_fopen(checksumFileName, kWrite_SkFILE_Flag);
251 if (!file) { 251 if (!file) {
252 SkDebugf("Can't open %s for writing.\n", checksumFileName); 252 SkDebugf("Can't open %s for writing.\n", checksumFileName);
253 return false; 253 return false;
254 } 254 }
255 SkString line; 255 SkString line;
256 line.printf(checksumHeader, __FUNCTION__, __FILE__, checksumFileName); 256 line.printf(checksumHeader, __FUNCTION__, __FILE__, checksumFileName);
257 sk_fwrite(line.c_str(), line.size(), file); 257 sk_fwrite(line.c_str(), line.size(), file);
258 for (int i = 0; i < whitelistCount; ++i) { 258 for (int i = 0; i < whitelistCount; ++i) {
259 const char* fontName = whitelist[i].fFontName; 259 const char* fontName = whitelist[i].fFontName;
260 SkTypeface* tf = SkTypeface::CreateFromName(fontName, SkTypeface::kNorma l); 260 SkTypeface* tf = SkTypeface::CreateFromName(fontName, SkTypeface::kNorma l);
261 uint32_t checksum = compute_checksum(tf); 261 uint32_t checksum = compute_checksum(tf);
262 line.printf(checksumEntry, fontName, checksum); 262 line.printf(checksumEntry, fontName, checksum);
263 sk_fwrite(line.c_str(), line.size(), file); 263 sk_fwrite(line.c_str(), line.size(), file);
264 } 264 }
265 sk_fwrite(checksumTrailer, sizeof(checksumTrailer) - 1, file); 265 sk_fwrite(checksumTrailer, sizeof(checksumTrailer) - 1, file);
266 sk_fclose(file); 266 sk_fclose(file);
267 return true; 267 return true;
268 } 268 }
OLDNEW
« no previous file with comments | « src/utils/SkRTConf.cpp ('k') | tests/DataRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698