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

Unified Diff: Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp

Issue 551183005: [TextBlob] Fix LCD text handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: pass a bool instead of a GC 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
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | Source/platform/fonts/mac/FontMac.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp
diff --git a/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp b/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp
index f7c6289cb1d54ec33e32e6259b54b30accd02818..96e44fd100f24b7d31cf63a98e17df2e9d46c8ef 100644
--- a/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp
+++ b/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp
@@ -206,17 +206,11 @@ void Font::drawTextBlob(GraphicsContext* gc, const SkTextBlob* blob, const SkPoi
// See also paintGlyphs.
TextDrawingModeFlags textMode = gc->textDrawingMode();
- if (textMode & TextModeFill) {
- SkPaint paint = gc->fillPaint();
- gc->adjustTextRenderMode(&paint);
- paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
- gc->drawTextBlob(blob, origin, paint);
- }
+ if (textMode & TextModeFill)
+ gc->drawTextBlob(blob, origin, gc->fillPaint());
if ((textMode & TextModeStroke) && gc->hasStroke()) {
SkPaint paint = gc->strokePaint();
- gc->adjustTextRenderMode(&paint);
- paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
if (textMode & TextModeFill)
paint.setLooper(0);
gc->drawTextBlob(blob, origin, paint);
@@ -299,7 +293,8 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run,
return shaper.selectionRect(point, height, from, to);
}
-PassTextBlobPtr Font::buildTextBlob(const GlyphBuffer& glyphBuffer, float initialAdvance, const FloatRect& bounds, float& advance) const
+PassTextBlobPtr Font::buildTextBlob(const GlyphBuffer& glyphBuffer, float initialAdvance,
+ const FloatRect& bounds, float& advance, bool couldUseLCD) const
{
// FIXME: Except for setupPaint, this is not specific to FontHarfBuzz.
// FIXME: Also implement the more general full-positioning path.
@@ -328,6 +323,9 @@ PassTextBlobPtr Font::buildTextBlob(const GlyphBuffer& glyphBuffer, float initia
fontData->platformData().setupPaint(&paint);
paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+ // FIXME: this should go away after the big LCD cleanup.
+ paint.setLCDRenderText(paint.isLCDRenderText() && couldUseLCD);
+
unsigned start = i++;
while (i < glyphBuffer.size() && glyphBuffer.fontDataAt(i) == fontData)
i++;
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | Source/platform/fonts/mac/FontMac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698