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

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: 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/harfbuzz/FontHarfBuzz.cpp
diff --git a/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp b/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp
index 10fe78ee2b4600cf4081e6a15fd1d466300e77c2..2057ba3665ec6610ced1365a8a93b3f6ba5f15d2 100644
--- a/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp
+++ b/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp
@@ -60,7 +60,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);
@@ -107,10 +107,10 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
path.reset();
path.moveTo(vPosBegin[i]);
path.lineTo(vPosEnd[i]);
- gc->drawTextOnPath(glyphs + i, 2, path, 0, paint);
+ gc->drawTextOnPath(glyphs + i, 2, path, textRect, 0, paint);
}
} else
- gc->drawPosText(glyphs, numGlyphs << 1, pos, paint);
+ gc->drawPosText(glyphs, numGlyphs << 1, pos, textRect, paint);
}
if ((textMode & TextModeStroke)
@@ -136,10 +136,10 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
path.reset();
path.moveTo(vPosBegin[i]);
path.lineTo(vPosEnd[i]);
- gc->drawTextOnPath(glyphs + i, 2, path, 0, paint);
+ gc->drawTextOnPath(glyphs + i, 2, path, textRect, 0, paint);
}
} else
- gc->drawPosText(glyphs, numGlyphs << 1, pos, paint);
+ gc->drawPosText(glyphs, numGlyphs << 1, pos, textRect, paint);
}
}
@@ -149,10 +149,9 @@ static void setupForTextPainting(SkPaint* paint, SkColor color)
paint->setColor(color);
}
-void Font::drawComplexText(GraphicsContext* gc, const TextRun& run,
- const FloatPoint& point, int from, int to) const
+void Font::drawComplexText(GraphicsContext* gc, const TextRunPaintInfo& runInfo, const FloatPoint& point) const
{
- if (!run.length())
+ if (!runInfo.run.length())
return;
TextDrawingModeFlags textMode = gc->textDrawingModeSkia();
@@ -175,15 +174,15 @@ void Font::drawComplexText(GraphicsContext* gc, const TextRun& run,
}
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))
return;
FloatPoint adjustedPoint = shaper.adjustStartPoint(point);
- drawGlyphBuffer(gc, run, glyphBuffer, adjustedPoint);
+ drawGlyphBuffer(gc, runInfo, glyphBuffer, adjustedPoint);
}
-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
{
notImplemented();
}
« no previous file with comments | « Source/core/platform/graphics/chromium/UniscribeHelper.cpp ('k') | Source/core/platform/graphics/mac/FontComplexTextMac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698