OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 "SkAdvancedTypefaceMetrics.h" | 8 #include "SkAdvancedTypefaceMetrics.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 } | 690 } |
691 | 691 |
692 void SkTypeface_FreeType::onFilterRec(SkScalerContextRec* rec) const { | 692 void SkTypeface_FreeType::onFilterRec(SkScalerContextRec* rec) const { |
693 //BOGUS: http://code.google.com/p/chromium/issues/detail?id=121119 | 693 //BOGUS: http://code.google.com/p/chromium/issues/detail?id=121119 |
694 //Cap the requested size as larger sizes give bogus values. | 694 //Cap the requested size as larger sizes give bogus values. |
695 //Remove when http://code.google.com/p/skia/issues/detail?id=554 is fixed. | 695 //Remove when http://code.google.com/p/skia/issues/detail?id=554 is fixed. |
696 if (rec->fTextSize > SkIntToScalar(1 << 14)) { | 696 if (rec->fTextSize > SkIntToScalar(1 << 14)) { |
697 rec->fTextSize = SkIntToScalar(1 << 14); | 697 rec->fTextSize = SkIntToScalar(1 << 14); |
698 } | 698 } |
699 | 699 |
700 { | 700 if (isLCD(*rec)) { |
701 // TODO: re-work so that FreeType is set-up and selected by the SkFontMg
r. | 701 // TODO: re-work so that FreeType is set-up and selected by the SkFontMg
r. |
702 SkAutoMutexAcquire ama(gFTMutex); | 702 SkAutoMutexAcquire ama(gFTMutex); |
703 ref_ft_library(); | 703 ref_ft_library(); |
704 if (!gFTLibrary->isLCDSupported() && isLCD(*rec)) { | 704 if (!gFTLibrary->isLCDSupported()) { |
705 // If the runtime Freetype library doesn't support LCD, disable it h
ere. | 705 // If the runtime Freetype library doesn't support LCD, disable it h
ere. |
706 rec->fMaskFormat = SkMask::kA8_Format; | 706 rec->fMaskFormat = SkMask::kA8_Format; |
707 } | 707 } |
708 unref_ft_library(); | 708 unref_ft_library(); |
709 } | 709 } |
710 | 710 |
711 SkPaint::Hinting h = rec->getHinting(); | 711 SkPaint::Hinting h = rec->getHinting(); |
712 if (SkPaint::kFull_Hinting == h && !isLCD(*rec)) { | 712 if (SkPaint::kFull_Hinting == h && !isLCD(*rec)) { |
713 // collapse full->normal hinting if we're not doing LCD | 713 // collapse full->normal hinting if we're not doing LCD |
714 h = SkPaint::kNormal_Hinting; | 714 h = SkPaint::kNormal_Hinting; |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1721 if (style) { | 1721 if (style) { |
1722 *style = SkFontStyle(weight, width, slant); | 1722 *style = SkFontStyle(weight, width, slant); |
1723 } | 1723 } |
1724 if (isFixedPitch) { | 1724 if (isFixedPitch) { |
1725 *isFixedPitch = FT_IS_FIXED_WIDTH(face); | 1725 *isFixedPitch = FT_IS_FIXED_WIDTH(face); |
1726 } | 1726 } |
1727 | 1727 |
1728 FT_Done_Face(face); | 1728 FT_Done_Face(face); |
1729 return true; | 1729 return true; |
1730 } | 1730 } |
OLD | NEW |