Index: src/core/SkDraw.cpp |
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp |
index c63c90fb8ac8825e0e36949aeb2af1af72968490..232973488e82d388143f5fa3f1d2760fc7d23d13 100644 |
--- a/src/core/SkDraw.cpp |
+++ b/src/core/SkDraw.cpp |
@@ -1555,8 +1555,12 @@ private: |
//////////////////////////////////////////////////////////////////////////////////////////////////// |
-SkPaint::FakeGamma SkDraw::fakeGamma() const { |
- return fDevice->imageInfo().isLinear() ? SkPaint::FakeGamma::On : SkPaint::FakeGamma::Off; |
+uint32_t SkDraw::scalerContextFlags() const { |
+ uint32_t flags = SkPaint::kBoostContrast_ScalerContextFlag; |
+ if (fDevice->imageInfo().isLinear()) { |
+ flags |= SkPaint::kFakeGamma_ScalerContextFlag; |
+ } |
+ return flags; |
} |
void SkDraw::drawText(const char text[], size_t byteLength, |
@@ -1577,7 +1581,7 @@ void SkDraw::drawText(const char text[], size_t byteLength, |
return; |
} |
- SkAutoGlyphCache cache(paint, &fDevice->surfaceProps(), this->fakeGamma(), fMatrix); |
+ SkAutoGlyphCache cache(paint, &fDevice->surfaceProps(), this->scalerContextFlags(), fMatrix); |
// The Blitter Choose needs to be live while using the blitter below. |
SkAutoBlitterChoose blitterChooser(fDst, *fMatrix, paint); |
@@ -1606,7 +1610,7 @@ void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength, |
paint.setPathEffect(nullptr); |
SkPaint::GlyphCacheProc glyphCacheProc = paint.getGlyphCacheProc(true); |
- SkAutoGlyphCache cache(paint, &fDevice->surfaceProps(), this->fakeGamma(), nullptr); |
+ SkAutoGlyphCache cache(paint, &fDevice->surfaceProps(), this->scalerContextFlags(), nullptr); |
const char* stop = text + byteLength; |
SkTextAlignProc alignProc(paint.getTextAlign()); |
@@ -1657,7 +1661,7 @@ void SkDraw::drawPosText(const char text[], size_t byteLength, |
return; |
} |
- SkAutoGlyphCache cache(paint, &fDevice->surfaceProps(), this->fakeGamma(), fMatrix); |
+ SkAutoGlyphCache cache(paint, &fDevice->surfaceProps(), this->scalerContextFlags(), fMatrix); |
// The Blitter Choose needs to be live while using the blitter below. |
SkAutoBlitterChoose blitterChooser(fDst, *fMatrix, paint); |