when we disable lcd for impl reasons, add kGenA8 to document the original intent
BUG=skia:
R=bungeman@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/572933004
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index 618431a..f55354b 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -138,8 +138,7 @@
};
struct TextFlags {
- uint32_t fFlags; // SkPaint::getFlags()
- SkPaint::Hinting fHinting;
+ uint32_t fFlags; // SkPaint::getFlags()
};
/**
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 2711004..3af47f6 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -386,9 +386,9 @@
paint.isFakeBoldText() ||
paint.getStyle() != SkPaint::kFill_Style ||
!SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) {
- // turn off lcd
+ // turn off lcd, but turn on kGenA8
flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag;
- flags->fHinting = paint.getHinting();
+ flags->fFlags |= SkPaint::kGenA8FromLCD_Flag;
return true;
}
// we're cool with the paint as is
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 62d60da..6beb26e 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1993,7 +1993,6 @@
if (device->filterTextFlags(paint, &flags)) {
SkPaint* newPaint = fLazy.set(paint);
newPaint->setFlags(flags.fFlags);
- newPaint->setHinting(flags.fHinting);
fPaint = newPaint;
} else {
fPaint = &paint;
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index b719f84..0ec2b85 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1765,9 +1765,9 @@
paint.getPathEffect() ||
paint.isFakeBoldText() ||
paint.getStyle() != SkPaint::kFill_Style) {
- // turn off lcd
+ // turn off lcd, but turn on kGenA8
flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag;
- flags->fHinting = paint.getHinting();
+ flags->fFlags |= SkPaint::kGenA8FromLCD_Flag;
return true;
}
// we're cool with the paint as is