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

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

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium Created 7 years 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/ports/SkFontHost_mac.cpp ('k') | src/ports/SkFontHost_win_dw.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 "SkAdvancedTypefaceMetrics.h" 9 #include "SkAdvancedTypefaceMetrics.h"
10 #include "SkBase64.h" 10 #include "SkBase64.h"
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 } 1058 }
1059 1059
1060 //////////////////////////////////////////////////////////////////////////////// //////// 1060 //////////////////////////////////////////////////////////////////////////////// ////////
1061 1061
1062 #define SK_SHOW_TEXT_BLIT_COVERAGE 0 1062 #define SK_SHOW_TEXT_BLIT_COVERAGE 0
1063 1063
1064 static void build_power_table(uint8_t table[], float ee) { 1064 static void build_power_table(uint8_t table[], float ee) {
1065 for (int i = 0; i < 256; i++) { 1065 for (int i = 0; i < 256; i++) {
1066 float x = i / 255.f; 1066 float x = i / 255.f;
1067 x = sk_float_pow(x, ee); 1067 x = sk_float_pow(x, ee);
1068 int xx = SkScalarRound(SkFloatToScalar(x * 255)); 1068 int xx = SkScalarRound(x * 255);
1069 table[i] = SkToU8(xx); 1069 table[i] = SkToU8(xx);
1070 } 1070 }
1071 } 1071 }
1072 1072
1073 /** 1073 /**
1074 * This will invert the gamma applied by GDI (gray-scale antialiased), so we 1074 * This will invert the gamma applied by GDI (gray-scale antialiased), so we
1075 * can get linear values. 1075 * can get linear values.
1076 * 1076 *
1077 * GDI grayscale appears to use a hard-coded gamma of 2.3. 1077 * GDI grayscale appears to use a hard-coded gamma of 2.3.
1078 * 1078 *
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 2600
2601 private: 2601 private:
2602 SkTDArray<ENUMLOGFONTEX> fLogFontArray; 2602 SkTDArray<ENUMLOGFONTEX> fLogFontArray;
2603 }; 2603 };
2604 2604
2605 /////////////////////////////////////////////////////////////////////////////// 2605 ///////////////////////////////////////////////////////////////////////////////
2606 2606
2607 SkFontMgr* SkFontMgr_New_GDI() { 2607 SkFontMgr* SkFontMgr_New_GDI() {
2608 return SkNEW(SkFontMgrGDI); 2608 return SkNEW(SkFontMgrGDI);
2609 } 2609 }
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_mac.cpp ('k') | src/ports/SkFontHost_win_dw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698