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

Side by Side Diff: services/ui/ws/server_window_compositor_frame_sink_manager.cc

Issue 2471503002: Mus+Ash: Unify CompositorFrameSinks (Closed)
Patch Set: Added comment Created 4 years, 1 month 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/ws/server_window_compositor_frame_sink_manager.h" 5 #include "services/ui/ws/server_window_compositor_frame_sink_manager.h"
6 6
7 #include "services/ui/surfaces/display_compositor.h" 7 #include "services/ui/surfaces/display_compositor.h"
8 #include "services/ui/ws/ids.h" 8 #include "services/ui/ws/ids.h"
9 #include "services/ui/ws/server_window.h" 9 #include "services/ui/ws/server_window.h"
10 #include "services/ui/ws/server_window_compositor_frame_sink.h" 10 #include "services/ui/ws/server_window_compositor_frame_sink.h"
(...skipping 22 matching lines...) Expand all
33 33
34 waiting_for_initial_frames_ = !IsCompositorFrameSinkReadyAndNonEmpty( 34 waiting_for_initial_frames_ = !IsCompositorFrameSinkReadyAndNonEmpty(
35 mojom::CompositorFrameSinkType::DEFAULT) || 35 mojom::CompositorFrameSinkType::DEFAULT) ||
36 !IsCompositorFrameSinkReadyAndNonEmpty( 36 !IsCompositorFrameSinkReadyAndNonEmpty(
37 mojom::CompositorFrameSinkType::UNDERLAY); 37 mojom::CompositorFrameSinkType::UNDERLAY);
38 return !waiting_for_initial_frames_; 38 return !waiting_for_initial_frames_;
39 } 39 }
40 40
41 void ServerWindowCompositorFrameSinkManager::CreateCompositorFrameSink( 41 void ServerWindowCompositorFrameSinkManager::CreateCompositorFrameSink(
42 mojom::CompositorFrameSinkType compositor_frame_sink_type, 42 mojom::CompositorFrameSinkType compositor_frame_sink_type,
43 mojo::InterfaceRequest<cc::mojom::MojoCompositorFrameSink> request, 43 gfx::AcceleratedWidget widget,
44 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
45 scoped_refptr<SurfacesContextProvider> context_provider,
46 cc::mojom::MojoCompositorFrameSinkRequest request,
44 cc::mojom::MojoCompositorFrameSinkClientPtr client) { 47 cc::mojom::MojoCompositorFrameSinkClientPtr client) {
45 cc::FrameSinkId frame_sink_id( 48 cc::FrameSinkId frame_sink_id(
46 WindowIdToTransportId(window_->id()), 49 WindowIdToTransportId(window_->id()),
47 static_cast<uint32_t>(compositor_frame_sink_type)); 50 static_cast<uint32_t>(compositor_frame_sink_type));
48 CompositorFrameSinkData& data = 51 CompositorFrameSinkData& data =
49 type_to_compositor_frame_sink_map_[compositor_frame_sink_type]; 52 type_to_compositor_frame_sink_map_[compositor_frame_sink_type];
53 // TODO(fsamuel): Create the CompositorFrameSink through the DisplayCompositor
54 // mojo interface and hold on to a MojoCompositorFrameSinkPtr.
50 data.compositor_frame_sink = 55 data.compositor_frame_sink =
51 base::MakeUnique<ServerWindowCompositorFrameSink>( 56 base::MakeUnique<ServerWindowCompositorFrameSink>(
52 this, frame_sink_id, std::move(request), std::move(client)); 57 this, frame_sink_id, widget, gpu_memory_buffer_manager,
58 std::move(context_provider), std::move(request), std::move(client));
53 data.surface_sequence_generator.set_frame_sink_id(frame_sink_id); 59 data.surface_sequence_generator.set_frame_sink_id(frame_sink_id);
54 } 60 }
55 61
56 ServerWindowCompositorFrameSink* 62 ServerWindowCompositorFrameSink*
57 ServerWindowCompositorFrameSinkManager::GetDefaultCompositorFrameSink() const { 63 ServerWindowCompositorFrameSinkManager::GetDefaultCompositorFrameSink() const {
58 return GetCompositorFrameSinkByType(mojom::CompositorFrameSinkType::DEFAULT); 64 return GetCompositorFrameSinkByType(mojom::CompositorFrameSinkType::DEFAULT);
59 } 65 }
60 66
61 ServerWindowCompositorFrameSink* 67 ServerWindowCompositorFrameSink*
62 ServerWindowCompositorFrameSinkManager::GetUnderlayCompositorFrameSink() const { 68 ServerWindowCompositorFrameSinkManager::GetUnderlayCompositorFrameSink() const {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 154
149 CompositorFrameSinkData& CompositorFrameSinkData::operator=( 155 CompositorFrameSinkData& CompositorFrameSinkData::operator=(
150 CompositorFrameSinkData&& other) { 156 CompositorFrameSinkData&& other) {
151 latest_submitted_surface_id = other.latest_submitted_surface_id; 157 latest_submitted_surface_id = other.latest_submitted_surface_id;
152 compositor_frame_sink = std::move(other.compositor_frame_sink); 158 compositor_frame_sink = std::move(other.compositor_frame_sink);
153 return *this; 159 return *this;
154 } 160 }
155 161
156 } // namespace ws 162 } // namespace ws
157 } // namespace ui 163 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698