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

Unified Diff: src/ports/SkFontHost_mac.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, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pdf/SkPDFImage.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_mac.cpp
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 1d2f1fa78b1ce3694e572d19ae0410ade86ae32a..3c1a274887728feebe9570ce5f4c0ce56eae247f 100755
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -273,7 +273,7 @@ static CGFloat ScalarToCG(SkScalar scalar) {
static SkScalar CGToScalar(CGFloat cgFloat) {
if (sizeof(CGFloat) == sizeof(float)) {
- return SkFloatToScalar(cgFloat);
+ return cgFloat;
} else {
SkASSERT(sizeof(CGFloat) == sizeof(double));
return SkDoubleToScalar(cgFloat);
@@ -1075,7 +1075,7 @@ static void build_power_table(uint8_t table[], float ee) {
for (int i = 0; i < 256; i++) {
float x = i / 255.f;
x = sk_float_pow(x, ee);
- int xx = SkScalarRoundToInt(SkFloatToScalar(x * 255));
+ int xx = SkScalarRoundToInt(x * 255);
table[i] = SkToU8(xx);
}
}
@@ -1325,7 +1325,7 @@ void SkScalerContext_Mac::generatePath(const SkGlyph& glyph, SkPath* path) {
fRec.getSingleMatrix(&m);
// start out by assuming that we want no hining in X and Y
- scaleX = scaleY = SkFloatToScalar(kScaleForSubPixelPositionHinting);
+ scaleX = scaleY = kScaleForSubPixelPositionHinting;
// now see if we need to restore hinting for axis-aligned baselines
switch (SkComputeAxisAlignmentForHText(m)) {
case kX_SkAxisAlignment:
« no previous file with comments | « src/pdf/SkPDFImage.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698