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

Side by Side Diff: services/ui/surfaces/display_compositor.cc

Issue 2654653004: Remove SurfaceReferenceManager interface. (Closed)
Patch Set: Rebase + fix tests. Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « services/ui/surfaces/display_compositor.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "services/ui/surfaces/display_compositor.h" 5 #include "services/ui/surfaces/display_compositor.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 16 matching lines...) Expand all
27 27
28 namespace ui { 28 namespace ui {
29 29
30 DisplayCompositor::DisplayCompositor( 30 DisplayCompositor::DisplayCompositor(
31 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service, 31 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service,
32 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager, 32 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager,
33 gpu::ImageFactory* image_factory, 33 gpu::ImageFactory* image_factory,
34 cc::mojom::DisplayCompositorRequest request, 34 cc::mojom::DisplayCompositorRequest request,
35 cc::mojom::DisplayCompositorClientPtr client) 35 cc::mojom::DisplayCompositorClientPtr client)
36 : manager_(cc::SurfaceManager::LifetimeType::REFERENCES), 36 : manager_(cc::SurfaceManager::LifetimeType::REFERENCES),
37 reference_manager_(&manager_),
38 gpu_service_(std::move(gpu_service)), 37 gpu_service_(std::move(gpu_service)),
39 gpu_memory_buffer_manager_(std::move(gpu_memory_buffer_manager)), 38 gpu_memory_buffer_manager_(std::move(gpu_memory_buffer_manager)),
40 image_factory_(image_factory), 39 image_factory_(image_factory),
41 task_runner_(base::ThreadTaskRunnerHandle::Get()), 40 task_runner_(base::ThreadTaskRunnerHandle::Get()),
42 client_(std::move(client)), 41 client_(std::move(client)),
43 binding_(this, std::move(request)) { 42 binding_(this, std::move(request)) {
44 manager_.AddObserver(this); 43 manager_.AddObserver(this);
45 } 44 }
46 45
47 DisplayCompositor::~DisplayCompositor() { 46 DisplayCompositor::~DisplayCompositor() {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 std::unique_ptr<cc::DisplayScheduler> scheduler( 141 std::unique_ptr<cc::DisplayScheduler> scheduler(
143 new cc::DisplayScheduler(task_runner_.get(), max_frames_pending)); 142 new cc::DisplayScheduler(task_runner_.get(), max_frames_pending));
144 143
145 return base::MakeUnique<cc::Display>( 144 return base::MakeUnique<cc::Display>(
146 nullptr /* bitmap_manager */, gpu_memory_buffer_manager_.get(), 145 nullptr /* bitmap_manager */, gpu_memory_buffer_manager_.get(),
147 cc::RendererSettings(), frame_sink_id, begin_frame_source, 146 cc::RendererSettings(), frame_sink_id, begin_frame_source,
148 std::move(display_output_surface), std::move(scheduler), 147 std::move(display_output_surface), std::move(scheduler),
149 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner_.get())); 148 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner_.get()));
150 } 149 }
151 150
152 const cc::SurfaceId& DisplayCompositor::GetRootSurfaceId() const {
153 return reference_manager_->GetRootSurfaceId();
154 }
155
156 void DisplayCompositor::OnSurfaceCreated(const cc::SurfaceInfo& surface_info) { 151 void DisplayCompositor::OnSurfaceCreated(const cc::SurfaceInfo& surface_info) {
157 DCHECK(thread_checker_.CalledOnValidThread()); 152 DCHECK(thread_checker_.CalledOnValidThread());
158 DCHECK_GT(surface_info.device_scale_factor(), 0.0f); 153 DCHECK_GT(surface_info.device_scale_factor(), 0.0f);
159 154
160 if (client_) 155 if (client_)
161 client_->OnSurfaceCreated(surface_info); 156 client_->OnSurfaceCreated(surface_info);
162 } 157 }
163 158
164 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id, 159 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id,
165 bool* changed) {} 160 bool* changed) {}
166 161
167 } // namespace ui 162 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/surfaces/display_compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698