Changeset 166117 in webkit


Ignore:
Timestamp:
Mar 22, 2014 10:52:14 AM (10 years ago)
Author:
Simon Fraser
Message:

Source/WebCore: Don't flush compositing layers within FrameView::willPaintContents()
https://bugs.webkit.org/show_bug.cgi?id=130627
<rdar://problem/16368869>

Reviewed by Sam Weinig.

Remove the call to flushCompositingStateForThisFrame() here. We should
have always flushed before painting via other mechanisms in WebKit2 and WebKit2.
Flushing during painting is actually harmful, since we could be inside
a CA commit already, and creating or destroying layers via flushing is bad.

  • page/FrameView.cpp:

(WebCore::FrameView::willPaintContents):

Source/WebKit/mac: Don't flush compositing layers within FrameView::willPaintContents()
https://bugs.webkit.org/show_bug.cgi?id=130627

Reviewed by Sam Weinig.

Make _flushCompositingChanges private so DRT can call it;
moved it into the Private category.

  • WebView/WebView.mm:

(-[WebView _flushCompositingChanges]):

  • WebView/WebViewPrivate.h:

Tools: Don't flush compositing layers within FrameView::willPaintContents()
https://bugs.webkit.org/show_bug.cgi?id=130627
<rdar://problem/16368869>

Reviewed by Sam Weinig.

Fix DRT to correctly render tests with layers now that FrameView::paintContents
does not flush.

Move the -[WebView displayIfNeeded] from -[FrameLoadDelegate webView:didFinishLoadForFrame:]
into an explicit function called before dumping.

Then explicitly call _flushCompositingChanges to ensure that GraphicsLayer changes
are flushed to CA. They will be pushed to the window by snapshotting.

  • DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:

Fix weird path to IOKit.framework.

  • DumpRenderTree/mac/DumpRenderTree.mm:

(updateDisplay):
(dump):

  • DumpRenderTree/mac/FrameLoadDelegate.mm:

