Changeset 129664 in webkit
- Timestamp:
- Sep 26, 2012, 10:26:18 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r129649 r129664 1 2012-09-26 Michael Saboff <msaboff@apple.com> 2 3 Update ComplexTextController for 8 bit TextRun changes 4 https://bugs.webkit.org/show_bug.cgi?id=97378 5 6 Reviewed by Geoffrey Garen. 7 8 Add a new create method to make a 16 bit string from 8 bit source data. This is used in 9 ComplexTextController when we have LChar* + length text data, but we really want 16 bit 10 data for the complex text rendering code. 11 12 * wtf/text/WTFString.cpp: 13 (WTF::String::make16BitFrom8BitSource): 14 (WTF): 15 * wtf/text/WTFString.h: 16 (String): 17 1 18 2012-09-26 Ilya Tikhonovsky <loislo@chromium.org> 2 19 -
trunk/Source/WTF/wtf/text/WTFString.cpp
r129165 r129664 779 779 } 780 780 781 String String::make16BitFrom8BitSource(const LChar* source, size_t length) 782 { 783 if (!length) 784 return String(); 785 786 UChar* destination; 787 String result = String::createUninitialized(length, destination); 788 789 StringImpl::copyChars(destination, source, length); 790 791 return result; 792 } 793 781 794 String String::fromUTF8(const LChar* stringStart, size_t length) 782 795 { -
trunk/Source/WTF/wtf/text/WTFString.h
r129433 r129664 415 415 416 416 WTF_EXPORT_STRING_API static String make8BitFrom16BitSource(const UChar*, size_t); 417 WTF_EXPORT_STRING_API static String make16BitFrom8BitSource(const LChar*, size_t); 417 418 418 419 // String::fromUTF8 will return a null string if -
trunk/Source/WebCore/ChangeLog
r129662 r129664 1 2012-09-26 Michael Saboff <msaboff@apple.com> 2 3 Update ComplexTextController for 8 bit TextRun changes 4 https://bugs.webkit.org/show_bug.cgi?id=97378 5 6 Reviewed by Geoffrey Garen. 7 8 Since the ComplextTextController code is primarily used for UChar data, just upconvert an 8 bit 9 TextRun into a new String and hold on to the String with a vector for the life of the controller. 10 11 No change in functionality, therefore no new tests. 12 13 * platform/graphics/mac/ComplexTextController.cpp: 14 (WebCore::ComplexTextController::ComplexTextController): 15 (WebCore::ComplexTextController::collectComplexTextRuns): 16 * platform/graphics/mac/ComplexTextController.h: 17 (ComplexTextController): 18 1 19 2012-09-26 Michael Saboff <msaboff@apple.com> 2 20 -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
r129389 r129664 143 143 else { 144 144 bool isAfterExpansion = m_afterExpansion; 145 unsigned expansionOpportunityCount = Font::expansionOpportunityCount(m_run.characters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion); 145 unsigned expansionOpportunityCount; 146 if (m_run.is8Bit()) 147 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.characters8(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion); 148 else 149 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.characters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion); 146 150 if (isAfterExpansion && !m_run.allowsTrailingExpansion()) 147 151 expansionOpportunityCount--; … … 285 289 286 290 // We break up glyph run generation for the string by FontData. 287 const UChar* cp = m_run.characters16(); 291 const UChar* cp; 292 293 if (m_run.is8Bit()) { 294 String stringFor8BitRun = String::make16BitFrom8BitSource(m_run.characters8(), m_run.length()); 295 cp = stringFor8BitRun.characters16(); 296 m_stringsFor8BitRuns.append(stringFor8BitRun); 297 } else 298 cp = m_run.characters16(); 288 299 289 300 if (m_font.isSmallCaps()) -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.h
r126763 r129664 32 32 #include <wtf/RetainPtr.h> 33 33 #include <wtf/Vector.h> 34 #include <wtf/text/WTFString.h> 34 35 #include <wtf/unicode/Unicode.h> 35 36 … … 144 145 bool m_forTextEmphasis; 145 146 147 Vector<String> m_stringsFor8BitRuns; 146 148 Vector<UChar, 256> m_smallCapsBuffer; 147 149
Note:
See TracChangeset
for help on using the changeset viewer.