| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/run_loop.h" | 5 #include "base/run_loop.h" |
| 6 #include "base/single_thread_task_runner.h" | 6 #include "base/single_thread_task_runner.h" |
| 7 #include "cc/test/fake_output_surface_client.h" | 7 #include "cc/test/fake_output_surface_client.h" |
| 8 #include "cc/test/test_context_provider.h" | 8 #include "cc/test/test_context_provider.h" |
| 9 #include "cc/test/test_web_graphics_context_3d.h" | 9 #include "cc/test/test_web_graphics_context_3d.h" |
| 10 #include "content/browser/compositor/browser_compositor_output_surface.h" | 10 #include "content/browser/compositor/browser_compositor_output_surface.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 ui::ContextFactory* context_factory = | 117 ui::ContextFactory* context_factory = |
| 118 ui::InitializeContextFactoryForTests(enable_pixel_output); | 118 ui::InitializeContextFactoryForTests(enable_pixel_output); |
| 119 ImageTransportFactory::InitializeForUnitTests( | 119 ImageTransportFactory::InitializeForUnitTests( |
| 120 scoped_ptr<ImageTransportFactory>( | 120 scoped_ptr<ImageTransportFactory>( |
| 121 new NoTransportImageTransportFactory)); | 121 new NoTransportImageTransportFactory)); |
| 122 message_loop_.reset(new base::MessageLoop()); | 122 message_loop_.reset(new base::MessageLoop()); |
| 123 task_runner_ = message_loop_->task_runner(); | 123 task_runner_ = message_loop_->task_runner(); |
| 124 compositor_task_runner_ = new FakeTaskRunner(); | 124 compositor_task_runner_ = new FakeTaskRunner(); |
| 125 compositor_.reset( | 125 compositor_.reset( |
| 126 new ui::Compositor(context_factory, compositor_task_runner_.get())); | 126 new ui::Compositor(context_factory, compositor_task_runner_.get())); |
| 127 compositor_->SetAcceleratedWidgetAndStartCompositor( | 127 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); |
| 128 gfx::kNullAcceleratedWidget); | |
| 129 context_provider_ = cc::TestContextProvider::Create( | 128 context_provider_ = cc::TestContextProvider::Create( |
| 130 cc::TestWebGraphicsContext3D::Create().Pass()); | 129 cc::TestWebGraphicsContext3D::Create().Pass()); |
| 131 output_surface_ = | 130 output_surface_ = |
| 132 scoped_ptr<TestOutputSurface>( | 131 scoped_ptr<TestOutputSurface>( |
| 133 new TestOutputSurface(context_provider_, | 132 new TestOutputSurface(context_provider_, |
| 134 compositor_->vsync_manager())).Pass(); | 133 compositor_->vsync_manager())).Pass(); |
| 135 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 134 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
| 136 | 135 |
| 137 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); | 136 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); |
| 138 compositor_->SetRootLayer(root_layer_.get()); | 137 compositor_->SetRootLayer(root_layer_.get()); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 plane_2.plane_z_order = 1; | 215 plane_2.plane_z_order = 1; |
| 217 list.push_back(plane_1); | 216 list.push_back(plane_1); |
| 218 list.push_back(plane_2); | 217 list.push_back(plane_2); |
| 219 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list); | 218 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list); |
| 220 EXPECT_FALSE(list[0].overlay_handled); | 219 EXPECT_FALSE(list[0].overlay_handled); |
| 221 } | 220 } |
| 222 #endif // defined(USE_OZONE) | 221 #endif // defined(USE_OZONE) |
| 223 | 222 |
| 224 } // namespace | 223 } // namespace |
| 225 } // namespace content | 224 } // namespace content |
| OLD | NEW |