- more SPI removal, for font cache and CFStream
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Jun 2005 13:26:17 +0000 (13:26 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Jun 2005 13:26:17 +0000 (13:26 +0000)
        * WebCoreSupport.subproj/WebTextRendererFactory.m:
        (getLCDScaleParameters):
        (+[WebTextRendererFactory createSharedFactory]):
        * WebView.subproj/WebFormDataStream.m:
        (formCanRead):
        (formEventCallback):
        (webSetHTTPBody):

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

WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
WebKit/WebView.subproj/WebFormDataStream.m

index 08f57d82d3b4ad930317aadd808d1df924f029a7..4da6c0073ae3fd1ece058611214ff3f716645d2a 100644 (file)
@@ -1,3 +1,15 @@
+2005-06-06  Maciej Stachowiak  <mjs@apple.com>
+
+        - more SPI removal, for font cache and CFStream
+
+        * WebCoreSupport.subproj/WebTextRendererFactory.m:
+        (getLCDScaleParameters):
+        (+[WebTextRendererFactory createSharedFactory]):
+        * WebView.subproj/WebFormDataStream.m:
+        (formCanRead):
+        (formEventCallback):
+        (webSetHTTPBody):
+
 2005-06-06  Maciej Stachowiak  <mjs@apple.com>
 
         - remove use of AX SPI
index 0013507b662dfbb144c08149af39a63c3295ff7d..7737dee9a12aa2dfa7afa534054e4a5de5bc806b 100644 (file)
 #import <WebKit/WebPreferences.h>
 #import <WebKit/WebTextRendererFactory.h>
 #import <WebKit/WebTextRenderer.h>
-
-#import <CoreGraphics/CoreGraphicsPrivate.h>
-#import <CoreGraphics/CGFontLCDSupport.h>
-#import <CoreGraphics/CGFontCache.h>
+#import <WebKitSystemInterface.h>
 
 #import <mach-o/dyld.h>
 
@@ -191,15 +188,10 @@ static int getLCDScaleParameters(void)
             return 1;
     }
 
-    switch (mode) {
-        case kCGFontSmoothingLCDLight:
-        case kCGFontSmoothingLCDMedium:
-        case kCGFontSmoothingLCDStrong:
-            return 4;
-        default:
-            return 1;
-    }
-
+       if (WKFontSmoothingModeIsLCD(mode))
+               return 4;
+       else
+               return 1;
 }
 
 static CFMutableDictionaryRef fontCache;
@@ -244,25 +236,15 @@ fontsChanged( ATSFontNotificationInfoRef info, void *_factory)
     if (![self sharedFactory]) {
         [[[self alloc] init] release];
 
-#if !defined(BUILDING_ON_PANTHER)
-       // Turn on local font cache, in addition to the system cache.
-       // See 3835148
-       CGFontSetShouldUseMulticache(true);
-#endif
-       
-        CGFontCache *fontCache;
-        fontCache = CGFontCacheGetLocalCache();
-        CGFontCacheSetShouldAutoExpire (fontCache, false);
-
-        size_t s;
-        if (WebSystemMainMemory() > 128 * 1024 * 1024)
-            s = MINIMUM_GLYPH_CACHE_SIZE*getLCDScaleParameters();
-        else
-            s = MINIMUM_GLYPH_CACHE_SIZE;
+       size_t s;
+       if (WebSystemMainMemory() > 128 * 1024 * 1024)
+               s = MINIMUM_GLYPH_CACHE_SIZE*getLCDScaleParameters();
+       else
+               s = MINIMUM_GLYPH_CACHE_SIZE;
 #ifndef NDEBUG
-        LOG (CacheSizes, "Glyph cache size set to %d bytes.", s);
+       LOG (CacheSizes, "Glyph cache size set to %d bytes.", s);
 #endif
-        CGFontCacheSetMaxSize (fontCache, s);
+       WKSetUpFontCache(s);
 
         // Ignore errors returned from ATSFontNotificationSubscribe.  If we can't subscribe then we
         // won't be told about changes to fonts.
index 3da3e44b0c497a91e0271a7a155a14aad45f3fb7..5d3bff9b5817b3caf551e2f8880916e47ecef62a 100644 (file)
 #import <sys/types.h>
 #import <sys/stat.h>
 
-#import <CoreFoundation/CFStreamAbstract.h>
-
 #import "WebAssertions.h"
 #import "WebNSObjectExtras.h"
+#import <WebKitSystemInterface.h>
 
 #if !BUILDING_ON_PANTHER
 
@@ -227,7 +226,7 @@ static Boolean formCanRead(CFReadStreamRef stream, void *context)
         openNextStream(form);
     }
     if (!form->currentStream) {
-        CFReadStreamSignalEvent(stream, kCFStreamEventEndEncountered, NULL);
+               WKSignalCFReadStreamEnd(stream);
         return FALSE;
     }
     return CFReadStreamHasBytesAvailable(form->currentStream);
@@ -268,17 +267,17 @@ static void formEventCallback(CFReadStreamRef stream, CFStreamEventType type, vo
 
     switch (type) {
     case kCFStreamEventHasBytesAvailable:
-        CFReadStreamSignalEvent(form->formStream, kCFStreamEventHasBytesAvailable, NULL);
+        WKSignalCFReadStreamHasBytes(form->formStream);
         break;
     case kCFStreamEventErrorOccurred: {
         CFStreamError readStreamError = CFReadStreamGetError(stream);
-        CFReadStreamSignalEvent(form->formStream, kCFStreamEventErrorOccurred, &readStreamError);
+        WKSignalCFReadStreamError(form->formStream, &readStreamError);
         break;
     }
     case kCFStreamEventEndEncountered:
         openNextStream(form);
         if (!form->currentStream) {
-            CFReadStreamSignalEvent(form->formStream, kCFStreamEventEndEncountered, NULL);
+            WKSignalCFReadStreamEnd(form->formStream);
         }
         break;
     case kCFStreamEventNone:
@@ -335,12 +334,8 @@ void webSetHTTPBody(NSMutableURLRequest *request, NSArray *formData)
     [request setValue:[NSString stringWithFormat:@"%lld", length] forHTTPHeaderField:@"Content-Length"];
 
     // Create and set the stream.
-    CFReadStreamCallBacks callBacks = { 1, formCreate, formFinalize, NULL,
-        formOpen, NULL, formRead, NULL, formCanRead, formClose,
-        NULL, NULL, NULL, formSchedule, formUnschedule
-    };
-    CFReadStreamRef stream = CFReadStreamCreate(NULL, &callBacks, formData);
-    [request setHTTPBodyStream:(NSInputStream *)stream];
+       CFReadStreamRef stream = WKCreateCustomCFReadStream(formCreate, formFinalize, formOpen, formRead, formCanRead, formClose, formSchedule, formUnschedule, formData);
+       [request setHTTPBodyStream:(NSInputStream *)stream];
     CFRelease(stream);
 
 #else