[Webkit-unassigned] [Bug 111302] Fix the visibility issue of MediaPlayer when painting pixel data from HTMLVideoElement to Canvas

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 25 08:02:13 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=111302





--- Comment #2 from Jun Jiang <jun.a.jiang at intel.com>  2013-03-25 08:04:38 PST ---
After some investigation, I found MediaPlayer::setVisible(bool) was intentionally designed to work  in pair with MediaPlayer::paint() and MediaPlayer::paintCurrentFrameInContext(). It is quite different with setting the CSS style to display::None or visibility::hidden. Setting the CSS style display::None or visibility::hidden is always called by JS code and used to to affect the visibility of Video by either not to create the RenderObject or don't paint for the Video in design. Unlike setting display::None and visibility::hidden properties, MediaPlayer::setVisible(bool) controls a internal variable m_visible, which is maintained in MediaPlayer and can not be accessed from JS code and don't affect the Layout and paint of RenderView. So my original assumption that application may change this internal variable m_visible to control video visibility is wrong since this internal variable m_visible can not be accessed by JS code.
Moreover,  MediaPlayer::setVisible(bool) was firstly introduced together with MediaPlayerPrivateQTKit port and was used to setup or tear down some necessary helper objects for video rendering, such as MovieView, MoiveLayer or VideoRender in MediaPlayerPrivateQTKit port. Before MediaPlayer::paint() or MediaPlayer::paintCurrentFrameInContext() was invoked, MediaPlayer::setVisible(true) should be called and used to set up the required objects according to the so called Rendering Mode. When RenderVideo was destructed or MediaPlayer stopped, MediaPlayer::setVisible(false) would be called to tear down the helper objects. 
So for both painting the Video to canvas(MediaPlayer::paintCurrentFrameInContext()) and display the video(MediaPlayer::paint()), MediaPlayer::setVisible(true) is needed. If we don't want to display the video, we can set CSS style to display:None or visibility::hidden but have no way to change the internal variable m_visible in MediaPlayer from JS code. So my assumed failure case won't happen. Back to our original discussion for WebGL case,  MediaPlayer::copyVideoTextureToPlatformTexture() has nothing to do with setting up the helper objects for Video Rendering, therefore, MediaPlayer::setVisible(bool) was not needed.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list