| 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/memory/ptr_util.h" | 5 #include "base/memory/ptr_util.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "cc/output/output_surface_frame.h" | 9 #include "cc/output/output_surface_frame.h" |
| 10 #include "cc/scheduler/begin_frame_source.h" | 10 #include "cc/scheduler/begin_frame_source.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 const gfx::Rect kSubRect(0, 0, 64, 64); | 117 const gfx::Rect kSubRect(0, 0, 64, 64); |
| 118 const gfx::Size kSurfaceSize(256, 256); | 118 const gfx::Size kSurfaceSize(256, 256); |
| 119 | 119 |
| 120 } // namespace | 120 } // namespace |
| 121 | 121 |
| 122 class ReflectorImplTest : public testing::Test { | 122 class ReflectorImplTest : public testing::Test { |
| 123 public: | 123 public: |
| 124 void SetUp() override { | 124 void SetUp() override { |
| 125 bool enable_pixel_output = false; | 125 bool enable_pixel_output = false; |
| 126 ui::ContextFactory* context_factory = | 126 ui::ContextFactory* context_factory = nullptr; |
| 127 ui::InitializeContextFactoryForTests(enable_pixel_output); | 127 ui::ContextFactoryPrivate* context_factory_private = nullptr; |
| 128 |
| 129 ui::InitializeContextFactoryForTests(enable_pixel_output, &context_factory, |
| 130 &context_factory_private); |
| 128 ImageTransportFactory::InitializeForUnitTests( | 131 ImageTransportFactory::InitializeForUnitTests( |
| 129 std::unique_ptr<ImageTransportFactory>( | 132 std::unique_ptr<ImageTransportFactory>( |
| 130 new NoTransportImageTransportFactory)); | 133 new NoTransportImageTransportFactory)); |
| 131 message_loop_.reset(new base::MessageLoop()); | 134 message_loop_.reset(new base::MessageLoop()); |
| 132 task_runner_ = message_loop_->task_runner(); | 135 task_runner_ = message_loop_->task_runner(); |
| 133 compositor_task_runner_ = new FakeTaskRunner(); | 136 compositor_task_runner_ = new FakeTaskRunner(); |
| 134 begin_frame_source_.reset(new cc::DelayBasedBeginFrameSource( | 137 begin_frame_source_.reset(new cc::DelayBasedBeginFrameSource( |
| 135 base::MakeUnique<cc::DelayBasedTimeSource>( | 138 base::MakeUnique<cc::DelayBasedTimeSource>( |
| 136 compositor_task_runner_.get()))); | 139 compositor_task_runner_.get()))); |
| 137 compositor_.reset( | 140 compositor_.reset(new ui::Compositor(context_factory, |
| 138 new ui::Compositor(context_factory, compositor_task_runner_.get())); | 141 context_factory_private, |
| 142 compositor_task_runner_.get())); |
| 139 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); | 143 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); |
| 140 | 144 |
| 141 auto context_provider = cc::TestContextProvider::Create(); | 145 auto context_provider = cc::TestContextProvider::Create(); |
| 142 context_provider->BindToCurrentThread(); | 146 context_provider->BindToCurrentThread(); |
| 143 output_surface_ = | 147 output_surface_ = |
| 144 base::MakeUnique<TestOutputSurface>(std::move(context_provider)); | 148 base::MakeUnique<TestOutputSurface>(std::move(context_provider)); |
| 145 | 149 |
| 146 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); | 150 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); |
| 147 compositor_->SetRootLayer(root_layer_.get()); | 151 compositor_->SetRootLayer(root_layer_.get()); |
| 148 mirroring_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); | 152 mirroring_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 plane_2.plane_z_order = 1; | 229 plane_2.plane_z_order = 1; |
| 226 list.push_back(plane_1); | 230 list.push_back(plane_1); |
| 227 list.push_back(plane_2); | 231 list.push_back(plane_2); |
| 228 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list); | 232 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list); |
| 229 EXPECT_FALSE(list[0].overlay_handled); | 233 EXPECT_FALSE(list[0].overlay_handled); |
| 230 } | 234 } |
| 231 #endif // defined(USE_OZONE) | 235 #endif // defined(USE_OZONE) |
| 232 | 236 |
| 233 } // namespace | 237 } // namespace |
| 234 } // namespace content | 238 } // namespace content |
| OLD | NEW |