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

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: rebase with TOT Created 7 years, 8 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 7595e6efce2e856b32a7e0c0568486b485528855..7f5339b0f2f1593f3480fd3792f2a5422ebbac69 100644
--- a/Source/core/platform/graphics/mac/FontComplexTextMac.cpp
+++ b/Source/core/platform/graphics/mac/FontComplexTextMac.cpp
@@ -92,14 +92,14 @@ 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 TextRun& run, const FloatPoint& point, const FloatRect& textRect, int from, int to) const
{
if (preferHarfBuzz(this)) {
GlyphBuffer glyphBuffer;
HarfBuzzShaper shaper(this, run);
shaper.setDrawRange(from, to);
if (shaper.shape(&glyphBuffer)) {
- drawGlyphBuffer(context, run, glyphBuffer, point);
+ drawGlyphBuffer(context, run, glyphBuffer, point, textRect);
return;
}
}
@@ -114,10 +114,10 @@ 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, run, glyphBuffer, startPoint, textRect);
}
-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 TextRun& run, const AtomicString& mark, const FloatPoint& point, const FloatRect& textRect, int from, int to) const
{
GlyphBuffer glyphBuffer;
float initialAdvance = getGlyphsAndAdvancesForComplexText(run, from, to, glyphBuffer, ForTextEmphasis);
@@ -125,7 +125,7 @@ void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextR
if (glyphBuffer.isEmpty())
return;
- drawEmphasisMarks(context, run, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
+ drawEmphasisMarks(context, run, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()), textRect);
}
float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const

Powered by Google App Engine
This is Rietveld 408576698