[chromium] Update VideoLayerChromium textures after texture resources are reclaimed
authorenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Sep 2011 16:44:18 +0000 (16:44 +0000)
committerenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Sep 2011 16:44:18 +0000 (16:44 +0000)
commita63c1ca46eed1c486e887817e5c3573f6960858c
treeeb1eb9c4635ae1573fc7f2d3e682612ddfb34f50
parent63e40402733229b66c9fd3d05ae8ed4e240ac9a3
[chromium] Update VideoLayerChromium textures after texture resources are reclaimed
https://bugs.webkit.org/show_bug.cgi?id=68742

Reviewed by James Robinson.

Source/WebCore:

If video textures are reclaimed (such as during a visibility change on
a tab), the dirty rect for the layer is empty and it skips out of
updating compositor resources, leaving the video textures invalid.
Instead, check the textures here to make sure they're still valid
first before early out so that they can get reupdated if necessary.

Additionally, fix a small bug in pushPropertiesTo where 1 plane RGB
videos would not get drawn because all 3 planes didn't have valid
textures.

Test: compositing/video-page-visibility.html

* platform/graphics/chromium/VideoLayerChromium.cpp:
(WebCore::VideoLayerChromium::VideoLayerChromium):
(WebCore::VideoLayerChromium::cleanupResources):
(WebCore::VideoLayerChromium::updateCompositorResources):
(WebCore::VideoLayerChromium::pushPropertiesTo):
(WebCore::VideoLayerChromium::setLayerTreeHost):
(WebCore::VideoLayerChromium::texturesValid):
* platform/graphics/chromium/VideoLayerChromium.h:

LayoutTests:

Without this patch, this video texture is invalid.

* compositing/video-page-visibility-expected.png: Added.
* compositing/video-page-visibility-expected.txt: Added.
* compositing/video-page-visibility.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/video-page-visibility-expected.png [new file with mode: 0644]
LayoutTests/compositing/video-page-visibility-expected.txt [new file with mode: 0644]
LayoutTests/compositing/video-page-visibility.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h