| 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 1d3bcbef954f4948951dd3d3df666d8874b87001..43fc6b7b2ec55e504da1e15d238380e219033218 100644
|
| --- a/cc/layer_tree_host_impl_unittest.cc
|
| +++ b/cc/layer_tree_host_impl_unittest.cc
|
| @@ -20,6 +20,7 @@
|
| #include "cc/math_util.h"
|
| #include "cc/quad_sink.h"
|
| #include "cc/render_pass_draw_quad.h"
|
| +#include "cc/rendering_stats_instrumentation.h"
|
| #include "cc/scrollbar_geometry_fixed_thumb.h"
|
| #include "cc/scrollbar_layer_impl.h"
|
| #include "cc/single_thread_proxy.h"
|
| @@ -69,6 +70,7 @@ public:
|
| , m_didRequestRedraw(false)
|
| , m_didUploadVisibleHighResolutionTile(false)
|
| , m_reduceMemoryResult(true)
|
| + , m_renderingStatsInstrumentation(RenderingStatsInstrumentation::Create())
|
| {
|
| media::InitializeMediaLibraryForTesting();
|
| }
|
| @@ -78,7 +80,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));
|
| }
|
| @@ -111,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));
|
| @@ -223,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;
|
| @@ -383,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>());
|
| @@ -1101,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));
|
|
|
| @@ -2151,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));
|
|
|
| @@ -2443,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));
|
|
|
| @@ -2513,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;
|
| @@ -2533,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;
|
| @@ -2748,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:
|
| //
|
| @@ -2863,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:
|
| //
|
| @@ -2978,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:
|
| //
|
| @@ -3065,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:
|
| //
|
| @@ -3140,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:
|
| //
|
| @@ -3252,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:
|
| @@ -3359,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;
|
| @@ -3518,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;
|
|
|