Source/WebCore: <rdar://problem/9589433> Displaying Japanese dictionary contents...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jul 2011 16:33:33 +0000 (16:33 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jul 2011 16:33:33 +0000 (16:33 +0000)
Reviewed by Darin Adler.

* WebCore.exp.in: Exported wkGetVerticalGlyphsForCharacters.
* platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
(WebCore::GlyphPage::fill): Use wkGetVerticalGlyphsForCharacters. If it returns false, proceed
with the existing, slower method of getting vertical glyphs.
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

Source/WebKit/mac: <rdar://problem/9589433> Displaying Japanese dictionary contents in vertical orientation takes a couple of seconds

Reviewed by Darin Adler.

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Initialize wkGetVerticalGlyphsForCharacters.

Source/WebKit2: <rdar://problem/9589433> Displaying Japanese dictionary contents in vertical orientation takes a couple of seconds

Reviewed by Darin Adler.

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Initialize wkGetVerticalGlyphsForCharacters.

WebKitLibraries: WebKitSystemInterface support for
<rdar://problem/9589433> Displaying Japanese dictionary contents in vertical orientation takes a couple of seconds

Reviewed by Darin Adler.

* WebKitSystemInterface.h: Added WKGetVerticalGlyphsForCharacters().
* libWebKitSystemInterfaceLeopard.a:
* libWebKitSystemInterfaceLion.a:
* libWebKitSystemInterfaceSnowLeopard.a:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@91935 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLeopard.a
WebKitLibraries/libWebKitSystemInterfaceLion.a
WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a

index a2340f7..6932e9b 100644 (file)
@@ -1,3 +1,16 @@
+2011-07-28  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/9589433> Displaying Japanese dictionary contents in vertical orientation takes a couple of seconds
+
+        Reviewed by Darin Adler.
+
+        * WebCore.exp.in: Exported wkGetVerticalGlyphsForCharacters.
+        * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
+        (WebCore::GlyphPage::fill): Use wkGetVerticalGlyphsForCharacters. If it returns false, proceed
+        with the existing, slower method of getting vertical glyphs.
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+
 2011-07-28  Brady Eidson  <beidson@apple.com>
 
         <rdar://problem/9714337> and https://bugs.webkit.org/show_bug.cgi?id=65306
index 5048678..696a42f 100644 (file)
@@ -1384,6 +1384,7 @@ _wkGetNSURLResponseLastModifiedDate
 _wkGetNSURLResponseMustRevalidate
 _wkGetPreferredExtensionForMIMEType
 _wkGetUserToBaseCTM
+_wkGetVerticalGlyphsForCharacters
 _wkGetWheelEventDeltas
 _wkHTTPCookiesForURL
 _wkHitTestMediaUIPart
index 17ea7aa..d07f4dc 100644 (file)
@@ -53,8 +53,8 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
 {
     bool haveGlyphs = false;
 
+    Vector<CGGlyph, 512> glyphs(bufferLength);
     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) {
             if (!glyphs[i])
@@ -64,6 +64,15 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
                 haveGlyphs = true;
             }
         }
+    } else if (wkGetVerticalGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength)) {
+        for (unsigned i = 0; i < length; ++i) {
+            if (!glyphs[i])
+                setGlyphDataForIndex(offset + i, 0, 0);
+            else {
+                setGlyphDataForIndex(offset + i, glyphs[i], fontData);
+                haveGlyphs = true;
+            }
+        }
     } else {
         // We ask CoreText for possible vertical variant glyphs
         RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, buffer, bufferLength, kCFAllocatorNull));
index 755286c..fa3d73f 100644 (file)
@@ -46,6 +46,7 @@ typedef struct __CFRunLoop * CFRunLoopRef;
 typedef struct __CFHTTPMessage *CFHTTPMessageRef;
 typedef struct _CFURLResponse *CFURLResponseRef;
 typedef const struct _CFURLRequest *CFURLRequestRef;
