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

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

Issue 864903002: Lcd request early check in SkFontHost_FreeType::onFilterRec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | 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 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698