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

Unified Diff: src/core/SkPaint.cpp

Issue 337603008: Remove A8_LCD luminance hack. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add SK_IGNORE_FASTER_TEXT_FIX 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..2e1c70b864f74fdfa1b2a219927ccfb0535fd124 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -1778,15 +1778,19 @@ void SkScalerContext::PostMakeRec(const SkPaint&, SkScalerContext::Rec* rec) {
case SkMask::kA8_Format: {
// filter down the luminance to a single component, since A8 can't
// use per-component information
-
SkColor color = rec->getLuminanceColor();
+#ifdef SK_IGNORE_FASTER_TEXT_FIX
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;
}
-
+#else
+ U8CPU lum = SkComputeLuminance(SkColorGetR(color),
+ SkColorGetG(color),
+ SkColorGetB(color));
+#endif
// 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