Bug 58256 - Ignore context change callbacks when not on the main thread
Summary: Ignore context change callbacks when not on the main thread
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Windows 7
: P2 Normal
Assignee: Eric Carlson
Depends on:
Reported: 2011-04-11 12:16 PDT by Eric Carlson
Modified: 2011-04-11 15:03 PDT (History)
1 user (show)

See Also:

Proposed patch (1.48 KB, patch)
2011-04-11 12:26 PDT, Eric Carlson
simon.fraser: review+
Details | Formatted Diff | Diff

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