diff options
Diffstat (limited to 'WebCore/platform/graphics/WidthIterator.cpp')
-rw-r--r-- | WebCore/platform/graphics/WidthIterator.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/WebCore/platform/graphics/WidthIterator.cpp b/WebCore/platform/graphics/WidthIterator.cpp index a66b234..a16d739 100644 --- a/WebCore/platform/graphics/WidthIterator.cpp +++ b/WebCore/platform/graphics/WidthIterator.cpp @@ -65,13 +65,7 @@ WidthIterator::WidthIterator(const Font* font, const TextRun& run) } } -#ifdef ANDROID_GLYPHBUFFER_HAS_ADJUSTED_WIDTHS -#define SIGNAL_ADJUSTED_WIDTHS() adjustedWidths = true -bool WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer) -#else -#define SIGNAL_ADJUSTED_WIDTHS() void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer) -#endif { if (offset > m_end) offset = m_end; @@ -85,9 +79,6 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer) float runWidthSoFar = m_runWidthSoFar; float lastRoundingWidth = m_finalRoundingWidth; -#ifdef ANDROID_GLYPHBUFFER_HAS_ADJUSTED_WIDTHS - bool adjustedWidths = false; -#endif while (currentCharacter < offset) { UChar32 c = *cp; unsigned clusterLength = 1; @@ -129,26 +120,21 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer) if (c == '\t' && m_run.allowTabs()) { float tabWidth = m_font->tabWidth(); width = tabWidth - fmodf(m_run.xPos() + runWidthSoFar, tabWidth); - SIGNAL_ADJUSTED_WIDTHS(); } else { width = fontData->widthForGlyph(glyph); -#ifndef ANDROID_NEVER_ROUND_FONT_METRICS // We special case spaces in two ways when applying word rounding. // First, we round spaces to an adjusted width in all fonts. // Second, in fixed-pitch fonts we ensure that all characters that // match the width of the space character have the same width as the space character. if (width == fontData->m_spaceWidth && (fontData->m_treatAsFixedPitch || glyph == fontData->m_spaceGlyph) && m_run.applyWordRounding()) { width = fontData->m_adjustedSpaceWidth; - SIGNAL_ADJUSTED_WIDTHS(); } -#endif } if (hasExtraSpacing) { // Account for letter-spacing. if (width && m_font->letterSpacing()) { width += m_font->letterSpacing(); - SIGNAL_ADJUSTED_WIDTHS(); } if (Font::treatAsSpace(c)) { @@ -163,14 +149,12 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer) width += m_padPerSpace; m_padding -= m_padPerSpace; } - SIGNAL_ADJUSTED_WIDTHS(); } // Account for word spacing. // We apply additional space between "words" by adding width to the space character. if (currentCharacter != 0 && !Font::treatAsSpace(cp[-1]) && m_font->wordSpacing()) { width += m_font->wordSpacing(); - SIGNAL_ADJUSTED_WIDTHS(); } } } @@ -186,12 +170,10 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer) float oldWidth = width; -#ifndef ANDROID_NEVER_ROUND_FONT_METRICS // Force characters that are used to determine word boundaries for the rounding hack // to be integer width, so following words will start on an integer boundary. if (m_run.applyWordRounding() && Font::isRoundingHackCharacter(c)) { width = ceilf(width); - SIGNAL_ADJUSTED_WIDTHS(); } // Check to see if the next character is a "rounding hack character", if so, adjust @@ -200,9 +182,7 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer) || (m_run.applyRunRounding() && currentCharacter >= m_end)) { float totalWidth = runWidthSoFar + width; width += ceilf(totalWidth) - totalWidth; - SIGNAL_ADJUSTED_WIDTHS(); } -#endif runWidthSoFar += width; @@ -215,10 +195,6 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer) m_currentCharacter = currentCharacter; m_runWidthSoFar = runWidthSoFar; m_finalRoundingWidth = lastRoundingWidth; - -#ifdef ANDROID_GLYPHBUFFER_HAS_ADJUSTED_WIDTHS - return adjustedWidths; -#endif } bool WidthIterator::advanceOneCharacter(float& width, GlyphBuffer* glyphBuffer) |