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

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

Issue 2715663007: Implement temporary reference assignment with DisplayCompositor. (Closed)
Patch Set: . Created 3 years, 9 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/ws/server_window_compositor_frame_sink_manager.h" 5 #include "services/ui/ws/server_window_compositor_frame_sink_manager.h"
6 6
7 #include "cc/ipc/display_compositor.mojom.h" 7 #include "cc/ipc/display_compositor.mojom.h"
8 #include "mojo/public/cpp/bindings/strong_binding.h" 8 #include "mojo/public/cpp/bindings/strong_binding.h"
9 #include "services/ui/ws/ids.h" 9 #include "services/ui/ws/ids.h"
10 #include "services/ui/ws/server_window.h" 10 #include "services/ui/ws/server_window.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } else { 60 } else {
61 private_request = 61 private_request =
62 mojo::MakeRequest(&frame_sink_data_->compositor_frame_sink); 62 mojo::MakeRequest(&frame_sink_data_->compositor_frame_sink);
63 } 63 }
64 64
65 window_->delegate()->GetDisplayCompositor()->CreateCompositorFrameSink( 65 window_->delegate()->GetDisplayCompositor()->CreateCompositorFrameSink(
66 window_->frame_sink_id(), std::move(request), std::move(private_request), 66 window_->frame_sink_id(), std::move(request), std::move(private_request),
67 std::move(client)); 67 std::move(client));
68 } 68 }
69 69
70 void ServerWindowCompositorFrameSinkManager::ClaimTemporaryReference(
71 const cc::SurfaceId& surface_id) {
72 if (!frame_sink_data_) {
73 frame_sink_data_ = base::MakeUnique<CompositorFrameSinkData>();
74 frame_sink_data_->pending_compositor_frame_sink_request =
75 mojo::MakeRequest(&frame_sink_data_->compositor_frame_sink);
76 }
77 frame_sink_data_->compositor_frame_sink->ClaimTemporaryReference(surface_id);
78 }
79
70 CompositorFrameSinkData::CompositorFrameSinkData() {} 80 CompositorFrameSinkData::CompositorFrameSinkData() {}
71 81
72 CompositorFrameSinkData::~CompositorFrameSinkData() {} 82 CompositorFrameSinkData::~CompositorFrameSinkData() {}
73 83
74 CompositorFrameSinkData::CompositorFrameSinkData( 84 CompositorFrameSinkData::CompositorFrameSinkData(
75 CompositorFrameSinkData&& other) 85 CompositorFrameSinkData&& other)
76 : compositor_frame_sink(std::move(other.compositor_frame_sink)) {} 86 : compositor_frame_sink(std::move(other.compositor_frame_sink)) {}
77 87
78 CompositorFrameSinkData& CompositorFrameSinkData::operator=( 88 CompositorFrameSinkData& CompositorFrameSinkData::operator=(
79 CompositorFrameSinkData&& other) { 89 CompositorFrameSinkData&& other) {
80 compositor_frame_sink = std::move(other.compositor_frame_sink); 90 compositor_frame_sink = std::move(other.compositor_frame_sink);
81 return *this; 91 return *this;
82 } 92 }
83 93
84 } // namespace ws 94 } // namespace ws
85 } // namespace ui 95 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698