Chromium Code Reviews| 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 "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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 cc::mojom::MojoCompositorFrameSinkClientPtr client) { | 101 cc::mojom::MojoCompositorFrameSinkClientPtr client) { |
| 102 DCHECK(thread_checker_.CalledOnValidThread()); | 102 DCHECK(thread_checker_.CalledOnValidThread()); |
| 103 DCHECK_EQ(0u, compositor_frame_sinks_.count(frame_sink_id)); | 103 DCHECK_EQ(0u, compositor_frame_sinks_.count(frame_sink_id)); |
| 104 | 104 |
| 105 compositor_frame_sinks_[frame_sink_id] = | 105 compositor_frame_sinks_[frame_sink_id] = |
| 106 base::MakeUnique<display_compositor::GpuCompositorFrameSink>( | 106 base::MakeUnique<display_compositor::GpuCompositorFrameSink>( |
| 107 this, &manager_, frame_sink_id, std::move(request), | 107 this, &manager_, frame_sink_id, std::move(request), |
| 108 std::move(private_request), std::move(client)); | 108 std::move(private_request), std::move(client)); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void DisplayCompositor::DropTemporaryReference( | |
| 112 const cc::SurfaceId& surface_id) { | |
| 113 manager_.DropTemporaryReference(surface_id); | |
| 114 } | |
| 115 | |
| 111 std::unique_ptr<cc::Display> DisplayCompositor::CreateDisplay( | 116 std::unique_ptr<cc::Display> DisplayCompositor::CreateDisplay( |
| 112 const cc::FrameSinkId& frame_sink_id, | 117 const cc::FrameSinkId& frame_sink_id, |
| 113 gpu::SurfaceHandle surface_handle, | 118 gpu::SurfaceHandle surface_handle, |
| 114 cc::SyntheticBeginFrameSource* begin_frame_source) { | 119 cc::SyntheticBeginFrameSource* begin_frame_source) { |
| 115 scoped_refptr<cc::InProcessContextProvider> context_provider = | 120 scoped_refptr<cc::InProcessContextProvider> context_provider = |
| 116 new cc::InProcessContextProvider( | 121 new cc::InProcessContextProvider( |
| 117 gpu_service_, surface_handle, gpu_memory_buffer_manager_.get(), | 122 gpu_service_, surface_handle, gpu_memory_buffer_manager_.get(), |
| 118 image_factory_, gpu::SharedMemoryLimits(), | 123 image_factory_, gpu::SharedMemoryLimits(), |
| 119 nullptr /* shared_context */); | 124 nullptr /* shared_context */); |
| 120 | 125 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 } | 161 } |
| 157 | 162 |
| 158 void DisplayCompositor::DestroyCompositorFrameSink(cc::FrameSinkId sink_id) { | 163 void DisplayCompositor::DestroyCompositorFrameSink(cc::FrameSinkId sink_id) { |
| 159 compositor_frame_sinks_.erase(sink_id); | 164 compositor_frame_sinks_.erase(sink_id); |
| 160 } | 165 } |
| 161 | 166 |
| 162 void DisplayCompositor::OnSurfaceCreated(const cc::SurfaceInfo& surface_info) { | 167 void DisplayCompositor::OnSurfaceCreated(const cc::SurfaceInfo& surface_info) { |
| 163 DCHECK(thread_checker_.CalledOnValidThread()); | 168 DCHECK(thread_checker_.CalledOnValidThread()); |
| 164 DCHECK_GT(surface_info.device_scale_factor(), 0.0f); | 169 DCHECK_GT(surface_info.device_scale_factor(), 0.0f); |
| 165 | 170 |
| 171 // TODO(kylechar): |client_| will try to find an owner for the temporary | |
| 172 // reference to the new surface. With surface synchronization this might not | |
|
Fady Samuel
2017/02/24 18:07:38
More details please? Why won't this be necessary,
kylechar
2017/02/28 18:07:15
Done.
| |
| 173 // be necessary in all cases, so we should let |client_| know if there is a | |
| 174 // temporary reference or not. | |
| 166 if (client_) | 175 if (client_) |
| 167 client_->OnSurfaceCreated(surface_info); | 176 client_->OnSurfaceCreated(surface_info); |
| 168 } | 177 } |
| 169 | 178 |
| 170 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id, | 179 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id, |
| 171 bool* changed) {} | 180 bool* changed) {} |
| 172 | 181 |
| 173 } // namespace ui | 182 } // namespace ui |
| OLD | NEW |