Changeset 182192 in webkit
- Timestamp:
- Mar 31, 2015 11:53:25 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r182191 r182192 1 2015-03-31 Myles C. Maxfield <mmaxfield@apple.com> 2 3 Crash in CGContextShowGlyphsWithAdvances when passing kCGFontIndexInvalid 4 https://bugs.webkit.org/show_bug.cgi?id=143114 5 6 This is a workaround for <rdar://problem/20230073>. Please remove when it is no longer necessary. 7 8 Reviewed by Alexey Proskuryakov. 9 10 Covered by: 11 compositing/regions/floated-region-with-transformed-child.html 12 compositing/regions/floated-region-with-transformed-child-expected.html 13 fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005.html 14 fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005-expected.html 15 fast/regions/overflow/overflow-content-transform-rotate.html 16 fast/regions/overflow/overflow-content-transform-rotate-expected.html 17 18 * platform/graphics/GlyphBuffer.h: 19 (WebCore::GlyphBuffer::shrink): Performing shaping may remove glyphs, so we need to shrink the GlyphBuffer. 20 * platform/graphics/WidthIterator.cpp: 21 (WebCore::applyFontTransforms): Filter out kCGFontIndexInvalid. 22 (WebCore::WidthIterator::advanceInternal): Moved code into applyFontTransforms, and trigger the 23 shrink of the GlyphBuffer. 24 1 25 2015-03-31 Beth Dakin <bdakin@apple.com> 2 26 -
trunk/Source/WebCore/platform/graphics/GlyphBuffer.h
r178940 r182192 203 203 } 204 204 205 void shrink(int truncationPoint) 206 { 207 m_font.shrink(truncationPoint); 208 m_glyphs.shrink(truncationPoint); 209 m_advances.shrink(truncationPoint); 210 if (m_offsetsInString) 211 m_offsetsInString->shrink(truncationPoint); 212 #if PLATFORM(WIN) 213 m_offsets.shrink(truncationPoint); 214 #endif 215 } 216 205 217 private: 206 218 void swap(int index1, int index2) -
trunk/Source/WebCore/platform/graphics/WidthIterator.cpp
r181597 r182192 109 109 110 110 int glyphBufferSize = glyphBuffer->size(); 111 if (glyphBuffer->size() <= lastGlyphCount + 1) 111 if (glyphBuffer->size() <= lastGlyphCount + 1) { 112 lastGlyphCount = glyphBufferSize; 112 113 return 0; 114 } 113 115 114 116 GlyphBufferAdvance* advances = glyphBuffer->advances(0); … … 146 148 } 147 149 charactersTreatedAsSpace.clear(); 150 151 #if PLATFORM(MAC) || PLATFORM(IOS) 152 // Workaround for <rdar://problem/20230073> FIXME: Please remove this when no longer needed. 153 GlyphBufferGlyph* glyphs = glyphBuffer->glyphs(0); 154 int filteredIndex = lastGlyphCount; 155 for (int i = lastGlyphCount; i < glyphBufferSize; ++i) { 156 glyphs[filteredIndex] = glyphs[i]; 157 advances[filteredIndex] = advances[i]; 158 if (glyphs[filteredIndex] != kCGFontIndexInvalid) 159 ++filteredIndex; 160 } 161 glyphBufferSize = filteredIndex; 162 #endif 148 163 149 164 for (int i = lastGlyphCount; i < glyphBufferSize; ++i) … … 208 223 if (shouldApplyFontTransforms()) { 209 224 m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, *this, m_typesettingFeatures, charactersTreatedAsSpace); 210 lastGlyphCount = glyphBuffer->size(); // applyFontTransforms doesn't update when there had been only one glyph. 225 if (glyphBuffer) 226 glyphBuffer->shrink(lastGlyphCount); 211 227 } 212 228 … … 326 342 } 327 343 328 if (shouldApplyFontTransforms()) 344 if (shouldApplyFontTransforms()) { 329 345 m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, *this, m_typesettingFeatures, charactersTreatedAsSpace); 346 if (glyphBuffer) 347 glyphBuffer->shrink(lastGlyphCount); 348 } 330 349 331 350 unsigned consumedCharacters = textIterator.currentCharacter() - m_currentCharacter;
Note: See TracChangeset
for help on using the changeset viewer.