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

Unified Diff: Source/core/layout/LayoutTextControl.cpp

Issue 1253543003: Cleanup LayoutTextControl and its subclasses. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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/layout/LayoutTextControl.h ('k') | Source/core/layout/LayoutTextControlMultiLine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutTextControl.cpp
diff --git a/Source/core/layout/LayoutTextControl.cpp b/Source/core/layout/LayoutTextControl.cpp
index a786280b95263646ea2416e94ccd97314001f496..1433ddff2c980eef33a2221ef28a4543894d3968 100644
--- a/Source/core/layout/LayoutTextControl.cpp
+++ b/Source/core/layout/LayoutTextControl.cpp
@@ -203,7 +203,7 @@ static const char* const fontFamiliesWithInvalidCharWidth[] = {
// from the width of a '0'. This only seems to apply to a fixed number of Mac fonts,
// but, in order to get similar rendering across platforms, we do this check for
// all platforms.
-bool LayoutTextControl::hasValidAvgCharWidth(AtomicString family)
+bool LayoutTextControl::hasValidAvgCharWidth(const AtomicString& family)
{
static HashSet<AtomicString>* fontFamiliesWithInvalidCharWidthMap = nullptr;
@@ -220,7 +220,7 @@ bool LayoutTextControl::hasValidAvgCharWidth(AtomicString family)
return !fontFamiliesWithInvalidCharWidthMap->contains(family);
}
-float LayoutTextControl::getAvgCharWidth(AtomicString family)
+float LayoutTextControl::getAvgCharWidth(const AtomicString& family) const
{
if (hasValidAvgCharWidth(family))
return roundf(style()->font().primaryFont()->avgCharWidth());
« no previous file with comments | « Source/core/layout/LayoutTextControl.h ('k') | Source/core/layout/LayoutTextControlMultiLine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698