Changeset 71795 in webkit
- Timestamp:
- Nov 10, 2010, 9:18:54 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r71791 r71795 1 2010-11-10 Ned Holbrook <nholbrook@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Allow for the possibility of CoreText generating multiple runs for a single text run. 6 https://bugs.webkit.org/show_bug.cgi?id=49353 7 8 * platform/graphics/mac/ComplexTextController.h: 9 (WebCore::ComplexTextController::ComplexTextRun::create): 10 * platform/graphics/mac/ComplexTextControllerCoreText.cpp: 11 (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): 12 (WebCore::ComplexTextController::collectComplexTextRunsForCharactersCoreText): 13 1 14 2010-10-15 Martin Robinson <mrobinson@igalia.com> 2 15 -
trunk/WebCore/platform/graphics/mac/ComplexTextController.h
r71787 r71795 73 73 public: 74 74 #if USE(CORE_TEXT) 75 static PassRefPtr<ComplexTextRun> create(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength)75 static PassRefPtr<ComplexTextRun> create(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, CFRange runRange) 76 76 { 77 return adoptRef(new ComplexTextRun(ctRun, fontData, characters, stringLocation, stringLength));77 return adoptRef(new ComplexTextRun(ctRun, fontData, characters, stringLocation, runRange)); 78 78 } 79 79 #endif … … 103 103 private: 104 104 #if USE(CORE_TEXT) 105 ComplexTextRun(CTRunRef, const SimpleFontData*, const UChar* characters, unsigned stringLocation, size_t stringLength);105 ComplexTextRun(CTRunRef, const SimpleFontData*, const UChar* characters, unsigned stringLocation, CFRange runRange); 106 106 void createTextRunFromFontDataCoreText(bool ltr); 107 107 #endif -
trunk/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp
r71598 r71795 42 42 namespace WebCore { 43 43 44 ComplexTextController::ComplexTextRun::ComplexTextRun(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength)44 ComplexTextController::ComplexTextRun::ComplexTextRun(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, CFRange runRange) 45 45 : m_coreTextRun(ctRun) 46 46 , m_fontData(fontData) 47 , m_characters(characters )48 , m_stringLocation(stringLocation )49 , m_stringLength( stringLength)47 , m_characters(characters + runRange.location) 48 , m_stringLocation(stringLocation + runRange.location) 49 , m_stringLength(runRange.length) 50 50 , m_isMonotonic(true) 51 51 { 52 52 m_glyphCount = CTRunGetGlyphCount(m_coreTextRun.get()); 53 m_coreTextIndices = CTRunGetStringIndicesPtr(m_coreTextRun.get());53 m_coreTextIndices = runRange.location ? 0 : CTRunGetStringIndicesPtr(m_coreTextRun.get()); 54 54 if (!m_coreTextIndices) { 55 55 m_coreTextIndicesVector.grow(m_glyphCount); 56 56 CTRunGetStringIndices(m_coreTextRun.get(), CFRangeMake(0, 0), m_coreTextIndicesVector.data()); 57 if (runRange.location) 58 for (unsigned i = 0; i < m_glyphCount; ++i) 59 m_coreTextIndicesVector[i] -= runRange.location; 57 60 m_coreTextIndices = m_coreTextIndicesVector.data(); 58 61 } … … 165 168 CTRunRef ctRun = static_cast<CTRunRef>(CFArrayGetValueAtIndex(runArray, r)); 166 169 ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID()); 167 m_complexTextRuns.append(ComplexTextRun::create(ctRun, fontData, cp, stringLocation, length)); 170 CFRange runRange = CTRunGetStringRange(ctRun); 171 m_complexTextRuns.append(ComplexTextRun::create(ctRun, fontData, cp, stringLocation, runRange)); 168 172 } 169 173 }
Note:
See TracChangeset
for help on using the changeset viewer.