Changeset 14480

Show
Ignore:
Timestamp:
2006-05-18 14:28:47 (2 years ago)
Author:
tomernic
Message:

Reviewed by John Sullivan.

<rdar://problem/4551938> More options needed for window display throttle

We decided to play it safe and leave our window flushing behavior unchanged from the previous
public release. By default, CoreGraphics deferred updates are once again OFF, and the window
display throttle is OFF.

Individual applications should set the WebKitThrottleWindowDisplayPreferenceKey and
WebKitEnableDeferredUpdatesPreferenceKey defaults to suit their needs.

Old behavior (like 10.4.6): WebKitThrottleWindowDisplayPreferenceKey=0 (or unset),
WebKitEnableDeferredUpdatesPreferenceKey (or unset).

Tear-free scrolling/animations: WebKitThrottleWindowDisplayPreferenceKey=0 (or unset),
WebKitEnableDeferredUpdatesPreferenceKey=1. While this configuration fixes the tearing issues
caused by over-flushing, some applications will experience performance problems as over-flushing
with CG deferred updates enabled will cause the app to block.

Tear-free scrolling/animations, high performance: WebKitThrottleWindowDisplayPreferenceKey=1,
WebKitEnableDeferredUpdatesPreferenceKey=1. This is the riskiest configuration in that it
enables the window display throttle "feature", potentially breaking applications' assumptions
about when displays occur. However, it provides the "best of both worlds", in that updates
are tear-free, and performance impact should me minimal.

  • WebView/WebPreferenceKeysPrivate.h:
    Declared WebKitThrottleWindowDisplayPreferenceKey and WebKitEnableDeferredUpdatesPreferenceKey.
  • WebView/WebFrameView.m:
    (-initWithFrame:):
    Turn off CG deferred updates if WebKitEnableDeferredUpdatesPreferenceKey is NO or has no value.
    Added some comments.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/WebKit/ChangeLog

    r14474 r14480  
     12006-05-18  Tim Omernick  <timo@apple.com> 
     2 
     3        Reviewed by John Sullivan. 
     4 
     5        <rdar://problem/4551938> More options needed for window display throttle 
     6 
     7        We decided to play it safe and leave our window flushing behavior unchanged from the previous 
     8        public release.  By default, CoreGraphics deferred updates are once again OFF, and the window 
     9        display throttle is OFF. 
     10 
     11        Individual applications should set the WebKitThrottleWindowDisplayPreferenceKey and  
     12        WebKitEnableDeferredUpdatesPreferenceKey defaults to suit their needs. 
     13 
     14        Old behavior (like 10.4.6): WebKitThrottleWindowDisplayPreferenceKey=0 (or unset),  
     15        WebKitEnableDeferredUpdatesPreferenceKey (or unset). 
     16 
     17        Tear-free scrolling/animations: WebKitThrottleWindowDisplayPreferenceKey=0 (or unset), 
     18        WebKitEnableDeferredUpdatesPreferenceKey=1.  While this configuration fixes the tearing issues 
     19        caused by over-flushing, some applications will experience performance problems as over-flushing 
     20        with CG deferred updates enabled will cause the app to block. 
     21 
     22        Tear-free scrolling/animations, high performance: WebKitThrottleWindowDisplayPreferenceKey=1,  
     23        WebKitEnableDeferredUpdatesPreferenceKey=1.  This is the riskiest configuration in that it 
     24        enables the window display throttle "feature", potentially breaking applications' assumptions 
     25        about when displays occur.  However, it provides the "best of both worlds", in that updates 
     26        are tear-free, and performance impact should me minimal. 
     27 
     28        * WebView/WebPreferenceKeysPrivate.h: 
     29        Declared WebKitThrottleWindowDisplayPreferenceKey and WebKitEnableDeferredUpdatesPreferenceKey. 
     30 
     31        * WebView/WebFrameView.m: 
     32        (-[WebFrameView initWithFrame:]): 
     33        Turn off CG deferred updates if WebKitEnableDeferredUpdatesPreferenceKey is NO or has no value. 
     34        Added some comments. 
     35 
    1362006-05-18  John Sullivan  <sullivan@apple.com> 
    237 
  • trunk/WebKit/WebView/WebFrameView.m

    r14420 r14480  
    4747#import "WebNSWindowExtras.h" 
    4848#import "WebPDFView.h" 
     49#import "WebPreferenceKeysPrivate.h" 
    4950#import "WebSystemInterface.h" 
    5051#import "WebViewFactory.h" 
     
    5556#import <WebCore/WebCoreFrameView.h> 
    5657#import <WebCore/WebCoreView.h> 
     58#import <WebKitSystemInterface.h> 
    5759 
    5860@interface NSClipView (AppKitSecretsIKnow) 
     
    6365    SpaceKey = 0x0020 
    6466}; 
    65  
    66 static NSString *WebKitThrottleWindowDisplayPreferenceKey = @"WebKitThrottleWindowDisplay"; 
    6767 
    6868@interface WebFrameView (WebFrameViewFileInternal) <WebCoreBridgeHolder> 
     
    309309        [WebImageRendererFactory createSharedFactory]; 
    310310        [WebKeyGenerator createSharedGenerator]; 
    311         if ([[NSUserDefaults standardUserDefaults] boolForKey:WebKitThrottleWindowDisplayPreferenceKey]) 
     311 
     312        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 
     313         
     314        // Window display is throttled to 60 frames per second if WebKitThrottleWindowDisplayPreferenceKey 
     315        // is set to YES.  The window display throttle is OFF by default for compatibility with Mac OS X 
     316        // 10.4.6. 
     317        if ([defaults boolForKey:WebKitThrottleWindowDisplayPreferenceKey]) 
    312318            [NSWindow _webkit_enableWindowDisplayThrottle]; 
     319         
     320        // CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is set 
     321        // to NO, or has no value.  For compatibility with Mac OS X 10.4.6, deferred updates are OFF by 
     322        // default. 
     323        if (![defaults boolForKey:WebKitEnableDeferredUpdatesPreferenceKey]) 
     324            WKDisableCGDeferredUpdates(); 
    313325    } 
    314326     
  • trunk/WebKit/WebView/WebPreferenceKeysPrivate.h

    r11962 r14480  
    6565#define WebKitPDFDisplayModePreferenceKey @"WebKitPDFDisplayMode" 
    6666#define WebKitPDFScaleFactorPreferenceKey @"WebKitPDFScaleFactor" 
     67 
     68 
     69// Window display is throttled to 60 frames per second if WebKitThrottleWindowDisplayPreferenceKey 
     70// is set to YES.  The window display throttle is OFF by default for compatibility with Mac OS X 
     71// 10.4.6. 
     72#define WebKitThrottleWindowDisplayPreferenceKey @"WebKitThrottleWindowDisplay" 
     73 
     74// CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is set 
     75// to NO, or has no value.  For compatibility with Mac OS X 10.4.6, deferred updates are OFF by 
     76// default. 
     77#define WebKitEnableDeferredUpdatesPreferenceKey @"WebKitEnableDeferredUpdates"