Bug 58256

Summary: Ignore context change callbacks when not on the main thread
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: Layout and RenderingAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: Windows 7   
Attachments:
Description Flags
Proposed patch simon.fraser: review+

Description Eric Carlson 2011-04-11 12:16:00 PDT
WKQCA::CAView::contextDidChangeCallback should do nothing when called on a background thread because it triggers WebCore rendering.
Comment 1 Eric Carlson 2011-04-11 12:26:00 PDT
Created attachment 89051 [details]
Proposed patch
Comment 2 Adam Roben (:aroben) 2011-04-11 13:22:23 PDT
It would be nice to have a little more information in the bug and ChangeLog about when this could happen and why it's OK to ignore the callback in that case.
Comment 3 Eric Carlson 2011-04-11 14:11:22 PDT
It is safe to ignore the contextDidChangeCallback callback from background threads because in that case no changes have actually been committed to the context, so there is no chance animations will have started, etc.
Comment 4 Adam Roben (:aroben) 2011-04-11 14:14:26 PDT
Thanks, Eric. To be even more specific, IIRC, we expect to receive this notification on a background thread due to a CAImageQueue being modified. But in that case, as Eric said, there are no real changes to the context; we just need to render again (which WKCACFView will take care of on its own).
Comment 5 Adam Roben (:aroben) 2011-04-11 14:15:35 PDT
Eric, I think WebKit2 needs the same fix applied in LayerTreeHostCAWin.
Comment 6 Eric Carlson 2011-04-11 14:38:33 PDT
http://trac.webkit.org/changeset/83497 for the WK1 part.
Comment 7 Eric Carlson 2011-04-11 15:03:26 PDT
http://trac.webkit.org/changeset/83508 for the WK2 portion.