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

Unified Diff: src/core/SkMaskGamma.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/core/SkMaskGamma.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMaskGamma.cpp
diff --git a/src/core/SkMaskGamma.cpp b/src/core/SkMaskGamma.cpp
index 9066fb7d9fe654228849297a8b29c2e4a5d48dd5..a305d72162888ab39420ba4fc29fc1d13e7f1fee 100644
--- a/src/core/SkMaskGamma.cpp
+++ b/src/core/SkMaskGamma.cpp
@@ -36,21 +36,21 @@ class SkSRGBColorSpaceLuminance : public SkColorSpaceLuminance {
SkASSERT(0 == gamma);
//The magic numbers are derived from the sRGB specification.
//See http://www.color.org/chardata/rgb/srgb.xalter .
- if (luminance <= SkFloatToScalar(0.04045f)) {
- return luminance / SkFloatToScalar(12.92f);
+ if (luminance <= 0.04045f) {
+ return luminance / 12.92f;
}
- return SkScalarPow((luminance + SkFloatToScalar(0.055f)) / SkFloatToScalar(1.055f),
- SkFloatToScalar(2.4f));
+ return SkScalarPow((luminance + 0.055f) / 1.055f,
+ 2.4f);
}
virtual SkScalar fromLuma(SkScalar SkDEBUGCODE(gamma), SkScalar luma) const SK_OVERRIDE {
SkASSERT(0 == gamma);
//The magic numbers are derived from the sRGB specification.
//See http://www.color.org/chardata/rgb/srgb.xalter .
- if (luma <= SkFloatToScalar(0.0031308f)) {
- return luma * SkFloatToScalar(12.92f);
+ if (luma <= 0.0031308f) {
+ return luma * 12.92f;
}
- return SkFloatToScalar(1.055f) * SkScalarPow(luma, SkScalarInvert(SkFloatToScalar(2.4f)))
- - SkFloatToScalar(0.055f);
+ return 1.055f * SkScalarPow(luma, SkScalarInvert(2.4f))
+ - 0.055f;
}
};
« no previous file with comments | « src/core/SkMaskGamma.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698