[chromium] Separate CCVideoDrawQuad and from the layer tree and video provider by...
authordanakj@chromium.org <danakj@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Jun 2012 22:58:16 +0000 (22:58 +0000)
committerdanakj@chromium.org <danakj@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Jun 2012 22:58:16 +0000 (22:58 +0000)
commit44dd73dbad23d90a491771a69789bddecc21ae9d
tree0cb49083698babd0ae7bf484fb6f13ea3ecf067a
parente6b6c18b57028bd31f7e82a961f42960e8b6124f
[chromium] Separate CCVideoDrawQuad and from the layer tree and video provider by removing ManagedTexture and WebVideoFrame pointers from the quad
https://bugs.webkit.org/show_bug.cgi?id=88363

Reviewed by Adrienne Walker.

Source/Platform:

* Platform.gypi:
* chromium/public/WebVideoFrame.h:
* chromium/src/WebVideoFrame.cpp: Removed.

Source/WebCore:

CCVideoDrawQuad should not contain any pointers to data in the layer
tree so we are able to serialize it across process boundaries. This
patch removes the ManagedTexture pointers from the quad class,
replacing them with texture ids. It removes the WebVideoFrame* from
the quad, replacing it with the frame provider's texture id included
in the WebVideoFrame structure. And it uses a WebTransformationMatrix
instead of a pointer to an array of floats.

Texture allocation is done in CCVideoLayerImpl via the
contentsTextureAllocator, so that the memory usage can be tracked.

We move the copyPlaneToTextures() method back from LayerRendererChromium
to CCVideoLayerImpl, as this method uses the texture data pointer in the
WebVideoFrame, and we do not want to give this pointer to the quad
class. Instead, this method makes use of the LayerTextureSubImage class
to copy the pixel data into the texture.

LayerTextureSubImage is updated to allow non-4byte texture formats.

* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::drawYUV):
(WebCore::LayerRendererChromium::drawRGBA):
(WebCore::LayerRendererChromium::drawNativeTexture2D):
(WebCore::LayerRendererChromium::drawStreamTexture):
(WebCore::LayerRendererChromium::drawVideoQuad):
* platform/graphics/chromium/LayerTextureSubImage.cpp:
(WebCore::LayerTextureSubImage::uploadWithTexSubImage):
(WebCore::LayerTextureSubImage::uploadWithMapTexSubImage):
* platform/graphics/chromium/TextureCopier.cpp:
* platform/graphics/chromium/cc/CCVideoDrawQuad.cpp:
(WebCore::CCVideoDrawQuad::create):
(WebCore::CCVideoDrawQuad::CCVideoDrawQuad):
* platform/graphics/chromium/cc/CCVideoDrawQuad.h:
(CCVideoDrawQuad):
(WebCore::CCVideoDrawQuad::planes):
(WebCore::CCVideoDrawQuad::frameProviderTextureId):
* platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
(WebCore::CCVideoLayerImpl::~CCVideoLayerImpl):
(WebCore::CCVideoLayerImpl::willDraw):
(WebCore::CCVideoLayerImpl::willDrawInternal):
(WebCore::CCVideoLayerImpl::appendQuads):
(WebCore::CCVideoLayerImpl::didDraw):
(WebCore::CCVideoLayerImpl::FramePlane::allocateData):
(WebCore):
(WebCore::CCVideoLayerImpl::FramePlane::freeData):
(WebCore::CCVideoLayerImpl::allocatePlaneData):
(WebCore::CCVideoLayerImpl::copyPlaneData):
(WebCore::CCVideoLayerImpl::freePlaneData):
(WebCore::CCVideoLayerImpl::freeUnusedPlaneData):
(WebCore::CCVideoLayerImpl::didLoseContext):
* platform/graphics/chromium/cc/CCVideoLayerImpl.h:
(FramePlane):
(WebCore::CCVideoLayerImpl::FramePlane::FramePlane):

Source/WebKit/chromium:

* tests/CCLayerTreeHostImplTest.cpp:
* tests/CCTiledLayerTestCommon.h:
(WebKitTests::FakeTextureCopier::copyToTexture):
* tests/Canvas2DLayerChromiumTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/Platform/ChangeLog
Source/Platform/Platform.gypi
Source/Platform/chromium/public/WebVideoFrame.h
Source/Platform/chromium/src/WebVideoFrame.cpp [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp
Source/WebCore/platform/graphics/chromium/cc/CCVideoDrawQuad.cpp
Source/WebCore/platform/graphics/chromium/cc/CCVideoDrawQuad.h
Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h