[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)
commit92f53fa3ba4db1c28c7cfd9ab84bf48baec2b201
treeeb1eb9c4635ae1573fc7f2d3e682612ddfb34f50
parent609a3cc39a0bb44a6e8ad48cf324327fe3af06b9
[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: https://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