[Webkit-unassigned] [Bug 52868] [chromium] Fix redundant video frame paint on CSS LayerChromium for <video>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 25 10:20:33 PST 2011


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





--- Comment #4 from Vangelis Kokkevis <vangelis at chromium.org>  2011-01-25 10:20:33 PST ---
(From update of attachment 79691)
View in context: https://bugs.webkit.org/attachment.cgi?id=79691&action=review

>> Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:402
>> +        return;
> 
> Yeah, I'm pretty sure this will break painting from a h-w accelerated video into a 2d canvas.  Please check if we have a layout test to cover this case and if not please add one (create a <video> and a <canvas>, on the canvas' 2d context do .drawImage(video, ...), assert that the pixels show up).  I think the philip suite may have such a test.
> 
> 2d and webgl canvases have the same issue.  The basic problem is that you want the paint() call to actually render when painting into a 2d canvas but you don't want it to happen when doing 'normal' rendering, so there's an explicit call in CanvasRenderingContext2D::drawImage() to differentiate the two: http://trac.webkit.org/browser/trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp#L1260.  makeRenderingResultsAvailable() ensures that the source canvas' ImageBuffer contains the actual bits of the source canvas, which is then drawn into the destination canvas.  I think you need something a bit different here, but whatever the code is it would go somewhere around here: http://trac.webkit.org/browser/trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp#L1337.

Good catch, James. 

Interestingly enough, MediaPlayerPrivateQuickTimeWin.cpp (used by Safari on windows), has a similar early out to what Victoria implemented on our side which likely means that video frames cannot be copied on canvas(?).  However, the mac version in MediaPlayerPrivateQTKit.mm does no such thing but it might be happening at some lower level within QT.

One possible solution (although not super clean) would be to add a flag to LayerRendererChromium that indicates whether it's updating layer contents.  WebMediaPlayerClientImpl can then check that via a call like: m_videoLayer->layerRenderer()->inLayerContentUpdate() to be able to differentiate between the two.

-- 
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