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

Unified Diff: Source/core/platform/graphics/chromium/FontChromiumWin.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/chromium/FontChromiumWin.cpp
diff --git a/Source/core/platform/graphics/chromium/FontChromiumWin.cpp b/Source/core/platform/graphics/chromium/FontChromiumWin.cpp
index e8fc78049fd989ff8f7c1ed81ecb99d02986adc5..2dc9fb2a75baea989a602ca17e31cd86224ec0c3 100644
--- a/Source/core/platform/graphics/chromium/FontChromiumWin.cpp
+++ b/Source/core/platform/graphics/chromium/FontChromiumWin.cpp
@@ -62,7 +62,8 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext,
const GlyphBuffer& glyphBuffer,
int from,
int numGlyphs,
- const FloatPoint& point) const
+ const FloatPoint& point,
+ const FloatRect& textRect) const
{
SkColor color = graphicsContext->platformContext()->effectiveFillColor();
unsigned char alpha = SkColorGetA(color);
@@ -77,6 +78,7 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext,
int glyphIndex = 0; // The starting glyph of the current chunk.
float horizontalOffset = point.x(); // The floating point offset of the left side of the current glyph.
+
#if ENABLE(OPENTYPE_VERTICAL)
const OpenTypeVerticalData* verticalData = font->verticalData();
if (verticalData) {
@@ -110,7 +112,7 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext,
SkPoint origin;
origin.set(verticalOriginX, SkFloatToScalar(point.y() + horizontalOffset - point.x()));
horizontalOffset += currentWidth;
- paintSkiaText(graphicsContext, font->platformData(), curLen, &glyphs[0], &advances[0], &offsets[0], &origin);
+ paintSkiaText(graphicsContext, font->platformData(), curLen, &glyphs[0], &advances[0], &offsets[0], origin, SkRect(textRect));
}
graphicsContext->setCTM(savedMatrix);
@@ -151,7 +153,7 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext,
SkPoint origin = point;
origin.fX += SkFloatToScalar(horizontalOffset - point.x() - currentWidth);
- paintSkiaText(graphicsContext, font->platformData(), curLen, &glyphs[0], &advances[0], 0, &origin);
+ paintSkiaText(graphicsContext, font->platformData(), curLen, &glyphs[0], &advances[0], 0, origin, SkRect(textRect));
}
}
@@ -177,6 +179,7 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run,
void Font::drawComplexText(GraphicsContext* graphicsContext,
const TextRun& run,
const FloatPoint& point,
+ const FloatRect& textRect,
int from,
int to) const
{
@@ -192,10 +195,10 @@ void Font::drawComplexText(GraphicsContext* graphicsContext,
HDC hdc = 0;
// Uniscribe counts the coordinates from the upper left, while WebKit uses
// the baseline, so we have to subtract off the ascent.
- state.draw(graphicsContext, hdc, lroundf(point.x()), lroundf(point.y() - fontMetrics().ascent()), from, to);
+ state.draw(graphicsContext, hdc, lroundf(point.x()), lroundf(point.y() - fontMetrics().ascent()), textRect, from, to);
}
-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