diff options
Diffstat (limited to 'cc/trees/layer_tree_host_impl_unittest.cc')
-rw-r--r-- | cc/trees/layer_tree_host_impl_unittest.cc | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index b835bc5..814260f 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -32,6 +32,7 @@ #include "cc/test/animation_test_common.h" #include "cc/test/fake_output_surface.h" #include "cc/test/fake_proxy.h" +#include "cc/test/fake_rendering_stats_instrumentation.h" #include "cc/test/fake_video_frame_provider.h" #include "cc/test/fake_web_scrollbar_theme_geometry.h" #include "cc/test/geometry_test_utils.h" @@ -78,7 +79,7 @@ public: LayerTreeSettings settings; settings.minimum_occlusion_tracking_size = gfx::Size(); - m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); + m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, &m_statsInstrumentation); m_hostImpl->InitializeRenderer(createOutputSurface()); m_hostImpl->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); } @@ -112,7 +113,7 @@ public: settings.minimum_occlusion_tracking_size = gfx::Size(); settings.partial_swap_enabled = partialSwap; - m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); + m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, &m_statsInstrumentation); 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; + FakeRenderingStatsInstrumentation m_statsInstrumentation; 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_statsInstrumentation); // 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.calculate_top_controls_position = true; settings.top_controls_height = 50; - m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); + m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, &m_statsInstrumentation); 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.partial_swap_enabled = true; - scoped_ptr<LayerTreeHostImpl> layerTreeHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); + scoped_ptr<LayerTreeHostImpl> layerTreeHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, &m_statsInstrumentation); 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* statsInstrumentation) { scoped_ptr<OutputSurface> outputSurface = FakeOutputSurface::Create3d(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<OutputSurface>(); LayerTreeSettings settings; settings.partial_swap_enabled = partialSwap; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, client, proxy); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, client, proxy, statsInstrumentation); 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_statsInstrumentation); { 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_statsInstrumentation); { LayerTreeHostImpl::FrameData frame; @@ -2749,7 +2751,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusion) LayerTreeSettings settings; settings.minimum_occlusion_tracking_size = gfx::Size(); settings.cache_render_pass_contents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, &m_statsInstrumentation); // Layers are structure as follows: // @@ -2864,7 +2866,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut) LayerTreeSettings settings; settings.minimum_occlusion_tracking_size = gfx::Size(); settings.cache_render_pass_contents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, &m_statsInstrumentation); // Layers are structure as follows: // @@ -2979,7 +2981,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal) LayerTreeSettings settings; settings.minimum_occlusion_tracking_size = gfx::Size(); settings.cache_render_pass_contents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, &m_statsInstrumentation); // Layers are structured as follows: // @@ -3066,7 +3068,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned) { LayerTreeSettings settings; settings.cache_render_pass_contents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, &m_statsInstrumentation); // Layers are structured as follows: // @@ -3141,7 +3143,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap) settings.minimum_occlusion_tracking_size = gfx::Size(); settings.partial_swap_enabled = true; settings.cache_render_pass_contents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, &m_statsInstrumentation); // Layers are structure as follows: // @@ -3253,7 +3255,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithScissor) LayerTreeSettings settings; settings.minimum_occlusion_tracking_size = gfx::Size(); settings.cache_render_pass_contents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, &m_statsInstrumentation); /* Layers are created as follows: @@ -3360,7 +3362,7 @@ TEST_F(LayerTreeHostImplTest, surfaceTextureCaching) settings.minimum_occlusion_tracking_size = gfx::Size(); settings.partial_swap_enabled = true; settings.cache_render_pass_contents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, &m_statsInstrumentation); LayerImpl* rootPtr; LayerImpl* intermediateLayerPtr; @@ -3519,7 +3521,7 @@ TEST_F(LayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap) LayerTreeSettings settings; settings.minimum_occlusion_tracking_size = gfx::Size(); settings.cache_render_pass_contents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, &m_statsInstrumentation); LayerImpl* rootPtr; LayerImpl* intermediateLayerPtr; |