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 a2340f796f28a8a5f7fbd44cc4967a96c008ba7c..6932e9bad243bc60034e029793586cfd1c39127f 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 5048678033eccda247f9fe1248bca8b7eed0fd4c..696a42f300e2a8de4c4841546f193c2252ff9768 100644 (file)
@@ -1384,6 +1384,7 @@ _wkGetNSURLResponseLastModifiedDate
 _wkGetNSURLResponseMustRevalidate
 _wkGetPreferredExtensionForMIMEType
 _wkGetUserToBaseCTM
+_wkGetVerticalGlyphsForCharacters
 _wkGetWheelEventDeltas
 _wkHTTPCookiesForURL
 _wkHitTestMediaUIPart
index 17ea7aa85e966123a4bc04b962b5516809e203b0..d07f4dc17d99e7b7306153a1fd0c747844c933d2 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 755286c915d93a8c231080ff6096cb20b80de9d5..fa3d73f5f1a8e6da69cea7fd15a79646b1aea4a2 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 94e97bc9e16c8960fd500ea064b3a3975ac412ef..57f6430462fcff74c1ff70c79a9cee2f5c0cd058 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 cec0a36937b629a4535044123758228578cc676d..e0f09810a8fbf3361fb4d28369bf39a5e7a8c160 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 69b734253ea4e1057bfc05eb48bbc3979fd07c6f..729bfac0854f22bb8b58c24dd894d5dc57c1dfa1 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 7cf7b5868051717227ebc3db77993b2f716766b4..c481c4e24116e32d3fd517090bb24728248321f9 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 5a8f54d2b8167ba64fe653706f7d2ebb486072cd..1a85929b7e138933358412ef1a49fd1ba55964ff 100644 (file)
@@ -56,6 +56,7 @@ void InitWebCoreSystemInterface(void)
         INIT(GetFontInLanguageForRange);
         INIT(GetGlyphTransformedAdvances);
         INIT(GetGlyphsForCharacters);
+        INIT(GetVerticalGlyphsForCharacters);
         INIT(GetHTTPPipeliningPriority);
         INIT(GetMIMETypeForExtension);
         INIT(GetNSURLResponseLastModifiedDate);
index 8cbf0673217cacb4672037af16e6c99013dc67eb..543dcee374bbbcab85498721dcca084998f6dc63 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 8317b379412299ace871f818c88b2bdb35ed1cbf..9f0330285c74ce3381980eb38436f0e40e9e7266 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 93aff72da81db155541a14d6dce37e7920900ff7..7aae6c4d76878fcb29c08de7cd123cb6d106c2ba 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index 9802e44cd0ad396022fbaaf557b93039901b6458..34c72772c9855ffdcb920bb771a906c1f0d68713 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLion.a and b/WebKitLibraries/libWebKitSystemInterfaceLion.a differ
index 3b674bfe9f246fe18db3cde98018633118f260d5..cabb624c4fd081c58915804c616e064e45d37500 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a differ