Changeset 90798 in webkit
- Timestamp:
- Jul 11, 2011 5:39:46 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r90795 r90798 1 2011-07-11 Dan Bernstein <mitz@apple.com> 2 3 Excessive expansion of justified text when rounding hacks are enabled 4 https://bugs.webkit.org/show_bug.cgi?id=64331 5 6 Reviewed by Anders Carlsson. 7 8 * platform/mac/fast/text/rounding-hacks-expansion.html: Added. 9 * platform/mac/platform/mac/fast/text/rounding-hacks-expansion-expected.png: Added. 10 * platform/mac/platform/mac/fast/text/rounding-hacks-expansion-expected.txt: Added. 11 1 12 2011-07-11 Ojan Vafai <ojan@chromium.org> 2 13 -
trunk/Source/WebCore/ChangeLog
r90797 r90798 1 2011-07-11 Dan Bernstein <mitz@apple.com> 2 3 Excessive expansion of justified text when rounding hacks are enabled 4 https://bugs.webkit.org/show_bug.cgi?id=64331 5 6 Reviewed by Anders Carlsson. 7 8 Test: platform/mac/fast/text/rounding-hacks-expansion.html 9 10 When rounding hacks are enabled, the expansion at each expansion opportunity should be by an 11 integer. Restored more of the logic that was removed in r78846 in order to ensure this. 12 13 * platform/graphics/WidthIterator.cpp: 14 (WebCore::WidthIterator::advance): 15 * platform/graphics/mac/ComplexTextController.cpp: 16 (WebCore::ComplexTextController::adjustGlyphsAndAdvances): 17 1 18 2011-07-11 Jer Noble <jer.noble@apple.com> 2 19 -
trunk/Source/WebCore/platform/graphics/WidthIterator.cpp
r89733 r90798 162 162 // Distribute the run's total expansion evenly over all expansion opportunities in the run. 163 163 if (m_expansion) { 164 float previousExpansion = m_expansion; 164 165 if (!treatAsSpace && !m_isAfterExpansion) { 165 166 // Take the expansion opportunity before this ideograph. 166 167 m_expansion -= m_expansionPerOpportunity; 167 m_runWidthSoFar += m_expansionPerOpportunity; 168 float expansionAtThisOpportunity = !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion); 169 m_runWidthSoFar += expansionAtThisOpportunity; 168 170 if (glyphBuffer) { 169 171 if (glyphBuffer->isEmpty()) 170 glyphBuffer->add(fontData->spaceGlyph(), fontData, m_expansionPerOpportunity);172 glyphBuffer->add(fontData->spaceGlyph(), fontData, expansionAtThisOpportunity); 171 173 else 172 glyphBuffer->expandLastAdvance( m_expansionPerOpportunity);174 glyphBuffer->expandLastAdvance(expansionAtThisOpportunity); 173 175 } 176 previousExpansion = m_expansion; 174 177 } 175 178 if (m_run.allowsTrailingExpansion() || (m_run.ltr() && textIterator.currentCharacter() + advanceLength < static_cast<size_t>(m_run.length())) 176 179 || (m_run.rtl() && textIterator.currentCharacter())) { 177 180 m_expansion -= m_expansionPerOpportunity; 178 width += m_expansionPerOpportunity;181 width += !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion); 179 182 m_isAfterExpansion = true; 180 183 } -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
r89733 r90798 490 490 // Distribute the run's total expansion evenly over all expansion opportunities in the run. 491 491 if (m_expansion) { 492 float previousExpansion = m_expansion; 492 493 if (!treatAsSpace && !m_afterExpansion) { 493 494 // Take the expansion opportunity before this ideograph. 494 495 m_expansion -= m_expansionPerOpportunity; 495 m_totalWidth += m_expansionPerOpportunity; 496 float expansionAtThisOpportunity = !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion); 497 m_totalWidth += expansionAtThisOpportunity; 496 498 if (m_adjustedAdvances.isEmpty()) 497 m_leadingExpansion = m_expansionPerOpportunity;499 m_leadingExpansion = expansionAtThisOpportunity; 498 500 else 499 m_adjustedAdvances.last().width += m_expansionPerOpportunity; 501 m_adjustedAdvances.last().width += expansionAtThisOpportunity; 502 previousExpansion = m_expansion; 500 503 } 501 504 if (!lastGlyph || m_run.allowsTrailingExpansion()) { 502 505 m_expansion -= m_expansionPerOpportunity; 503 advance.width += m_expansionPerOpportunity;506 advance.width += !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion); 504 507 m_afterExpansion = true; 505 508 }
Note: See TracChangeset
for help on using the changeset viewer.