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

Side by Side Diff: src/ports/SkFontHost_FreeType.cpp

Issue 12834012: Update code to use helper function for better readability/searching. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/images/SkImageDecoder_libico.cpp ('k') | src/ports/SkXMLParser_expat.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 1326
1327 const void* memoryBase = stream->getMemoryBase(); 1327 const void* memoryBase = stream->getMemoryBase();
1328 FT_StreamRec streamRec; 1328 FT_StreamRec streamRec;
1329 1329
1330 if (NULL != memoryBase) { 1330 if (NULL != memoryBase) {
1331 args.flags = FT_OPEN_MEMORY; 1331 args.flags = FT_OPEN_MEMORY;
1332 args.memory_base = (const FT_Byte*)memoryBase; 1332 args.memory_base = (const FT_Byte*)memoryBase;
1333 args.memory_size = stream->getLength(); 1333 args.memory_size = stream->getLength();
1334 } else { 1334 } else {
1335 memset(&streamRec, 0, sizeof(streamRec)); 1335 memset(&streamRec, 0, sizeof(streamRec));
1336 streamRec.size = stream->read(NULL, 0); 1336 streamRec.size = stream->getLength();
1337 streamRec.descriptor.pointer = stream; 1337 streamRec.descriptor.pointer = stream;
1338 streamRec.read = sk_stream_read; 1338 streamRec.read = sk_stream_read;
1339 streamRec.close = sk_stream_close; 1339 streamRec.close = sk_stream_close;
1340 1340
1341 args.flags = FT_OPEN_STREAM; 1341 args.flags = FT_OPEN_STREAM;
1342 args.stream = &streamRec; 1342 args.stream = &streamRec;
1343 } 1343 }
1344 1344
1345 FT_Face face; 1345 FT_Face face;
1346 if (FT_Open_Face(library, &args, 0, &face)) { 1346 if (FT_Open_Face(library, &args, 0, &face)) {
(...skipping 16 matching lines...) Expand all
1363 *style = (SkTypeface::Style) tempStyle; 1363 *style = (SkTypeface::Style) tempStyle;
1364 } 1364 }
1365 if (isFixedWidth) { 1365 if (isFixedWidth) {
1366 *isFixedWidth = FT_IS_FIXED_WIDTH(face); 1366 *isFixedWidth = FT_IS_FIXED_WIDTH(face);
1367 } 1367 }
1368 1368
1369 FT_Done_Face(face); 1369 FT_Done_Face(face);
1370 FT_Done_FreeType(library); 1370 FT_Done_FreeType(library);
1371 return true; 1371 return true;
1372 } 1372 }
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder_libico.cpp ('k') | src/ports/SkXMLParser_expat.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698