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

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

Issue 12699002: Upstream changes from Android. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: more fiex 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/effects/SkMagnifierImageFilter.cpp ('k') | tests/MatrixTest.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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 #ifndef SK_GAMMA_APPLY_TO_A8 687 #ifndef SK_GAMMA_APPLY_TO_A8
688 if (!isLCD(*rec)) { 688 if (!isLCD(*rec)) {
689 rec->ignorePreBlend(); 689 rec->ignorePreBlend();
690 } 690 }
691 #endif 691 #endif
692 } 692 }
693 693
694 #ifdef SK_BUILD_FOR_ANDROID 694 #ifdef SK_BUILD_FOR_ANDROID
695 uint32_t SkFontHost::GetUnitsPerEm(SkFontID fontID) { 695 uint32_t SkFontHost::GetUnitsPerEm(SkFontID fontID) {
696 SkAutoMutexAcquire ac(gFTMutex); 696 SkAutoMutexAcquire ac(gFTMutex);
697 FT_Library libInit = NULL;
698 if (gFTCount == 0) {
699 if (!InitFreetype())
700 sk_throw();
701 libInit = gFTLibrary;
702 }
703 SkAutoTCallIProc<struct FT_LibraryRec_, FT_Done_FreeType> ftLib(libInit);
697 SkFaceRec *rec = ref_ft_face(fontID); 704 SkFaceRec *rec = ref_ft_face(fontID);
698 uint16_t unitsPerEm = 0; 705 uint16_t unitsPerEm = 0;
699 706
700 if (rec != NULL && rec->fFace != NULL) { 707 if (rec != NULL && rec->fFace != NULL) {
701 unitsPerEm = rec->fFace->units_per_EM; 708 unitsPerEm = rec->fFace->units_per_EM;
702 unref_ft_face(rec->fFace); 709 unref_ft_face(rec->fFace);
703 } 710 }
704 711
705 return (uint32_t)unitsPerEm; 712 return (uint32_t)unitsPerEm;
706 } 713 }
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1359 *style = (SkTypeface::Style) tempStyle; 1366 *style = (SkTypeface::Style) tempStyle;
1360 } 1367 }
1361 if (isFixedWidth) { 1368 if (isFixedWidth) {
1362 *isFixedWidth = FT_IS_FIXED_WIDTH(face); 1369 *isFixedWidth = FT_IS_FIXED_WIDTH(face);
1363 } 1370 }
1364 1371
1365 FT_Done_Face(face); 1372 FT_Done_Face(face);
1366 FT_Done_FreeType(library); 1373 FT_Done_FreeType(library);
1367 return true; 1374 return true;
1368 } 1375 }
OLDNEW
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | tests/MatrixTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698