[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 18:35:27 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit f48ada014e7ff1ccb59be4b604c81c2f2737bb65
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 14 06:58:06 2010 +0000

    2010-12-13  takano takumi  <takano at apple.com>
    
            Reviewed by Dan Bernstein.
    
            GlyphPage::fill() is slow on vertical writing (Mac)
            https://bugs.webkit.org/show_bug.cgi?id=50865
    
            No test. Just a performance improvement.
    
            * platform/graphics/Font.cpp:
            (WebCore::Font::isCJKIdeograph): Now this only checks pure ideographs (Hanji).
            (WebCore::Font::isCJKIdeographOrSymbol): Added this for Hanji and Hanji related symbols.
            * platform/graphics/Font.h:
            * platform/graphics/FontFastPath.cpp:
            (WebCore::Font::glyphDataForCharacter): Changed to call isCJKIdeographOrSymbol() instead of isCJKIdeograph().
            * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
            (WebCore::shouldUseCoreText): This tests if GlyphPage::fill() should use CoreText or not.
            For vertical writing, if the current page contains only ideographs, we go CG path.
            (WebCore::GlyphPage::fill): Made to call shouldUseCoreText() and switch code path.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74005 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index dbabf75..ee16688 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-12-13  takano takumi  <takano at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        GlyphPage::fill() is slow on vertical writing (Mac)
+        https://bugs.webkit.org/show_bug.cgi?id=50865
+
+        No test. Just a performance improvement.
+
+        * platform/graphics/Font.cpp:
+        (WebCore::Font::isCJKIdeograph): Now this only checks pure ideographs (Hanji).
+        (WebCore::Font::isCJKIdeographOrSymbol): Added this for Hanji and Hanji related symbols.
+        * platform/graphics/Font.h:
+        * platform/graphics/FontFastPath.cpp:
+        (WebCore::Font::glyphDataForCharacter): Changed to call isCJKIdeographOrSymbol() instead of isCJKIdeograph().
+        * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
+        (WebCore::shouldUseCoreText): This tests if GlyphPage::fill() should use CoreText or not.
+        For vertical writing, if the current page contains only ideographs, we go CG path.
+        (WebCore::GlyphPage::fill): Made to call shouldUseCoreText() and switch code path.
+
 2010-12-13  Antonio Gomes  <agomes at rim.com>
 
         Reviewed by Daniel Bates.
diff --git a/WebCore/platform/graphics/Font.cpp b/WebCore/platform/graphics/Font.cpp
index f123fcb..09b00f0 100644
--- a/WebCore/platform/graphics/Font.cpp
+++ b/WebCore/platform/graphics/Font.cpp
@@ -338,13 +338,6 @@ Font::CodePath Font::codePath(const TextRun& run) const
 
 bool Font::isCJKIdeograph(UChar32 c)
 {
-    // 0x2C7 Caron, Mandarin Chinese 3rd Tone
-    // 0x2CA Modifier Letter Acute Accent, Mandarin Chinese 2nd Tone
-    // 0x2CB Modifier Letter Grave Access, Mandarin Chinese 4th Tone 
-    // 0x2D9 Dot Above, Mandarin Chinese 5th Tone 
-    if ((c == 0x2C7) || (c == 0x2CA) || (c == 0x2CB) || (c == 0x2D9))
-        return true;
-
     // The basic CJK Unified Ideographs block.
     if (c >= 0x4E00 && c <= 0x9FFF)
         return true;
@@ -361,6 +354,42 @@ bool Font::isCJKIdeograph(UChar32 c)
     if (c >= 0x2F00 && c <= 0x2FDF)
         return true;
     
+    // CJK Strokes.
+    if (c >= 0x31C0 && c <= 0x31EF)
+        return true;
+    
+    // CJK Compatibility Ideographs.
+    if (c >= 0xF900 && c <= 0xFAFF)
+        return true;
+    
+    // CJK Unified Ideographs Extension B.
+    if (c >= 0x20000 && c <= 0x2A6DF)
+        return true;
+        
+    // CJK Unified Ideographs Extension C.
+    if (c >= 0x2A700 && c <= 0x2B73F)
+        return true;
+    
+    // CJK Unified Ideographs Extension D.
+    if (c >= 0x2B740 && c <= 0x2B81F)
+        return true;
+    
+    // CJK Compatibility Ideographs Supplement.
+    if (c >= 0x2F800 && c <= 0x2FA1F)
+        return true;
+
+    return false;
+}
+
+bool Font::isCJKIdeographOrSymbol(UChar32 c)
+{
+    // 0x2C7 Caron, Mandarin Chinese 3rd Tone
+    // 0x2CA Modifier Letter Acute Accent, Mandarin Chinese 2nd Tone
+    // 0x2CB Modifier Letter Grave Access, Mandarin Chinese 4th Tone 
+    // 0x2D9 Dot Above, Mandarin Chinese 5th Tone 
+    if ((c == 0x2C7) || (c == 0x2CA) || (c == 0x2CB) || (c == 0x2D9))
+        return true;
+
     // Ideographic Description Characters.
     if (c >= 0x2FF0 && c <= 0x2FFF)
         return true;
@@ -377,10 +406,6 @@ bool Font::isCJKIdeograph(UChar32 c)
     if (c >= 0x31A0 && c <= 0x31BF)
         return true;
  
-    // CJK Strokes.
-    if (c >= 0x31C0 && c <= 0x31EF)
-        return true;
-    
     // Enclosed CJK Letters and Months.
     if (c >= 0x3200 && c <= 0x32FF)
         return true;
@@ -389,10 +414,6 @@ bool Font::isCJKIdeograph(UChar32 c)
     if (c >= 0x3300 && c <= 0x33FF)
         return true;
     
-    // CJK Compatibility Ideographs.
-    if (c >= 0xF900 && c <= 0xFAFF)
-        return true;
-    
     // CJK Compatibility Forms.
     if (c >= 0xFE30 && c <= 0xFE4F)
         return true;
@@ -401,23 +422,7 @@ bool Font::isCJKIdeograph(UChar32 c)
     if (c >= 0x1F200 && c <= 0x1F6F)
         return true;
 
-    // CJK Unified Ideographs Extension B.
-    if (c >= 0x20000 && c <= 0x2A6DF)
-        return true;
-        
-    // CJK Unified Ideographs Extension C.
-    if (c >= 0x2A700 && c <= 0x2B73F)
-        return true;
-    
-    // CJK Unified Ideographs Extension D.
-    if (c >= 0x2B740 && c <= 0x2B81F)
-        return true;
-    
-    // CJK Compatibility Ideographs Supplement.
-    if (c >= 0x2F800 && c <= 0x2FA1F)
-        return true;
-
-    return false;
+    return isCJKIdeograph(c);
 }
 
 }
