| 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 64cec3bfd0a54cd4c3f6c7829711783aaf4c7b9b..b85d5b085c2d153fda473606584131391eec06f1 100644
|
| --- a/cc/layer_tree_host_impl_unittest.cc
|
| +++ b/cc/layer_tree_host_impl_unittest.cc
|
| @@ -2535,22 +2535,29 @@ 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; }
|
| + virtual int stride(unsigned plane) const { return 16; }
|
| 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 { return m_visibleRect; }
|
| + virtual WebKit::WebSize 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];
|
| + char m_data[64];
|
| unsigned m_textureId;
|
| + WebKit::WebRect m_visibleRect;
|
| };
|
|
|
| // Fake video frame provider that always provides the same FakeVideoFrame.
|
| @@ -2706,6 +2713,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 +2774,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());
|
|
|