diff options
author | tapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-21 02:38:52 +0000 |
---|---|---|
committer | tapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-21 02:38:52 +0000 |
commit | bcab0049604f31d3f2a3ee13a55167b2e5c63c5f (patch) | |
tree | a64b9d5bb5e5e84c2121a822666ab48ff51a02fa /cc/trees/layer_tree_host_impl_unittest.cc | |
parent | bfee8bd5b7b7ee3ee7f21008cd6a320cb42ce863 (diff) | |
download | chromium_src-bcab0049604f31d3f2a3ee13a55167b2e5c63c5f.zip chromium_src-bcab0049604f31d3f2a3ee13a55167b2e5c63c5f.tar.gz chromium_src-bcab0049604f31d3f2a3ee13a55167b2e5c63c5f.tar.bz2 |
Revert 189475 "cc:: Add RenderingStatsInstrumentation to manage ..."
semi-speculative revert for cc_unittests failures - see bug.
> cc:: Add RenderingStatsInstrumentation to manage collection of RenderingStats
>
> This change adds the class RenderingStatsInstrumentation that manages conditional
> saving and thread-specific access to a private RenderingStats instance.
> An instance of RenderingStatsRecorder is created on LayerTreeHost, which
> passes references to LayerTreeHostImpl and TileManager. Access to reading
> and writing on the internal RenderingStats instance is guarded by a lock.
>
> All rendering stats saving in LayerTreeHost, Single-/ThreadProxy,
> LayerTreeHostImpl and TileManager has been switched to use the
> RenderingStatsInstrumentation. Stats collection within Layer::update() still
> follows the original structure to keep this change small.
>
> BUG=181319
> NOTRY=true
>
> Review URL: https://chromiumcodereview.appspot.com/12519006
TBR=egraether@chromium.org
Review URL: https://codereview.chromium.org/12544031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189497 0039d316-1c4b-4281-b951-d872f2087c98
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, 17 insertions, 19 deletions
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index e9ab342..50bde5f 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -69,7 +69,6 @@ public: , m_didRequestRedraw(false) , m_didUploadVisibleTile(false) , m_reduceMemoryResult(true) - , m_renderingStatsInstrumentation(RenderingStatsInstrumentation::Create()) { media::InitializeMediaLibraryForTesting(); } @@ -79,7 +78,7 @@ public: LayerTreeSettings settings; settings.minimumOcclusionTrackingSize = gfx::Size(); - m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get()); + m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); m_hostImpl->InitializeRenderer(createOutputSurface()); m_hostImpl->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); } @@ -113,7 +112,7 @@ public: settings.minimumOcclusionTrackingSize = gfx::Size(); settings.partialSwapEnabled = partialSwap; - m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get()); + m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); m_hostImpl->InitializeRenderer(outputSurface.Pass()); m_hostImpl->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); @@ -225,7 +224,6 @@ protected: DebugScopedSetMainThreadBlocked m_alwaysMainThreadBlocked; scoped_ptr<LayerTreeHostImpl> m_hostImpl; - scoped_ptr<RenderingStatsInstrumentation> m_renderingStatsInstrumentation; bool m_onCanDrawStateChangedCalled; bool m_hasPendingTree; bool m_didRequestCommit; @@ -386,7 +384,7 @@ TEST_F(LayerTreeHostImplTest, scrollWithoutRootLayer) TEST_F(LayerTreeHostImplTest, scrollWithoutRenderer) { LayerTreeSettings settings; - m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get()); + m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); // Initialization will fail here. m_hostImpl->InitializeRenderer(FakeOutputSurface::Create3d(scoped_ptr<WebKit::WebGraphicsContext3D>(new TestWebGraphicsContext3DMakeCurrentFails)).PassAs<OutputSurface>()); @@ -1104,7 +1102,7 @@ TEST_F(LayerTreeHostImplTest, scrollNonScrollableRootWithTopControls) settings.calculateTopControlsPosition = true; settings.topControlsHeight = 50; - m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get()); + m_hostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); m_hostImpl->InitializeRenderer(createOutputSurface()); m_hostImpl->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); @@ -2154,7 +2152,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, m_renderingStatsInstrumentation.get()); + scoped_ptr<LayerTreeHostImpl> layerTreeHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); layerTreeHostImpl->InitializeRenderer(outputSurface.Pass()); layerTreeHostImpl->SetViewportSize(gfx::Size(500, 500), gfx::Size(500, 500)); @@ -2446,13 +2444,13 @@ public: } }; -static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, LayerTreeHostImplClient* client, Proxy* proxy, RenderingStatsInstrumentation* RenderingStatsInstrumentation) +static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, LayerTreeHostImplClient* client, Proxy* proxy) { 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, RenderingStatsInstrumentation); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, client, proxy); myHostImpl->InitializeRenderer(outputSurface.Pass()); myHostImpl->SetViewportSize(gfx::Size(100, 100), gfx::Size(100, 100)); @@ -2516,7 +2514,7 @@ static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, Lay TEST_F(LayerTreeHostImplTest, contributingLayerEmptyScissorPartialSwap) { - scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(true, this, &m_proxy, m_renderingStatsInstrumentation.get()); + scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(true, this, &m_proxy); { LayerTreeHostImpl::FrameData frame; @@ -2536,7 +2534,7 @@ TEST_F(LayerTreeHostImplTest, contributingLayerEmptyScissorPartialSwap) TEST_F(LayerTreeHostImplTest, contributingLayerEmptyScissorNoPartialSwap) { - scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(false, this, &m_proxy, m_renderingStatsInstrumentation.get()); + scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(false, this, &m_proxy); { LayerTreeHostImpl::FrameData frame; @@ -2751,7 +2749,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusion) LayerTreeSettings settings; settings.minimumOcclusionTrackingSize = gfx::Size(); settings.cacheRenderPassContents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get()); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); // Layers are structure as follows: // @@ -2866,7 +2864,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut) LayerTreeSettings settings; settings.minimumOcclusionTrackingSize = gfx::Size(); settings.cacheRenderPassContents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get()); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); // Layers are structure as follows: // @@ -2981,7 +2979,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal) LayerTreeSettings settings; settings.minimumOcclusionTrackingSize = gfx::Size(); settings.cacheRenderPassContents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get()); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); // Layers are structured as follows: // @@ -3068,7 +3066,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned) { LayerTreeSettings settings; settings.cacheRenderPassContents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get()); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); // Layers are structured as follows: // @@ -3143,7 +3141,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, m_renderingStatsInstrumentation.get()); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); // Layers are structure as follows: // @@ -3255,7 +3253,7 @@ TEST_F(LayerTreeHostImplTest, textureCachingWithScissor) LayerTreeSettings settings; settings.minimumOcclusionTrackingSize = gfx::Size(); settings.cacheRenderPassContents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get()); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); /* Layers are created as follows: @@ -3362,7 +3360,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, m_renderingStatsInstrumentation.get()); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); LayerImpl* rootPtr; LayerImpl* intermediateLayerPtr; @@ -3521,7 +3519,7 @@ TEST_F(LayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap) LayerTreeSettings settings; settings.minimumOcclusionTrackingSize = gfx::Size(); settings.cacheRenderPassContents = true; - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy, m_renderingStatsInstrumentation.get()); + scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::Create(settings, this, &m_proxy); LayerImpl* rootPtr; LayerImpl* intermediateLayerPtr; |