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

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: 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/graphics/GraphicsContext.h » ('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..2e0fa0a38d5cfb4d6b032559be19baa16435c891 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, const GraphicsContext& context,
+ float initialAdvance, const FloatRect& bounds, float& advance) const
{
// FIXME: Except for setupPaint, this is not specific to FontHarfBuzz.
// FIXME: Also implement the more general full-positioning path.
@@ -326,6 +321,7 @@ PassTextBlobPtr Font::buildTextBlob(const GlyphBuffer& glyphBuffer, float initia
// to avoid correctness problems here.
SkPaint paint;
fontData->platformData().setupPaint(&paint);
+ context.adjustTextRenderMode(&paint);
jbroman 2014/09/10 17:09:40 When can these properties of the GraphicsContext c
paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
unsigned start = i++;
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698