(-[FrameLoadDelegate webView:locationChangeDone:forDataSource:]): Fix parameter name.
(-[FrameLoadDelegate webView:didFinishLoadForFrame:]): Remove display call.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r166114 r166117  
     12014-03-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Don't flush compositing layers within FrameView::willPaintContents()
     4        https://bugs.webkit.org/show_bug.cgi?id=130627
     5        <rdar://problem/16368869>
     6
     7        Reviewed by Sam Weinig.
     8
     9        Remove the call to flushCompositingStateForThisFrame() here. We should
     10        have always flushed before painting via other mechanisms in WebKit2 and WebKit2.
     11        Flushing during painting is actually harmful, since we could be inside
     12        a CA commit already, and creating or destroying layers via flushing is bad.
     13
     14        * page/FrameView.cpp:
     15        (WebCore::FrameView::willPaintContents):
     16
    1172014-03-22  Martin Hodovan  <mhodovan@inf.u-szeged.hu>
    218
  • trunk/Source/WebCore/page/FrameView.cpp

    r166024 r166117  
    34933493        sCurrentPaintTimeStamp = monotonicallyIncreasingTime();
    34943494
    3495     if (!context->paintingDisabled() && !document->printing())
    3496         flushCompositingStateForThisFrame(&frame());
    3497 
    34983495    paintingState.paintBehavior = m_paintBehavior;
    34993496   
  • trunk/Source/WebKit/mac/ChangeLog

    r166116 r166117  
     12014-03-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Don't flush compositing layers within FrameView::willPaintContents()
     4        https://bugs.webkit.org/show_bug.cgi?id=130627
     5
     6        Reviewed by Sam Weinig.
     7       
     8        Make _flushCompositingChanges private so DRT can call it;
     9        moved it into the Private category.
     10
     11        * WebView/WebView.mm:
     12        (-[WebView _flushCompositingChanges]):
     13        * WebView/WebViewPrivate.h:
     14
    1152014-03-21  Simon Fraser  <simon.fraser@apple.com>
    216
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r166116 r166117  
    38693869}
    38703870
     3871- (BOOL)_flushCompositingChanges
     3872{
     3873    Frame* frame = [self _mainCoreFrame];
     3874    if (frame && frame->view())
     3875        return frame->view()->flushCompositingStateIncludingSubframes();
     3876
     3877    return YES;
     3878}
     3879
    38713880- (void)_setBaseCTM:(CGAffineTransform)transform forContext:(CGContextRef)context
    38723881{
     
    83298338}
    83308339
    8331 - (BOOL)_flushCompositingChanges
    8332 {
    8333     Frame* frame = [self _mainCoreFrame];
    8334     if (frame && frame->view())
    8335         return frame->view()->flushCompositingStateIncludingSubframes();
    8336 
    8337     return YES;
    8338 }
    8339 
    83408340/*
    83418341    The order of events with compositing updates is this:
  • trunk/Source/WebKit/mac/WebView/WebViewPrivate.h

    r165676 r166117  
    772772- (void)_setPostsAcceleratedCompositingNotifications:(BOOL)flag;
    773773- (BOOL)_isUsingAcceleratedCompositing;
     774- (BOOL)_flushCompositingChanges;
    774775- (void)_setBaseCTM:(CGAffineTransform)transform forContext:(CGContextRef)context;
    775776
  • trunk/Tools/ChangeLog

    r166081 r166117  
     12014-03-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Don't flush compositing layers within FrameView::willPaintContents()
     4        https://bugs.webkit.org/show_bug.cgi?id=130627
     5        <rdar://problem/16368869>
     6
     7        Reviewed by Sam Weinig.
     8       
     9        Fix DRT to correctly render tests with layers now that FrameView::paintContents
     10        does not flush.
     11       
     12        Move the -[WebView displayIfNeeded] from -[FrameLoadDelegate webView:didFinishLoadForFrame:]
     13        into an explicit function called before dumping.
     14       
     15        Then explicitly call _flushCompositingChanges to ensure that GraphicsLayer changes
     16        are flushed to CA. They will be pushed to the window by snapshotting.
     17
     18        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
     19        Fix weird path to IOKit.framework.
     20        * DumpRenderTree/mac/DumpRenderTree.mm:
     21        (updateDisplay):
     22        (dump):
     23        * DumpRenderTree/mac/FrameLoadDelegate.mm:
     24        (-[FrameLoadDelegate webView:locationChangeDone:forDataSource:]): Fix parameter name.
     25        (-[FrameLoadDelegate webView:didFinishLoadForFrame:]): Remove display call.
     26
    1272014-03-21  David Kilzer  <ddkilzer@apple.com>
    228
  • trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj

    r163998 r166117  
    233233                1A5CC1F3137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetURLWithJavaScriptURL.cpp; sourceTree = "<group>"; };
    234234                1A66C34F14576A920099A115 /* ContentsScaleFactor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentsScaleFactor.cpp; sourceTree = "<group>"; };
    235                 1A7961061803454C00FE42CD /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = ../../../../../../../System/Library/Frameworks/IOKit.framework; sourceTree = "<group>"; };
     235                1A7961061803454C00FE42CD /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<group>"; };
    236236                1A8F024C0BB9B056008CFA34 /* TestObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestObject.h; sourceTree = "<group>"; };
    237237                1AC6C77F0D07589B00CD3161 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r165676 r166117  
    15241524}
    15251525
     1526static void updateDisplay()
     1527{
     1528    WebView *webView = [mainFrame webView];
     1529
     1530    if ([webView _isUsingAcceleratedCompositing])
     1531        [webView display];
     1532    else
     1533        [webView displayIfNeeded];
     1534
     1535    [webView _flushCompositingChanges];
     1536}
     1537
    15261538void dump()
    15271539{
     
    15341546    WebThreadLock();
    15351547#endif
    1536    
     1548
     1549    updateDisplay();
     1550
    15371551    invalidateAnyPreviousWaitToDumpWatchdog();
    15381552    ASSERT(!gTestRunner->hasPendingWebNotificationClick());
  • trunk/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm

    r165676 r166117  
    157157}
    158158
    159 - (void)webView:(WebView *)c locationChangeDone:(NSError *)error forDataSource:(WebDataSource *)dataSource
     159- (void)webView:(WebView *)webView locationChangeDone:(NSError *)error forDataSource:(WebDataSource *)dataSource
    160160{
    161161    if ([dataSource webFrame] == topLoadingFrame) {
     
    282282    }
    283283
    284     // FIXME: This call to displayIfNeeded can be removed when <rdar://problem/5092361> is fixed.
    285     // After that is fixed, we will reenable painting after WebCore is done loading the document,
    286     // and this call will no longer be needed.
    287     if ([[sender mainFrame] isEqual:frame])
    288         [sender displayIfNeeded];
    289284    [self webView:sender locationChangeDone:nil forDataSource:[frame dataSource]];
    290285    [gNavigationController webView:sender didFinishLoadForFrame:frame];
Note: See TracChangeset for help on using the changeset viewer.