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

Unified Diff: Source/core/platform/graphics/mac/FontComplexTextMac.cpp

Issue 14160005: Track the region where text is painted. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed build on win and mac Created 7 years, 7 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: Source/core/platform/graphics/mac/FontComplexTextMac.cpp
diff --git a/Source/core/platform/graphics/mac/FontComplexTextMac.cpp b/Source/core/platform/graphics/mac/FontComplexTextMac.cpp
index e5c45b8e0b695e34718c64bb48d330231b2b0b74..56aaca6dc25098bca71fb6f06877062081247677 100644
--- a/Source/core/platform/graphics/mac/FontComplexTextMac.cpp
+++ b/Source/core/platform/graphics/mac/FontComplexTextMac.cpp
@@ -92,21 +92,21 @@ float Font::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int
return initialAdvance;
}
-void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
+void Font::drawComplexText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const FloatPoint& point) const
{
if (preferHarfBuzz(this)) {
GlyphBuffer glyphBuffer;
- HarfBuzzShaper shaper(this, run);
- shaper.setDrawRange(from, to);
+ HarfBuzzShaper shaper(this, runInfo.run);
+ shaper.setDrawRange(runInfo.from, runInfo.to);
if (shaper.shape(&glyphBuffer)) {
- drawGlyphBuffer(context, run, glyphBuffer, point);
+ drawGlyphBuffer(context, runInfo, glyphBuffer, point);
return;
}
}
// This glyph buffer holds our glyphs + advances + font data for each glyph.
GlyphBuffer glyphBuffer;
- float startX = point.x() + getGlyphsAndAdvancesForComplexText(run, from, to, glyphBuffer);
+ float startX = point.x() + getGlyphsAndAdvancesForComplexText(runInfo.run, runInfo.from, runInfo.to, glyphBuffer);
// We couldn't generate any glyphs for the run. Give up.
if (glyphBuffer.isEmpty())
@@ -114,18 +114,18 @@ void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const F
// Draw the glyph buffer now at the starting point returned in startX.
FloatPoint startPoint(startX, point.y());
- drawGlyphBuffer(context, run, glyphBuffer, startPoint);
+ drawGlyphBuffer(context, runInfo, glyphBuffer, startPoint);
}
-void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
+void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point) const
{
GlyphBuffer glyphBuffer;
- float initialAdvance = getGlyphsAndAdvancesForComplexText(run, from, to, glyphBuffer, ForTextEmphasis);
+ float initialAdvance = getGlyphsAndAdvancesForComplexText(runInfo.run, runInfo.from, runInfo.to, glyphBuffer, ForTextEmphasis);
if (glyphBuffer.isEmpty())
return;
- drawEmphasisMarks(context, run, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
+ drawEmphasisMarks(context, runInfo, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
}
float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
« no previous file with comments | « Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp ('k') | Source/core/platform/graphics/mac/FontMac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698