Gamma correction for distance field text.
Handles both non-LCD and LCD text. Uses a texture to look up the gamma correction values for a given text color or luminance.
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/4d517fdbb145cb95e5e935470df331e1b6667cfc
R=reed@google.com, bungeman@google.com, robertphillips@google.com, bsalomon@google.com
Author: jvanverth@google.com
Review URL: https://codereview.chromium.org/258883002
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index 95fc0b8..f766ca1 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -1081,7 +1081,8 @@
SkScalar measure_text(SkGlyphCache*, const char* text, size_t length,
int* count, SkRect* bounds) const;
- SkGlyphCache* detachCache(const SkDeviceProperties* deviceProperties, const SkMatrix*) const;
+ SkGlyphCache* detachCache(const SkDeviceProperties* deviceProperties, const SkMatrix*,
+ bool ignoreGamma) const;
void descriptorProc(const SkDeviceProperties* deviceProperties, const SkMatrix* deviceMatrix,
void (*proc)(SkTypeface*, const SkDescriptor*, void*),
@@ -1131,6 +1132,7 @@
}
friend class SkAutoGlyphCache;
+ friend class SkAutoGlyphCacheNoGamma;
friend class SkCanvas;
friend class SkDraw;
friend class SkGraphics; // So Term() can be called.