Index: src/core/SkBitmapDevice.cpp |
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp |
index 2711004aef14de4fbda9fbe12f2c74b171acdfa5..04009c92147e50b82e7174cce6dc9fd75dd64e65 100644 |
--- a/src/core/SkBitmapDevice.cpp |
+++ b/src/core/SkBitmapDevice.cpp |
@@ -374,20 +374,20 @@ SkImageFilter::Cache* SkBitmapDevice::getImageFilterCache() { |
/////////////////////////////////////////////////////////////////////////////// |
+// Our current blitters only work on 32bit targets. |
+static bool supports_lcd(const SkBitmap& target) { |
+ return kN32_SkColorType == target.colorType(); |
+} |
+ |
bool SkBitmapDevice::filterTextFlags(const SkPaint& paint, TextFlags* flags) { |
- if (!paint.isLCDRenderText() || !paint.isAntiAlias()) { |
- // we're cool with the paint as is |
- return false; |
+ uint32_t clearMask = 0; |
+ |
+ if (paint.isLCDRenderText() && paint.isAntiAlias() && !supports_lcd(fBitmap)) { |
+ clearMask |= SkPaint::kLCDRenderText_Flag; |
} |
- if (kN32_SkColorType != fBitmap.colorType() || |
- paint.getRasterizer() || |
- paint.getPathEffect() || |
- paint.isFakeBoldText() || |
- paint.getStyle() != SkPaint::kFill_Style || |
- !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { |
- // turn off lcd |
- flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; |
+ if (clearMask) { |
+ flags->fFlags = paint.getFlags() & ~clearMask; |
flags->fHinting = paint.getHinting(); |
return true; |
} |