Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1854)

Unified Diff: cc/layer_tree_host_impl_unittest.cc

Issue 11369071: A speculative Revert for r165872 - Remove static thread pointers from CC, attempt 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_impl_unittest.cc
===================================================================
--- cc/layer_tree_host_impl_unittest.cc (revision 165906)
+++ cc/layer_tree_host_impl_unittest.cc (working copy)
@@ -23,7 +23,6 @@
#include "cc/single_thread_proxy.h"
#include "cc/solid_color_draw_quad.h"
#include "cc/test/animation_test_common.h"
-#include "cc/test/fake_proxy.h"
#include "cc/test/fake_web_compositor_output_surface.h"
#include "cc/test/fake_web_graphics_context_3d.h"
#include "cc/test/fake_web_scrollbar_theme_geometry.h"
@@ -64,10 +63,7 @@
public LayerTreeHostImplClient {
public:
LayerTreeHostImplTest()
- : m_proxy(scoped_ptr<Thread>(NULL))
- , m_alwaysImplThread(&m_proxy)
- , m_alwaysMainThreadBlocked(&m_proxy)
- , m_onCanDrawStateChangedCalled(false)
+ : m_onCanDrawStateChangedCalled(false)
, m_didRequestCommit(false)
, m_didRequestRedraw(false)
, m_reduceMemoryResult(true)
@@ -81,7 +77,7 @@
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
- m_hostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ m_hostImpl = LayerTreeHostImpl::create(settings, this);
m_hostImpl->initializeRenderer(createContext());
m_hostImpl->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
}
@@ -109,7 +105,7 @@
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
- scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
myHostImpl->initializeRenderer(graphicsContext.Pass());
myHostImpl->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
@@ -193,7 +189,6 @@
return FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3D)).PassAs<GraphicsContext>();
}
- FakeProxy m_proxy;
DebugScopedSetImplThread m_alwaysImplThread;
DebugScopedSetMainThreadBlocked m_alwaysMainThreadBlocked;
@@ -357,7 +352,7 @@
TEST_P(LayerTreeHostImplTest, scrollWithoutRenderer)
{
LayerTreeSettings settings;
- m_hostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ m_hostImpl = LayerTreeHostImpl::create(settings, this);
// Initialization will fail here.
m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DMakeCurrentFails)).PassAs<GraphicsContext>());
@@ -1953,7 +1948,7 @@
// that we can force partial swap enabled.
LayerTreeSettings settings;
Settings::setPartialSwapEnabled(true);
- scoped_ptr<LayerTreeHostImpl> layerTreeHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> layerTreeHostImpl = LayerTreeHostImpl::create(settings, this);
layerTreeHostImpl->initializeRenderer(outputSurface.Pass());
layerTreeHostImpl->setViewportSize(gfx::Size(500, 500), gfx::Size(500, 500));
@@ -2233,14 +2228,14 @@
}
};
-static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, LayerTreeHostImplClient* client, Proxy* proxy)
+static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, LayerTreeHostImplClient* client)
{
Settings::setPartialSwapEnabled(partialSwap);
scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
LayerTreeSettings settings;
- scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, client, proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, client);
myHostImpl->initializeRenderer(context.Pass());
myHostImpl->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
@@ -2303,7 +2298,7 @@
TEST_P(LayerTreeHostImplTest, contributingLayerEmptyScissorPartialSwap)
{
- scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(true, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(true, this);
{
LayerTreeHostImpl::FrameData frame;
@@ -2324,7 +2319,7 @@
TEST_P(LayerTreeHostImplTest, contributingLayerEmptyScissorNoPartialSwap)
{
- scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(false, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = setupLayersForOpacity(false, this);
{
LayerTreeHostImpl::FrameData frame;
@@ -2390,7 +2385,7 @@
TEST_P(LayerTreeHostImplTest, finishAllRenderingAfterContextLost)
{
LayerTreeSettings settings;
- m_hostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ m_hostImpl = LayerTreeHostImpl::create(settings, this);
// The context initialization will fail, but we should still be able to call finishAllRendering() without any ill effects.
m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DMakeCurrentFails)).PassAs<GraphicsContext>());
@@ -2414,7 +2409,7 @@
TEST_P(LayerTreeHostImplTest, contextLostDuringInitialize)
{
LayerTreeSettings settings;
- m_hostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ m_hostImpl = LayerTreeHostImpl::create(settings, this);
// Initialize into a known successful state.
EXPECT_TRUE(m_hostImpl->initializeRenderer(createContext()));
@@ -3025,7 +3020,7 @@
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
- scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
LayerImpl* rootPtr;
LayerImpl* surfaceLayerPtr;
@@ -3122,7 +3117,7 @@
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
- scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
// Layers are structure as follows:
//
@@ -3238,7 +3233,7 @@
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
- scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
// Layers are structure as follows:
//
@@ -3354,7 +3349,7 @@
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
- scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
// Layers are structured as follows:
//
@@ -3442,7 +3437,7 @@
Settings::setPartialSwapEnabled(false);
LayerTreeSettings settings;
- scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
// Layers are structured as follows:
//
@@ -3517,7 +3512,7 @@
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
- scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
// Layers are structure as follows:
//
@@ -3630,7 +3625,7 @@
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
- scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
/*
Layers are created as follows:
@@ -3737,7 +3732,7 @@
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
- scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
LayerImpl* rootPtr;
LayerImpl* intermediateLayerPtr;
@@ -3898,7 +3893,7 @@
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
- scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
+ scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
LayerImpl* rootPtr;
LayerImpl* intermediateLayerPtr;
@@ -4090,9 +4085,9 @@
class TestRenderer : public GLRenderer, public RendererClient {
public:
- static scoped_ptr<TestRenderer> create(ResourceProvider* resourceProvider, Proxy* proxy)
+ static scoped_ptr<TestRenderer> create(ResourceProvider* resourceProvider)
{
- scoped_ptr<TestRenderer> renderer(new TestRenderer(resourceProvider, proxy));
+ scoped_ptr<TestRenderer> renderer(new TestRenderer(resourceProvider));
if (!renderer->initialize())
return scoped_ptr<TestRenderer>();
@@ -4112,10 +4107,9 @@
virtual void setFullRootLayerDamage() OVERRIDE { }
virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE { }
virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE { }
- virtual bool hasImplThread() const OVERRIDE { return false; }
protected:
- TestRenderer(ResourceProvider* resourceProvider, Proxy* proxy) : GLRenderer(this, resourceProvider) { }
+ TestRenderer(ResourceProvider* resourceProvider) : GLRenderer(this, resourceProvider) { }
private:
LayerTreeSettings m_settings;
@@ -4399,7 +4393,7 @@
ASSERT_TRUE(context->context3D());
scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(context.get()));
- scoped_ptr<TestRenderer> renderer(TestRenderer::create(resourceProvider.get(), &m_proxy));
+ scoped_ptr<TestRenderer> renderer(TestRenderer::create(resourceProvider.get()));
int testCaseIndex = 0;
while (removeRenderPassesCases[testCaseIndex].name) {
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698