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

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: 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
« no previous file with comments | « Source/core/platform/graphics/TextRun.h ('k') | Source/core/platform/graphics/chromium/UniscribeHelper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4ceb73dc3fe7d3b93574a99a9d8a43196015b0d0..6a23685cd51389365b27b0d94e88635f77611f54 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->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));
}
}
@@ -175,12 +177,10 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run,
}
void Font::drawComplexText(GraphicsContext* graphicsContext,
- const TextRun& run,
- const FloatPoint& point,
- int from,
- int to) const
+ const TextRunPaintInfo& runInfo,
+ const FloatPoint& point) const
{
- UniscribeHelperTextRun state(run, *this);
+ UniscribeHelperTextRun state(runInfo.run, *this);
SkColor color = graphicsContext->effectiveFillColor();
unsigned char alpha = SkColorGetA(color);
@@ -191,10 +191,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()), runInfo.bounds, runInfo.from, runInfo.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 TextRunPaintInfo& /* runInfo */, const AtomicString& /* mark */, const FloatPoint& /* point */) const
{
notImplemented();
}
« no previous file with comments | « Source/core/platform/graphics/TextRun.h ('k') | Source/core/platform/graphics/chromium/UniscribeHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698