OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/public/cpp/window_compositor_frame_sink.h" | 5 #include "services/ui/public/cpp/window_compositor_frame_sink.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/output/compositor_frame_sink_client.h" | 10 #include "cc/output/compositor_frame_sink_client.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 begin_frame_source_ = base::MakeUnique<cc::ExternalBeginFrameSource>(this); | 50 begin_frame_source_ = base::MakeUnique<cc::ExternalBeginFrameSource>(this); |
51 | 51 |
52 client->SetBeginFrameSource(begin_frame_source_.get()); | 52 client->SetBeginFrameSource(begin_frame_source_.get()); |
53 return true; | 53 return true; |
54 } | 54 } |
55 | 55 |
56 void WindowCompositorFrameSink::DetachFromClient() { | 56 void WindowCompositorFrameSink::DetachFromClient() { |
57 client_->SetBeginFrameSource(nullptr); | 57 client_->SetBeginFrameSource(nullptr); |
58 begin_frame_source_.reset(); | 58 begin_frame_source_.reset(); |
| 59 client_binding_.reset(); |
59 compositor_frame_sink_.reset(); | 60 compositor_frame_sink_.reset(); |
60 cc::CompositorFrameSink::DetachFromClient(); | 61 cc::CompositorFrameSink::DetachFromClient(); |
61 } | 62 } |
62 | 63 |
63 void WindowCompositorFrameSink::SubmitCompositorFrame( | 64 void WindowCompositorFrameSink::SubmitCompositorFrame( |
64 cc::CompositorFrame frame) { | 65 cc::CompositorFrame frame) { |
65 DCHECK(thread_checker_); | 66 DCHECK(thread_checker_); |
66 DCHECK(thread_checker_->CalledOnValidThread()); | 67 DCHECK(thread_checker_->CalledOnValidThread()); |
67 if (!compositor_frame_sink_) | 68 if (!compositor_frame_sink_) |
68 return; | 69 return; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 WindowCompositorFrameSinkBinding::TakeFrameSinkRequest() { | 137 WindowCompositorFrameSinkBinding::TakeFrameSinkRequest() { |
137 return std::move(compositor_frame_sink_request_); | 138 return std::move(compositor_frame_sink_request_); |
138 } | 139 } |
139 | 140 |
140 cc::mojom::MojoCompositorFrameSinkClientPtrInfo | 141 cc::mojom::MojoCompositorFrameSinkClientPtrInfo |
141 WindowCompositorFrameSinkBinding::TakeFrameSinkClient() { | 142 WindowCompositorFrameSinkBinding::TakeFrameSinkClient() { |
142 return std::move(compositor_frame_sink_client_); | 143 return std::move(compositor_frame_sink_client_); |
143 } | 144 } |
144 | 145 |
145 } // namespace ui | 146 } // namespace ui |
OLD | NEW |