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

Unified Diff: src/core/SkBitmapDevice.cpp

Issue 551463004: introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address comments from #6 Created 6 years, 3 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
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;
}

Powered by Google App Engine
This is Rietveld 408576698