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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 1356463002: Revert of cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2b2b28faa77354ae61206346ea7ee876ca7fab1e..7786bae2e4d734188576fcdb1c144dd8213d5c56 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -168,8 +168,7 @@
settings, this, &proxy_, &stats_instrumentation_,
&shared_bitmap_manager_, &gpu_memory_buffer_manager_,
&task_graph_runner_, 0);
- output_surface_ = output_surface.Pass();
- bool init = host_impl_->InitializeRenderer(output_surface_.get());
+ bool init = host_impl_->InitializeRenderer(output_surface.Pass());
host_impl_->SetViewportSize(gfx::Size(10, 10));
host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 1.f);
// Set the BeginFrameArgs so that methods which use it are able to.
@@ -421,7 +420,6 @@
TestSharedBitmapManager shared_bitmap_manager_;
TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
TestTaskGraphRunner task_graph_runner_;
- scoped_ptr<OutputSurface> output_surface_;
scoped_ptr<LayerTreeHostImpl> host_impl_;
FakeRenderingStatsInstrumentation stats_instrumentation_;
bool on_can_draw_state_changed_called_;
@@ -2118,8 +2116,7 @@
settings, this, &proxy_, &shared_bitmap_manager_,
&task_graph_runner_, &stats_instrumentation_);
host_impl_ = make_scoped_ptr(host_impl_override_time);
- output_surface_ = CreateOutputSurface();
- host_impl_->InitializeRenderer(output_surface_.get());
+ host_impl_->InitializeRenderer(CreateOutputSurface());
SetupScrollAndContentsLayers(content_size);
host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 4.f);
@@ -5616,7 +5613,7 @@
LayerTreeHostImpl::Create(
settings, this, &proxy_, &stats_instrumentation_,
&shared_bitmap_manager_, NULL, &task_graph_runner_, 0);
- layer_tree_host_impl->InitializeRenderer(output_surface.get());
+ layer_tree_host_impl->InitializeRenderer(output_surface.Pass());
layer_tree_host_impl->WillBeginImplFrame(
CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
layer_tree_host_impl->SetViewportSize(gfx::Size(500, 500));
@@ -5893,14 +5890,19 @@
Proxy* proxy,
SharedBitmapManager* manager,
TaskGraphRunner* task_graph_runner,
- RenderingStatsInstrumentation* stats_instrumentation,
- OutputSurface* output_surface) {
+ RenderingStatsInstrumentation* stats_instrumentation) {
+ scoped_refptr<TestContextProvider> provider(TestContextProvider::Create());
+ scoped_ptr<OutputSurface> output_surface(
+ FakeOutputSurface::Create3d(provider));
+ provider->BindToCurrentThread();
+ provider->TestContext3d()->set_have_post_sub_buffer(true);
+
LayerTreeSettings settings;
settings.renderer_settings.partial_swap_enabled = partial_swap;
scoped_ptr<LayerTreeHostImpl> my_host_impl =
LayerTreeHostImpl::Create(settings, client, proxy, stats_instrumentation,
manager, nullptr, task_graph_runner, 0);
- my_host_impl->InitializeRenderer(output_surface);
+ my_host_impl->InitializeRenderer(output_surface.Pass());
my_host_impl->WillBeginImplFrame(
CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
my_host_impl->SetViewportSize(gfx::Size(100, 100));
@@ -5963,14 +5965,9 @@
TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorPartialSwap) {
TestSharedBitmapManager shared_bitmap_manager;
TestTaskGraphRunner task_graph_runner;
- scoped_refptr<TestContextProvider> provider(TestContextProvider::Create());
- provider->BindToCurrentThread();
- provider->TestContext3d()->set_have_post_sub_buffer(true);
- scoped_ptr<OutputSurface> output_surface(
- FakeOutputSurface::Create3d(provider));
- scoped_ptr<LayerTreeHostImpl> my_host_impl = SetupLayersForOpacity(
- true, this, &proxy_, &shared_bitmap_manager, &task_graph_runner,
- &stats_instrumentation_, output_surface.get());
+ scoped_ptr<LayerTreeHostImpl> my_host_impl =
+ SetupLayersForOpacity(true, this, &proxy_, &shared_bitmap_manager,
+ &task_graph_runner, &stats_instrumentation_);
{
LayerTreeHostImpl::FrameData frame;
EXPECT_EQ(DRAW_SUCCESS, my_host_impl->PrepareToDraw(&frame));
@@ -5992,14 +5989,9 @@
TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorNoPartialSwap) {
TestSharedBitmapManager shared_bitmap_manager;
TestTaskGraphRunner task_graph_runner;
- scoped_refptr<TestContextProvider> provider(TestContextProvider::Create());
- provider->BindToCurrentThread();
- provider->TestContext3d()->set_have_post_sub_buffer(true);
- scoped_ptr<OutputSurface> output_surface(
- FakeOutputSurface::Create3d(provider));
- scoped_ptr<LayerTreeHostImpl> my_host_impl = SetupLayersForOpacity(
- false, this, &proxy_, &shared_bitmap_manager, &task_graph_runner,
- &stats_instrumentation_, output_surface.get());
+ scoped_ptr<LayerTreeHostImpl> my_host_impl =
+ SetupLayersForOpacity(false, this, &proxy_, &shared_bitmap_manager,
+ &task_graph_runner, &stats_instrumentation_);
{
LayerTreeHostImpl::FrameData frame;
EXPECT_EQ(DRAW_SUCCESS, my_host_impl->PrepareToDraw(&frame));
@@ -6418,9 +6410,9 @@
settings, this, &proxy_, &stats_instrumentation_, &shared_bitmap_manager_,
&gpu_memory_buffer_manager_, &task_graph_runner_, 0);
- output_surface_ =
- FakeOutputSurface::Create3d(TestWebGraphicsContext3D::Create());
- host_impl_->InitializeRenderer(output_surface_.get());
+ scoped_ptr<OutputSurface> output_surface(
+ FakeOutputSurface::Create3d(TestWebGraphicsContext3D::Create()));
+ host_impl_->InitializeRenderer(output_surface.Pass());
EXPECT_LT(0ul, host_impl_->memory_allocation_limit_bytes());
}
@@ -6481,8 +6473,7 @@
new FakeLayerTreeHostImpl(LayerTreeSettings(), &proxy_,
&shared_bitmap_manager_, &task_graph_runner_);
host_impl_.reset(fake_host_impl_);
- output_surface_ = CreateOutputSurface();
- host_impl_->InitializeRenderer(output_surface_.get());
+ host_impl_->InitializeRenderer(CreateOutputSurface());
host_impl_->SetViewportSize(gfx::Size(10, 10));
}
@@ -8476,8 +8467,7 @@
public:
static scoped_ptr<MockReclaimResourcesOutputSurface> Create3d() {
return make_scoped_ptr(new MockReclaimResourcesOutputSurface(
- TestContextProvider::Create(), TestContextProvider::CreateWorker(),
- false));
+ TestContextProvider::Create(), TestContextProvider::Create(), false));
}
MOCK_METHOD0(ForceReclaimResources, void());
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698