Changeset 83251 in webkit
- Timestamp:
- Apr 7, 2011 9:38:37 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83249 r83251 1 2011-04-07 Ned Holbrook <nholbrook@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 CTLine objects should outlive their CTRuns 6 https://bugs.webkit.org/show_bug.cgi?id=58063 7 8 * platform/graphics/mac/ComplexTextController.h: Add m_coreTextLines, to be destroyed after m_complexTextRuns. 9 * platform/graphics/mac/ComplexTextControllerCoreText.cpp: 10 (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Moot m_coreTextRun. 11 (WebCore::ComplexTextController::collectComplexTextRunsForCharactersCoreText): Append line to m_coreTextLines. 12 1 13 2011-04-07 Nat Duca <nduca@chromium.org> 2 14 -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.h
r82013 r83251 117 117 #endif 118 118 119 #if USE(CORE_TEXT)120 RetainPtr<CTRunRef> m_coreTextRun;121 #endif122 119 unsigned m_glyphCount; 123 120 const SimpleFontData* m_fontData; … … 160 157 Vector<UChar, 256> m_smallCapsBuffer; 161 158 159 #if USE(CORE_TEXT) 160 // Retain lines rather than their runs for better performance. 161 Vector<RetainPtr<CTLineRef> > m_coreTextLines; 162 #endif 162 163 Vector<RefPtr<ComplexTextRun>, 16> m_complexTextRuns; 163 164 Vector<CGSize, 256> m_adjustedAdvances; -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp
r80583 r83251 44 44 45 45 ComplexTextController::ComplexTextRun::ComplexTextRun(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange) 46 : m_coreTextRun(ctRun) 47 , m_fontData(fontData) 46 : m_fontData(fontData) 48 47 , m_characters(characters) 49 48 , m_stringLocation(stringLocation) … … 52 51 , m_isMonotonic(true) 53 52 { 54 m_glyphCount = CTRunGetGlyphCount( m_coreTextRun.get());55 m_coreTextIndices = CTRunGetStringIndicesPtr( m_coreTextRun.get());53 m_glyphCount = CTRunGetGlyphCount(ctRun); 54 m_coreTextIndices = CTRunGetStringIndicesPtr(ctRun); 56 55 if (!m_coreTextIndices) { 57 56 m_coreTextIndicesVector.grow(m_glyphCount); 58 CTRunGetStringIndices( m_coreTextRun.get(), CFRangeMake(0, 0), m_coreTextIndicesVector.data());57 CTRunGetStringIndices(ctRun, CFRangeMake(0, 0), m_coreTextIndicesVector.data()); 59 58 m_coreTextIndices = m_coreTextIndicesVector.data(); 60 59 } 61 60 62 m_glyphs = CTRunGetGlyphsPtr( m_coreTextRun.get());61 m_glyphs = CTRunGetGlyphsPtr(ctRun); 63 62 if (!m_glyphs) { 64 63 m_glyphsVector.grow(m_glyphCount); 65 CTRunGetGlyphs( m_coreTextRun.get(), CFRangeMake(0, 0), m_glyphsVector.data());64 CTRunGetGlyphs(ctRun, CFRangeMake(0, 0), m_glyphsVector.data()); 66 65 m_glyphs = m_glyphsVector.data(); 67 66 } 68 67 69 m_advances = CTRunGetAdvancesPtr( m_coreTextRun.get());68 m_advances = CTRunGetAdvancesPtr(ctRun); 70 69 if (!m_advances) { 71 70 m_advancesVector.grow(m_glyphCount); 72 CTRunGetAdvances( m_coreTextRun.get(), CFRangeMake(0, 0), m_advancesVector.data());71 CTRunGetAdvances(ctRun, CFRangeMake(0, 0), m_advancesVector.data()); 73 72 m_advances = m_advancesVector.data(); 74 73 } … … 160 159 } 161 160 161 m_coreTextLines.append(line.get()); 162 162 163 CFArrayRef runArray = CTLineGetGlyphRuns(line.get()); 163 164
Note: See TracChangeset
for help on using the changeset viewer.