| Index: cc/trees/layer_tree_host_impl_unittest.cc
|
| diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
|
| index 50bde5fe824745edea9118949de695699355b14a..e9ab3429d7d318d6b8c94339e3a9ad0374c5ef9e 100644
|
| --- a/cc/trees/layer_tree_host_impl_unittest.cc
|
| +++ b/cc/trees/layer_tree_host_impl_unittest.cc
|
| @@ -69,6 +69,7 @@ public:
|
| , m_didRequestRedraw(false)
|
| , m_didUploadVisibleTile(false)
|
| , m_reduceMemoryResult(true)
|
| + , m_renderingStatsInstrumentation(RenderingStatsInstrumentation::Create())
|
| {
|
| media::InitializeMediaLibraryForTesting();
|
| }
|
| @@ -78,7 +79,7 @@ public:
|
| LayerTreeSettings settings;
|
| settings.minimumOcclusionTrackingSize = gfx::Size();
|
|
|
| - m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
| m_hostImpl->InitializeRenderer(createOutputSurface());
|
| m_hostImpl->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
|
| }
|
| @@ -112,7 +113,7 @@ public:
|
| settings.minimumOcclusionTrackingSize = gfx::Size();
|
| settings.partialSwapEnabled = partialSwap;
|
|
|
| - m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
|
|
| m_hostImpl->InitializeRenderer(outputSurface.Pass());
|
| m_hostImpl->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
|
| @@ -224,6 +225,7 @@ protected:
|
| DebugScopedSetMainThreadBlocked m_alwaysMainThreadBlocked;
|
|
|
| scoped_ptr<LayerTreeHostImpl> m_hostImpl;
|
| + scoped_ptr<RenderingStatsInstrumentation> m_renderingStatsInstrumentation;
|
| bool m_onCanDrawStateChangedCalled;
|
| bool m_hasPendingTree;
|
| bool m_didRequestCommit;
|
| @@ -384,7 +386,7 @@ TEST_F(LayerTreeHostImplTest, scrollWithoutRootLayer)
|
| TEST_F(LayerTreeHostImplTest, scrollWithoutRenderer)
|
| {
|
| LayerTreeSettings settings;
|
| - m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
|
|
| // Initialization will fail here.
|
| m_hostImpl->InitializeRenderer(FakeOutputSurface::Create3d(scoped_ptr<WebKit::WebGraphicsContext3D>(new TestWebGraphicsContext3DMakeCurrentFails)).PassAs<OutputSurface>());
|
| @@ -1102,7 +1104,7 @@ TEST_F(LayerTreeHostImplTest, scrollNonScrollableRootWithTopControls)
|
| settings.calculateTopControlsPosition = true;
|
| settings.topControlsHeight = 50;
|
|
|
| - m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
| m_hostImpl->InitializeRenderer(createOutputSurface());
|
| m_hostImpl->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
|
|
|
| @@ -2152,7 +2154,7 @@ TEST_F(LayerTreeHostImplTest, partialSwapReceivesDamageRect)
|
| // that we can force partial swap enabled.
|
| LayerTreeSettings settings;
|
| settings.partialSwapEnabled = true;
|
| - scoped_ptr<LayerTreeHostImpl> layerTreeHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + scoped_ptr<LayerTreeHostImpl> layerTreeHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
| layerTreeHostImpl->InitializeRenderer(outputSurface.Pass());
|
| layerTreeHostImpl->SetViewportSize(gfx::Size(500, 500), gfx::Size(500, 500));
|
|
|
| @@ -2444,13 +2446,13 @@ public:
|
| }
|
| };
|
|
|
| -static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, LayerTreeHostImplClient* client, Proxy* proxy)
|
| +static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, LayerTreeHostImplClient* client, Proxy* proxy, RenderingStatsInstrumentation* RenderingStatsInstrumentation)
|
| {
|
| scoped_ptr<OutputSurface> outputSurface = FakeOutputSurface::Create3d(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<OutputSurface>();
|
|
|
| LayerTreeSettings settings;
|
| settings.partialSwapEnabled = partialSwap;
|
| - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, client, proxy);
|
| + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, client, proxy, RenderingStatsInstrumentation);
|
| myHostImpl->InitializeRenderer(outputSurface.Pass());
|
| myHostImpl->SetViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
|
|
|
| @@ -2514,7 +2516,7 @@ static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, Lay
|
|
|
| TEST_F(LayerTreeHostImplTest, contributingLayerEmptyScissorPartialSwap)
|
| {
|
| - scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(true, this, &m_proxy);
|
| + scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(true, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
|
|
| {
|
| LayerTreeHostImpl::FrameData frame;
|
| @@ -2534,7 +2536,7 @@ TEST_F(LayerTreeHostImplTest, contributingLayerEmptyScissorPartialSwap)
|
|
|
| TEST_F(LayerTreeHostImplTest, contributingLayerEmptyScissorNoPartialSwap)
|
| {
|
| - scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(false, this, &m_proxy);
|
| + scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(false, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
|
|
| {
|
| LayerTreeHostImpl::FrameData frame;
|
| @@ -2749,7 +2751,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusion)
|
| LayerTreeSettings settings;
|
| settings.minimumOcclusionTrackingSize = gfx::Size();
|
| settings.cacheRenderPassContents = true;
|
| - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
|
|
| // Layers are structure as follows:
|
| //
|
| @@ -2864,7 +2866,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut)
|
| LayerTreeSettings settings;
|
| settings.minimumOcclusionTrackingSize = gfx::Size();
|
| settings.cacheRenderPassContents = true;
|
| - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
|
|
| // Layers are structure as follows:
|
| //
|
| @@ -2979,7 +2981,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
|
| LayerTreeSettings settings;
|
| settings.minimumOcclusionTrackingSize = gfx::Size();
|
| settings.cacheRenderPassContents = true;
|
| - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
|
|
| // Layers are structured as follows:
|
| //
|
| @@ -3066,7 +3068,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned)
|
| {
|
| LayerTreeSettings settings;
|
| settings.cacheRenderPassContents = true;
|
| - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
|
|
| // Layers are structured as follows:
|
| //
|
| @@ -3141,7 +3143,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap)
|
| settings.minimumOcclusionTrackingSize = gfx::Size();
|
| settings.partialSwapEnabled = true;
|
| settings.cacheRenderPassContents = true;
|
| - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
|
|
| // Layers are structure as follows:
|
| //
|
| @@ -3253,7 +3255,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithScissor)
|
| LayerTreeSettings settings;
|
| settings.minimumOcclusionTrackingSize = gfx::Size();
|
| settings.cacheRenderPassContents = true;
|
| - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
|
|
| /*
|
| Layers are created as follows:
|
| @@ -3360,7 +3362,7 @@ TEST_F(LayerTreeHostImplTest, surfaceTextureCaching)
|
| settings.minimumOcclusionTrackingSize = gfx::Size();
|
| settings.partialSwapEnabled = true;
|
| settings.cacheRenderPassContents = true;
|
| - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
|
|
| LayerImpl* rootPtr;
|
| LayerImpl* intermediateLayerPtr;
|
| @@ -3519,7 +3521,7 @@ TEST_F(LayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap)
|
| LayerTreeSettings settings;
|
| settings.minimumOcclusionTrackingSize = gfx::Size();
|
| settings.cacheRenderPassContents = true;
|
| - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy);
|
| + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get());
|
|
|
| LayerImpl* rootPtr;
|
| LayerImpl* intermediateLayerPtr;
|
|
|