+typedef const struct __CTFont * CTFontRef;
 typedef const struct __CTLine * CTLineRef;
 typedef const struct __CTTypesetter * CTTypesetterRef;
 typedef const struct __AXUIElement *AXUIElementRef;
@@ -221,6 +222,7 @@ extern void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFString
 extern CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL);
 
 extern void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], size_t);
+extern bool (*wkGetVerticalGlyphsForCharacters)(CTFontRef, const UniChar[], CGGlyph[], size_t);
 
 extern BOOL (*wkUseSharedMediaUI)();
 
index 94e97bc..57f6430 100644 (file)
@@ -117,6 +117,7 @@ void (*wkSetRequestStorageSession)(CFURLStorageSessionRef, CFMutableURLRequestRe
 #endif
 
 void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], size_t);
+bool (*wkGetVerticalGlyphsForCharacters)(CTFontRef, const UniChar[], CGGlyph[], size_t);
 
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
 void* wkGetHyphenationLocationBeforeIndex;
index cec0a36..e0f0981 100644 (file)
@@ -1,3 +1,12 @@
+2011-07-28  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/9589433> Displaying Japanese dictionary contents in vertical orientation takes a couple of seconds
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface): Initialize wkGetVerticalGlyphsForCharacters.
+
 2011-07-28  Brady Eidson  <beidson@apple.com>
 
         <rdar://problem/9714337> and https://bugs.webkit.org/show_bug.cgi?id=65306
index 69b7342..729bfac 100644 (file)
@@ -109,6 +109,7 @@ void InitWebCoreSystemInterface(void)
     INIT(QTClearMediaDownloadCache);
 
     INIT(GetGlyphsForCharacters);
+    INIT(GetVerticalGlyphsForCharacters);
 
 #if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
     INIT(GetHyphenationLocationBeforeIndex);
index 7cf7b58..c481c4e 100644 (file)
@@ -1,3 +1,12 @@
+2011-07-28  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/9589433> Displaying Japanese dictionary contents in vertical orientation takes a couple of seconds
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface): Initialize wkGetVerticalGlyphsForCharacters.
+
 2011-07-28  Brady Eidson  <beidson@apple.com>
 
         <rdar://problem/9714337> and https://bugs.webkit.org/show_bug.cgi?id=65306
index 5a8f54d..1a85929 100644 (file)
@@ -56,6 +56,7 @@ void InitWebCoreSystemInterface(void)
         INIT(GetFontInLanguageForRange);
         INIT(GetGlyphTransformedAdvances);
         INIT(GetGlyphsForCharacters);
+        INIT(GetVerticalGlyphsForCharacters);
         INIT(GetHTTPPipeliningPriority);
         INIT(GetMIMETypeForExtension);
         INIT(GetNSURLResponseLastModifiedDate);
index 8cbf067..543dcee 100644 (file)
@@ -1,3 +1,15 @@
+2011-07-28  Dan Bernstein  <mitz@apple.com>
+
+        WebKitSystemInterface support for
+        <rdar://problem/9589433> Displaying Japanese dictionary contents in vertical orientation takes a couple of seconds
+
+        Reviewed by Darin Adler.
+
+        * WebKitSystemInterface.h: Added WKGetVerticalGlyphsForCharacters().
+        * libWebKitSystemInterfaceLeopard.a:
+        * libWebKitSystemInterfaceLion.a:
+        * libWebKitSystemInterfaceSnowLeopard.a:
+
 2011-07-22  Jessie Berlin  <jberlin@apple.com>
 
         [WebKit2] Changing the cookie accept policy in Private Browsing doesn’t work.
index 8317b37..9f03302 100644 (file)
@@ -153,6 +153,7 @@ void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
 
 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
+bool WKGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], size_t);
 
 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
index 93aff72..7aae6c4 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index 9802e44..34c7277 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLion.a and b/WebKitLibraries/libWebKitSystemInterfaceLion.a differ
index 3b674bf..cabb624 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a differ