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

Unified Diff: src/core/SkPaint.cpp

Issue 348153002: Add faster powf approximation for Android. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unnecessary gamma correction Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 86b54f22c86531917a616b55e4379eaa7af77f4e..e5a55884d428dceee7c84a4aad08d6d2fa6ba646 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -1780,13 +1780,10 @@ void SkScalerContext::PostMakeRec(const SkPaint&, SkScalerContext::Rec* rec) {
// use per-component information
SkColor color = rec->getLuminanceColor();
- U8CPU lum = SkColorSpaceLuminance::computeLuminance(rec->getPaintGamma(), color);
- //If we are asked to look like LCD, look like LCD.
- if (!(rec->fFlags & SkScalerContext::kGenA8FromLCD_Flag)) {
- // HACK: Prevents green from being pre-blended as white.
- lum -= ((255 - lum) * lum) / 255;
- }
-
+ U8CPU lum = SkComputeLuminance(SkColorGetR(color),
+ SkColorGetG(color),
+ SkColorGetB(color));
+
// reduce to our finite number of bits
color = SkColorSetRGB(lum, lum, lum);
rec->setLuminanceColor(SkMaskGamma::CanonicalColor(color));
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698