[webkit-reviews] review requested: [Bug 55268] Optimization to prevent native control updates when HTML5 video control panel is completely transparent : [Attachment 83882] Patch based on svn revision 79683

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 25 14:55:19 PST 2011


Max Feil <mfeil at qnx.com> has asked  for review:
Bug 55268: Optimization to prevent native control updates when HTML5 video
control panel is completely transparent
https://bugs.webkit.org/show_bug.cgi?id=55268

Attachment 83882: Patch based on svn revision 79683
https://bugs.webkit.org/attachment.cgi?id=83882&action=review

------- Additional Comments from Max Feil <mfeil at qnx.com>
The MediaControls::update() method may be called repeatedly while an HTML5
video is playing and the controls are completely transparent. This results in
unnecessary processing which can take quite a bit of CPU on some platforms,
including re-layout and re-rendering large tiles.

This fairly simple patch addresses this by checking for opacity values of 0 and
not updating controls in this case. It also ensures that the controls are
updated before they fade in again.

Note that the m_timeUpdateTimer may still be updating some of the controls
(timeline, time numbers). In the port of WebKit I am working on we have
disabled this timer because the MediaControls::update() method gets called
consistently when the media time changes. I tested the trunk svn revision 79683
linux GTK+ build and when HTML5 video plays the MediaControls::update() method
gets called repeatedly for a while after the page is loaded, but then these
calls stop and the timeUpdateTimer is all that is updating controls.

This patch could also be extended to include an opacity check in
MediaControls::timeUpdateTimerFired(), but I did not do this because it's
beyond the scope of our port and would not get tested very well.

An example HTML5 video with native controls is near the bottom of the following
page: http://diveintohtml5.org/video.html


More information about the webkit-reviews mailing list