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

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

Issue 2632273003: Move ReferencedSurfaceTracker into GpuCompositorFrameSink. (Closed)
Patch Set: Fix iterator invalidation. Created 3 years, 11 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
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 23 matching lines...) Expand all
34 cc::mojom::DisplayCompositorClientPtr client) 34 cc::mojom::DisplayCompositorClientPtr client)
35 : manager_(cc::SurfaceManager::LifetimeType::REFERENCES), 35 : manager_(cc::SurfaceManager::LifetimeType::REFERENCES),
36 reference_manager_(&manager_), 36 reference_manager_(&manager_),
37 gpu_service_(std::move(gpu_service)), 37 gpu_service_(std::move(gpu_service)),
38 gpu_memory_buffer_manager_(std::move(gpu_memory_buffer_manager)), 38 gpu_memory_buffer_manager_(std::move(gpu_memory_buffer_manager)),
39 image_factory_(image_factory), 39 image_factory_(image_factory),
40 task_runner_(base::ThreadTaskRunnerHandle::Get()), 40 task_runner_(base::ThreadTaskRunnerHandle::Get()),
41 client_(std::move(client)), 41 client_(std::move(client)),
42 binding_(this, std::move(request)) { 42 binding_(this, std::move(request)) {
43 manager_.AddObserver(this); 43 manager_.AddObserver(this);
44 if (client_)
45 client_->OnDisplayCompositorCreated(GetRootSurfaceId());
46 } 44 }
47 45
48 void DisplayCompositor::AddSurfaceReferences( 46 void DisplayCompositor::AddSurfaceReferences(
49 const std::vector<cc::SurfaceReference>& references) { 47 const std::vector<cc::SurfaceReference>& references) {
50 DCHECK(thread_checker_.CalledOnValidThread()); 48 DCHECK(thread_checker_.CalledOnValidThread());
51 for (const auto& reference : references) { 49 for (const auto& reference : references) {
52 reference_manager_->AddSurfaceReference(reference.parent_id(), 50 reference_manager_->AddSurfaceReference(reference.parent_id(),
53 reference.child_id()); 51 reference.child_id());
54 } 52 }
55 } 53 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 DCHECK_GT(surface_info.device_scale_factor(), 0.0f); 193 DCHECK_GT(surface_info.device_scale_factor(), 0.0f);
196 194
197 if (client_) 195 if (client_)
198 client_->OnSurfaceCreated(surface_info); 196 client_->OnSurfaceCreated(surface_info);
199 } 197 }
200 198
201 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id, 199 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id,
202 bool* changed) {} 200 bool* changed) {}
203 201
204 } // namespace ui 202 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698