Index: cc/layer_tree_host_impl_unittest.cc |
diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc |
index 68a4b7f4738f9e1d0f955d3ef67b6c626509656a..5e2bb29824d38c4e9699cbbeeb1cca8ce7026b34 100644 |
--- a/cc/layer_tree_host_impl_unittest.cc |
+++ b/cc/layer_tree_host_impl_unittest.cc |
@@ -2535,22 +2535,24 @@ private: |
// Fake video frame that represents a 4x4 YUV video frame. |
class FakeVideoFrame: public WebVideoFrame { |
public: |
- FakeVideoFrame() : m_textureId(0) { memset(m_data, 0x80, sizeof(m_data)); } |
+ FakeVideoFrame() : m_textureId(0), m_visibleRect(0, 0, 4, 4) { memset(m_data, 0x80, sizeof(m_data)); } |
virtual ~FakeVideoFrame() { } |
virtual Format format() const { return m_textureId ? FormatNativeTexture : FormatYV12; } |
- virtual unsigned width() const { return 4; } |
- virtual unsigned height() const { return 4; } |
virtual unsigned planes() const { return m_textureId ? 0 : 3; } |
virtual int stride(unsigned plane) const { return 4; } |
Ami GONE FROM CHROMIUM
2012/10/25 17:13:34
16?
sheu
2012/10/25 21:44:13
I guess for FormatNativeTexture that makes sense.
|
virtual const void* data(unsigned plane) const { return m_data; } |
virtual unsigned textureId() const { return m_textureId; } |
virtual unsigned textureTarget() const { return m_textureId ? GL_TEXTURE_2D : 0; } |
+ virtual WebKit::WebRect visibleRect() const { visibleRect; } |
Ami GONE FROM CHROMIUM
2012/10/25 17:13:34
missing m_?
(how is this compiling? :))
sheu
2012/10/25 21:44:13
Aha. Looks like I have -build_tests -autotest in
|
+ virtual WebKit::WebRect textureSize() const { return WebKit::WebSize(4, 4); } |
+ void setVisibleRect(const WebKit::WebRect& visibleRect) { m_visibleRect = visibleRect; } |
void setTextureId(unsigned id) { m_textureId = id; } |
private: |
char m_data[16]; |
unsigned m_textureId; |
+ WebKit::WebRect m_visibleRect; |
}; |
// Fake video frame provider that always provides the same FakeVideoFrame. |
@@ -2706,6 +2708,17 @@ TEST_P(LayerTreeHostImplTest, dontUseOldResourcesAfterLostContext) |
videoLayer->setLayerTreeHostImpl(m_hostImpl.get()); |
rootLayer->addChild(videoLayer.PassAs<LayerImpl>()); |
+ FakeVideoFrame videoFrameScaled; |
+ FakeVideoFrameProvider providerScaled; |
+ providerScaled.setFrame(&videoFrameScaled); |
+ scoped_ptr<VideoLayerImpl> videoLayerScaled = VideoLayerImpl::create(layerId++, &providerScaled); |
+ videoLayerScaled->setBounds(IntSize(10, 10)); |
+ videoLayerScaled->setAnchorPoint(FloatPoint(0, 0)); |
+ videoLayerScaled->setContentBounds(IntSize(10, 10)); |
+ videoLayerScaled->setDrawsContent(true); |
+ videoLayerScaled->setLayerTreeHostImpl(m_hostImpl.get()); |
+ rootLayer->addChild(videoLayerScaled.PassAs<LayerImpl>()); |
+ |
FakeVideoFrame hwVideoFrame; |
FakeVideoFrameProvider hwProvider; |
hwProvider.setFrame(&hwVideoFrame); |
@@ -2756,6 +2769,7 @@ TEST_P(LayerTreeHostImplTest, dontUseOldResourcesAfterLostContext) |
// Use a context that supports IOSurfaces |
m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DWithIOSurface)).PassAs<GraphicsContext>()); |
+ videoFrameScaled.setVisibleRect(WebKit::WebRect(0, 0, 3, 2)); |
hwVideoFrame.setTextureId(m_hostImpl->resourceProvider()->graphicsContext3D()->createTexture()); |
m_hostImpl->setRootLayer(rootLayer.Pass()); |