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

Unified Diff: Source/core/platform/graphics/Font.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/Font.h ('k') | Source/core/platform/graphics/FontFastPath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/Font.cpp
diff --git a/Source/core/platform/graphics/Font.cpp b/Source/core/platform/graphics/Font.cpp
index 11b576000da709854d92bc8e5764ae320a5290c2..2a701c343c88e97e67c659e3ff0f3e2f7c8a5db8 100644
--- a/Source/core/platform/graphics/Font.cpp
+++ b/Source/core/platform/graphics/Font.cpp
@@ -156,7 +156,7 @@ void Font::update(PassRefPtr<FontSelector> fontSelector) const
m_typesettingFeatures = computeTypesettingFeatures();
}
-void Font::drawText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to, CustomFontNotReadyAction customFontNotReadyAction) const
+void Font::drawText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const FloatPoint& point, CustomFontNotReadyAction customFontNotReadyAction) const
{
// Don't draw anything while we are using custom fonts that are in the process of loading,
// except if the 'force' argument is set to true (in which case it will use a fallback
@@ -164,36 +164,31 @@ void Font::drawText(GraphicsContext* context, const TextRun& run, const FloatPoi
if (loadingCustomFonts() && customFontNotReadyAction == DoNotPaintIfFontNotReady)
return;
- to = (to == -1 ? run.length() : to);
-
- CodePath codePathToUse = codePath(run);
+ CodePath codePathToUse = codePath(runInfo.run);
// FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
- if (codePathToUse != Complex && typesettingFeatures() && (from || to != run.length()))
+ if (codePathToUse != Complex && typesettingFeatures() && (runInfo.from || runInfo.to != runInfo.run.length()))
codePathToUse = Complex;
if (codePathToUse != Complex)
- return drawSimpleText(context, run, point, from, to);
+ return drawSimpleText(context, runInfo, point);
- return drawComplexText(context, run, point, from, to);
+ return drawComplexText(context, runInfo, point);
}
-void Font::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
+void Font::drawEmphasisMarks(GraphicsContext* context, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point) const
{
if (loadingCustomFonts())
return;
- if (to < 0)
- to = run.length();
-
- CodePath codePathToUse = codePath(run);
+ CodePath codePathToUse = codePath(runInfo.run);
// FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
- if (codePathToUse != Complex && typesettingFeatures() && (from || to != run.length()))
+ if (codePathToUse != Complex && typesettingFeatures() && (runInfo.from || runInfo.to != runInfo.run.length()))
codePathToUse = Complex;
if (codePathToUse != Complex)
- drawEmphasisMarksForSimpleText(context, run, mark, point, from, to);
+ drawEmphasisMarksForSimpleText(context, runInfo, mark, point);
else
- drawEmphasisMarksForComplexText(context, run, mark, point, from, to);
+ drawEmphasisMarksForComplexText(context, runInfo, mark, point);
}
float Font::width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
« no previous file with comments | « Source/core/platform/graphics/Font.h ('k') | Source/core/platform/graphics/FontFastPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698