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

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

Issue 2540783004: Add SurfaceManager option to use references exclusively. (Closed)
Patch Set: Add .push(). Created 4 years 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 | « cc/surfaces/surface_manager.cc ('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 "cc/output/in_process_context_provider.h" 9 #include "cc/output/in_process_context_provider.h"
10 #include "cc/surfaces/surface.h" 10 #include "cc/surfaces/surface.h"
11 #include "gpu/command_buffer/client/shared_memory_limits.h" 11 #include "gpu/command_buffer/client/shared_memory_limits.h"
12 #include "gpu/ipc/gpu_in_process_thread_service.h" 12 #include "gpu/ipc/gpu_in_process_thread_service.h"
13 #include "mojo/public/cpp/bindings/strong_binding.h" 13 #include "mojo/public/cpp/bindings/strong_binding.h"
14 #include "services/ui/surfaces/gpu_compositor_frame_sink.h" 14 #include "services/ui/surfaces/gpu_compositor_frame_sink.h"
15 15
16 namespace ui { 16 namespace ui {
17 17
18 DisplayCompositor::DisplayCompositor( 18 DisplayCompositor::DisplayCompositor(
19 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service, 19 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service,
20 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager, 20 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager,
21 gpu::ImageFactory* image_factory, 21 gpu::ImageFactory* image_factory,
22 cc::mojom::DisplayCompositorRequest request, 22 cc::mojom::DisplayCompositorRequest request,
23 cc::mojom::DisplayCompositorClientPtr client) 23 cc::mojom::DisplayCompositorClientPtr client)
24 : gpu_service_(std::move(gpu_service)), 24 : manager_(cc::SurfaceManager::LifetimeType::REFERENCES),
25 gpu_service_(std::move(gpu_service)),
25 gpu_memory_buffer_manager_(std::move(gpu_memory_buffer_manager)), 26 gpu_memory_buffer_manager_(std::move(gpu_memory_buffer_manager)),
26 image_factory_(image_factory), 27 image_factory_(image_factory),
27 client_(std::move(client)), 28 client_(std::move(client)),
28 reference_manager_(&manager_), 29 reference_manager_(&manager_),
29 binding_(this, std::move(request)) { 30 binding_(this, std::move(request)) {
30 manager_.AddObserver(this); 31 manager_.AddObserver(this);
31 } 32 }
32 33
33 void DisplayCompositor::CreateCompositorFrameSink( 34 void DisplayCompositor::CreateCompositorFrameSink(
34 const cc::FrameSinkId& frame_sink_id, 35 const cc::FrameSinkId& frame_sink_id,
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 surface_id.local_frame_id()); 176 surface_id.local_frame_id());
176 177
177 if (client_) 178 if (client_)
178 client_->OnSurfaceCreated(surface_id, frame_size, device_scale_factor); 179 client_->OnSurfaceCreated(surface_id, frame_size, device_scale_factor);
179 } 180 }
180 181
181 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id, 182 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id,
182 bool* changed) {} 183 bool* changed) {}
183 184
184 } // namespace ui 185 } // namespace ui
OLDNEW
« no previous file with comments | « cc/surfaces/surface_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698