Bug 24941 - Accelerated compositing can sometimes flash when changing layers
Summary: Accelerated compositing can sometimes flash when changing layers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Chris Marrin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-30 13:50 PDT by Chris Marrin
Modified: 2009-04-03 14:51 PDT (History)
1 user (show)

See Also:


Attachments
Patch (12.21 KB, patch)
2009-03-30 18:12 PDT, Chris Marrin
simon.fraser: review-
Details | Formatted Diff | Diff
Replacement patch (10.20 KB, patch)
2009-04-03 10:46 PDT, Chris Marrin
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.