Changeset 74005 in webkit
- Timestamp:
- Dec 13, 2010 10:58:06 PM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r74004 r74005 1 2010-12-13 takano takumi <takano@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 GlyphPage::fill() is slow on vertical writing (Mac) 6 https://bugs.webkit.org/show_bug.cgi?id=50865 7 8 No test. Just a performance improvement. 9 10 * platform/graphics/Font.cpp: 11 (WebCore::Font::isCJKIdeograph): Now this only checks pure ideographs (Hanji). 12 (WebCore::Font::isCJKIdeographOrSymbol): Added this for Hanji and Hanji related symbols. 13 * platform/graphics/Font.h: 14 * platform/graphics/FontFastPath.cpp: 15 (WebCore::Font::glyphDataForCharacter): Changed to call isCJKIdeographOrSymbol() instead of isCJKIdeograph(). 16 * platform/graphics/mac/GlyphPageTreeNodeMac.cpp: 17 (WebCore::shouldUseCoreText): This tests if GlyphPage::fill() should use CoreText or not. 18 For vertical writing, if the current page contains only ideographs, we go CG path. 19 (WebCore::GlyphPage::fill): Made to call shouldUseCoreText() and switch code path. 20 1 21 2010-12-13 Antonio Gomes <agomes@rim.com> 2 22 -
trunk/WebCore/platform/graphics/Font.cpp
r73706 r74005 339 339 bool Font::isCJKIdeograph(UChar32 c) 340 340 { 341 // The basic CJK Unified Ideographs block. 342 if (c >= 0x4E00 && c <= 0x9FFF) 343 return true; 344 345 // CJK Unified Ideographs Extension A. 346 if (c >= 0x3400 && c <= 0x4DBF) 347 return true; 348 349 // CJK Radicals Supplement. 350 if (c >= 0x2E80 && c <= 0x2EFF) 351 return true; 352 353 // Kangxi Radicals. 354 if (c >= 0x2F00 && c <= 0x2FDF) 355 return true; 356 357 // CJK Strokes. 358 if (c >= 0x31C0 && c <= 0x31EF) 359 return true; 360 361 // CJK Compatibility Ideographs. 362 if (c >= 0xF900 && c <= 0xFAFF) 363 return true; 364 365 // CJK Unified Ideographs Extension B. 366 if (c >= 0x20000 && c <= 0x2A6DF) 367 return true; 368 369 // CJK Unified Ideographs Extension C. 370 if (c >= 0x2A700 && c <= 0x2B73F) 371 return true; 372 373 // CJK Unified Ideographs Extension D. 374 if (c >= 0x2B740 && c <= 0x2B81F) 375 return true; 376 377 // CJK Compatibility Ideographs Supplement. 378 if (c >= 0x2F800 && c <= 0x2FA1F) 379 return true; 380 381 return false; 382 } 383 384 bool Font::isCJKIdeographOrSymbol(UChar32 c) 385 { 341 386 // 0x2C7 Caron, Mandarin Chinese 3rd Tone 342 387 // 0x2CA Modifier Letter Acute Accent, Mandarin Chinese 2nd Tone … … 346 391 return true; 347 392 348 // The basic CJK Unified Ideographs block.349 if (c >= 0x4E00 && c <= 0x9FFF)350 return true;351 352 // CJK Unified Ideographs Extension A.353 if (c >= 0x3400 && c <= 0x4DBF)354 return true;355 356 // CJK Radicals Supplement.357 if (c >= 0x2E80 && c <= 0x2EFF)358 return true;359 360 // Kangxi Radicals.361 if (c >= 0x2F00 && c <= 0x2FDF)362 return true;363 364 393 // Ideographic Description Characters. 365 394 if (c >= 0x2FF0 && c <= 0x2FFF) … … 378 407 return true; 379 408 380 // CJK Strokes.381 if (c >= 0x31C0 && c <= 0x31EF)382 return true;383 384 409 // Enclosed CJK Letters and Months. 385 410 if (c >= 0x3200 && c <= 0x32FF) … … 390 415 return true; 391 416 392 // CJK Compatibility Ideographs.393 if (c >= 0xF900 && c <= 0xFAFF)394 return true;395 396 417 // CJK Compatibility Forms. 397 418 if (c >= 0xFE30 && c <= 0xFE4F) … … 402 423 return true; 403 424 404 // CJK Unified Ideographs Extension B. 405 if (c >= 0x20000 && c <= 0x2A6DF) 406 return true; 407 408 // CJK Unified Ideographs Extension C. 409 if (c >= 0x2A700 && c <= 0x2B73F) 410 return true; 411 412 // CJK Unified Ideographs Extension D. 413 if (c >= 0x2B740 && c <= 0x2B81F) 414 return true; 415 416 // CJK Compatibility Ideographs Supplement. 417 if (c >= 0x2F800 && c <= 0x2FA1F) 418 return true; 419 420 return false; 421 } 422 423 } 425 return isCJKIdeograph(c); 426 } 427 428 } -
trunk/WebCore/platform/graphics/Font.h
r72165 r74005 145 145 146 146 static bool isCJKIdeograph(UChar32); 147 static bool isCJKIdeographOrSymbol(UChar32); 147 148 148 149 #if PLATFORM(QT) -
trunk/WebCore/platform/graphics/FontFastPath.cpp
r71970 r74005 76 76 GlyphData data = page->glyphDataForCharacter(c); 77 77 if (data.fontData) { 78 if (data.fontData->platformData().orientation() == Vertical && data.fontData->orientation() == Horizontal && Font::isCJKIdeograph (c)) {78 if (data.fontData->platformData().orientation() == Vertical && data.fontData->orientation() == Horizontal && Font::isCJKIdeographOrSymbol(c)) { 79 79 const SimpleFontData* ideographFontData = data.fontData->brokenIdeographFontData(); 80 80 GlyphPageTreeNode* ideographNode = GlyphPageTreeNode::getRootChild(ideographFontData, pageNumber); -
trunk/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
r71973 r74005 29 29 #include "config.h" 30 30 #include "GlyphPageTreeNode.h" 31 #include "Font.h" 31 32 32 33 #include "SimpleFontData.h" … … 36 37 namespace WebCore { 37 38 39 #ifndef BUILDING_ON_TIGER 40 static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData) 41 { 42 if (fontData->orientation() == Vertical && !fontData->isBrokenIdeographFont()) { 43 // Ideographs don't have a vertical variant. 44 for (unsigned i = 0; i < bufferLength; ++i) { 45 if (!Font::isCJKIdeograph(buffer[i])) 46 return true; 47 } 48 } 49 50 return false; 51 } 52 #endif 53 38 54 bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData) 39 55 { … … 41 57 42 58 #ifndef BUILDING_ON_TIGER 43 if ( fontData->orientation() == Horizontal || fontData->isBrokenIdeographFont()) {59 if (!shouldUseCoreText(buffer, bufferLength, fontData)) { 44 60 Vector<CGGlyph, 512> glyphs(bufferLength); 45 61 wkGetGlyphsForCharacters(fontData->platformData().cgFont(), buffer, glyphs.data(), bufferLength);
Note: See TracChangeset
for help on using the changeset viewer.