Bug 24941

Summary: Accelerated compositing can sometimes flash when changing layers
Product: WebKit Reporter: Chris Marrin <cmarrin>
Component: Layout and RenderingAssignee: Chris Marrin <cmarrin>
Status: RESOLVED FIXED    
Severity: Normal CC: simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
simon.fraser: review-
Replacement patch hyatt: review+

Description Chris Marrin 2009-03-30 13:50:47 PDT
Today layout is usually deferred by using a timer which fires after style change is done. This reduces the number of layouts needed. But if the style change results in accelerated compositing layers to be created, they will get created with 0 size because they haven't been laid out yet. This will sometimes cause a compositing to occur with the 0 size layers. When the timer fires, the contents of the layers is laid out and rendered. Then the compositor renders the result and all is well. It is possible to see a visible flash when this occurs.

You can see it on http://mycommute.apple.com. You need a build with ACCELERATED_COMPOSITING turned on. Select a Route of "Van Ness/Mission", a Stop of "Colma Park & Ride" and a Campus of "IL1". Then click done and ht the back and forward arrows button a few times. You may be able to see the flash.

This is hard to see on fast hardware, but easy on slower platforms.
Comment 1 Chris Marrin 2009-03-30 18:12:32 PDT
Created attachment 29104 [details]
Patch
Comment 2 Simon Fraser (smfr) 2009-03-31 11:32:56 PDT
Comment on attachment 29104 [details]
Patch

r- based on discussion with Darin. We need to just fix the deferred layout timer to fire at the right time.
Comment 3 Chris Marrin 2009-04-03 10:46:29 PDT
Created attachment 29231 [details]
Replacement patch
Comment 4 Dave Hyatt 2009-04-03 11:21:18 PDT
Comment on attachment 29231 [details]
Replacement patch

r=me
Comment 5 Timothy Hatcher 2009-04-03 12:51:47 PDT
Comment on attachment 29231 [details]
Replacement patch

> +    if (!_private->useDocumentViews)
> +        [self _viewWillDrawInternal];

This needs an #if USE(ACCELERATED_COMPOSITING) around it, or it will throw an exception since that method wont exist.
Comment 6 Timothy Hatcher 2009-04-03 12:54:29 PDT
Never mind, I see the caller has the correct #ifndef around it.
Comment 7 Chris Marrin 2009-04-03 14:51:59 PDT
Sending        WebCore/ChangeLog
Sending        WebCore/page/ChromeClient.h
Sending        WebCore/rendering/RenderLayerCompositor.cpp
Sending        WebCore/rendering/RenderLayerCompositor.h
Sending        WebKit/mac/ChangeLog
Sending        WebKit/mac/WebCoreSupport/WebChromeClient.h
Sending        WebKit/mac/WebCoreSupport/WebChromeClient.mm
Sending        WebKit/mac/WebView/WebView.mm
Sending        WebKit/mac/WebView/WebViewInternal.h
Transmitting file data .........
Committed revision 42208.