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/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/scheduler/begin_frame_source.h" | 10 #include "cc/scheduler/begin_frame_source.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); | 147 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); |
148 compositor_->SetRootLayer(root_layer_.get()); | 148 compositor_->SetRootLayer(root_layer_.get()); |
149 mirroring_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); | 149 mirroring_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); |
150 compositor_->root_layer()->Add(mirroring_layer_.get()); | 150 compositor_->root_layer()->Add(mirroring_layer_.get()); |
151 gfx::Size size = output_surface_->SurfaceSize(); | 151 gfx::Size size = output_surface_->SurfaceSize(); |
152 mirroring_layer_->SetBounds(gfx::Rect(size.width(), size.height())); | 152 mirroring_layer_->SetBounds(gfx::Rect(size.width(), size.height())); |
153 } | 153 } |
154 | 154 |
155 void SetUpReflector() { | 155 void SetUpReflector() { |
156 reflector_ = base::WrapUnique( | 156 reflector_ = base::MakeUnique<ReflectorImpl>(compositor_.get(), |
157 new ReflectorImpl(compositor_.get(), mirroring_layer_.get())); | 157 mirroring_layer_.get()); |
158 reflector_->OnSourceSurfaceReady(output_surface_.get()); | 158 reflector_->OnSourceSurfaceReady(output_surface_.get()); |
159 } | 159 } |
160 | 160 |
161 void TearDown() override { | 161 void TearDown() override { |
162 if (reflector_) | 162 if (reflector_) |
163 reflector_->RemoveMirroringLayer(mirroring_layer_.get()); | 163 reflector_->RemoveMirroringLayer(mirroring_layer_.get()); |
164 cc::TextureMailbox mailbox; | 164 cc::TextureMailbox mailbox; |
165 std::unique_ptr<cc::SingleReleaseCallback> release; | 165 std::unique_ptr<cc::SingleReleaseCallback> release; |
166 if (mirroring_layer_->PrepareTextureMailbox(&mailbox, &release)) { | 166 if (mirroring_layer_->PrepareTextureMailbox(&mailbox, &release)) { |
167 release->Run(gpu::SyncToken(), false); | 167 release->Run(gpu::SyncToken(), false); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 plane_2.plane_z_order = 1; | 226 plane_2.plane_z_order = 1; |
227 list.push_back(plane_1); | 227 list.push_back(plane_1); |
228 list.push_back(plane_2); | 228 list.push_back(plane_2); |
229 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list); | 229 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list); |
230 EXPECT_FALSE(list[0].overlay_handled); | 230 EXPECT_FALSE(list[0].overlay_handled); |
231 } | 231 } |
232 #endif // defined(USE_OZONE) | 232 #endif // defined(USE_OZONE) |
233 | 233 |
234 } // namespace | 234 } // namespace |
235 } // namespace content | 235 } // namespace content |
OLD | NEW |