diff --git a/WebCore/platform/graphics/Font.h b/WebCore/platform/graphics/Font.h
index cb83ad2..56f6947 100644
--- a/WebCore/platform/graphics/Font.h
+++ b/WebCore/platform/graphics/Font.h
@@ -144,6 +144,7 @@ public:
     const FontData* fontDataForCharacters(const UChar*, int length) const;
 
     static bool isCJKIdeograph(UChar32);
+    static bool isCJKIdeographOrSymbol(UChar32);
     
 #if PLATFORM(QT)
     QFont font() const;
diff --git a/WebCore/platform/graphics/FontFastPath.cpp b/WebCore/platform/graphics/FontFastPath.cpp
index f0dd33e..1c3e571 100644
--- a/WebCore/platform/graphics/FontFastPath.cpp
+++ b/WebCore/platform/graphics/FontFastPath.cpp
@@ -75,7 +75,7 @@ GlyphData Font::glyphDataForCharacter(UChar32 c, bool mirror, bool forceSmallCap
             if (page) {
                 GlyphData data = page->glyphDataForCharacter(c);
                 if (data.fontData) {
-                    if (data.fontData->platformData().orientation() == Vertical && data.fontData->orientation() == Horizontal && Font::isCJKIdeograph(c)) {
+                    if (data.fontData->platformData().orientation() == Vertical && data.fontData->orientation() == Horizontal && Font::isCJKIdeographOrSymbol(c)) {
                         const SimpleFontData* ideographFontData = data.fontData->brokenIdeographFontData();
                         GlyphPageTreeNode* ideographNode = GlyphPageTreeNode::getRootChild(ideographFontData, pageNumber);
                         const GlyphPage* ideographPage = ideographNode->page();
diff --git a/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp b/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
index 9524cd2..5388c24 100644
--- a/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
+++ b/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
@@ -28,6 +28,7 @@
 
 #include "config.h"
 #include "GlyphPageTreeNode.h"
+#include "Font.h"
 
 #include "SimpleFontData.h"
 #include "WebCoreSystemInterface.h"
@@ -35,12 +36,27 @@
 
 namespace WebCore {
 
+#ifndef BUILDING_ON_TIGER
+static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
+{
+    if (fontData->orientation() == Vertical && !fontData->isBrokenIdeographFont()) {
+        // Ideographs don't have a vertical variant.
+        for (unsigned i = 0; i < bufferLength; ++i) {
+            if (!Font::isCJKIdeograph(buffer[i]))
+                return true;
+        }
+    }
+
+    return false;
+}
+#endif
+
 bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
 {
     bool haveGlyphs = false;
 
 #ifndef BUILDING_ON_TIGER
-    if (fontData->orientation() == Horizontal || fontData->isBrokenIdeographFont()) {
+    if (!shouldUseCoreText(buffer, bufferLength, fontData)) {
         Vector<CGGlyph, 512> glyphs(bufferLength);
         wkGetGlyphsForCharacters(fontData->platformData().cgFont(), buffer, glyphs.data(), bufferLength);
         for (unsigned i = 0; i < length; ++i) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list