aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDevice.cpp
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2014-11-13 14:05:58 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-13 14:05:58 -0800
commit112e7e277702e104357f2d44742253ee1b0109ac (patch)
treea26bbfb0c5d0a44f8dd852e72758dd3f46100dbd /src/core/SkDevice.cpp
parent975ae5e4b881d4df41fd06453a650d6312127c8d (diff)
Observe surface LCD settings in SkBaseDevice::drawTextBlob()
We're currently overwriting the paint LCD text flag based on the the run font data => this cancels any LCD filtering we might have performed higher up the stack. BUG=423362 R=reed@google.com Review URL: https://codereview.chromium.org/718913003
Diffstat (limited to 'src/core/SkDevice.cpp')
-rw-r--r--src/core/SkDevice.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 90ea705adc..bc6c892079 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -129,6 +129,7 @@ void SkBaseDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkSc
// applyFontToPaint() always overwrites the exact same attributes,
// so it is safe to not re-seed the paint.
it.applyFontToPaint(&runPaint);
+ runPaint.setFlags(this->filterTextFlags(runPaint));
switch (it.positioning()) {
case SkTextBlob::kDefault_Positioning:
@@ -211,15 +212,20 @@ bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const S
//////////////////////////////////////////////////////////////////////////////////////////
-bool SkBaseDevice::shouldDisableLCD(const SkPaint& paint) const {
+uint32_t SkBaseDevice::filterTextFlags(const SkPaint& paint) const {
+ uint32_t flags = paint.getFlags();
+
if (!paint.isLCDRenderText() || !paint.isAntiAlias()) {
- return false;
+ return flags;
}
- if (kUnknown_SkPixelGeometry == fLeakyProperties->pixelGeometry()) {
- return true;
+ if (kUnknown_SkPixelGeometry == fLeakyProperties->pixelGeometry()
+ || this->onShouldDisableLCD(paint)) {
+
+ flags &= ~SkPaint::kLCDRenderText_Flag;
+ flags |= SkPaint::kGenA8FromLCD_Flag;
}
- return this->onShouldDisableLCD(paint);
+ return flags;
}