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

Unified Diff: Source/core/platform/graphics/harfbuzz/FontHarfBuzz.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/harfbuzz/FontHarfBuzz.cpp
diff --git a/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp b/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp
index 513c8d9c58e27b5dbfbc63d9b7b52016394e6fdb..1e7fbb16ffb79b67b3636a3cf32464549160cfe8 100644
--- a/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp
+++ b/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp
@@ -61,7 +61,7 @@ bool Font::canExpandAroundIdeographsInComplexText()
void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
const GlyphBuffer& glyphBuffer, int from, int numGlyphs,
- const FloatPoint& point) const {
+ const FloatPoint& point, const FloatRect& textRect) const {
SkASSERT(sizeof(GlyphBufferGlyph) == sizeof(uint16_t)); // compile-time assert
const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from);
@@ -109,10 +109,10 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
path.reset();
path.moveTo(vPosBegin[i]);
path.lineTo(vPosEnd[i]);
- platformContext->drawTextOnPath(glyphs + i, 2, path, 0, paint);
+ platformContext->drawTextOnPath(glyphs + i, 2, path, textRect, 0, paint);
}
} else
- platformContext->drawPosText(glyphs, numGlyphs << 1, pos, paint);
+ platformContext->drawPosText(glyphs, numGlyphs << 1, pos, textRect, paint);
}
if ((textMode & TextModeStroke)
@@ -138,10 +138,10 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
path.reset();
path.moveTo(vPosBegin[i]);
path.lineTo(vPosEnd[i]);
- platformContext->drawTextOnPath(glyphs + i, 2, path, 0, paint);
+ platformContext->drawTextOnPath(glyphs + i, 2, path, textRect, 0, paint);
}
} else
- platformContext->drawPosText(glyphs, numGlyphs << 1, pos, paint);
+ platformContext->drawPosText(glyphs, numGlyphs << 1, pos, textRect, paint);
}
}
@@ -152,7 +152,8 @@ static void setupForTextPainting(SkPaint* paint, SkColor color)
}
void Font::drawComplexText(GraphicsContext* gc, const TextRun& run,
- const FloatPoint& point, int from, int to) const
+ const FloatPoint& point, const FloatRect& textRect,
+ int from, int to) const
{
if (!run.length())
return;
@@ -182,10 +183,10 @@ void Font::drawComplexText(GraphicsContext* gc, const TextRun& run,
if (!shaper.shape(&glyphBuffer))
return;
FloatPoint adjustedPoint = shaper.adjustStartPoint(point);
- drawGlyphBuffer(gc, run, glyphBuffer, adjustedPoint);
+ drawGlyphBuffer(gc, run, glyphBuffer, adjustedPoint, 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
{
notImplemented();
}

Powered by Google App Engine
This is Rietveld 408576698