OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "ui/aura/local/compositor_frame_sink_local.h" | 5 #include "ui/aura/local/compositor_frame_sink_local.h" |
6 | 6 |
7 #include "cc/output/compositor_frame_sink_client.h" | 7 #include "cc/output/compositor_frame_sink_client.h" |
8 #include "cc/surfaces/compositor_frame_sink_support.h" | 8 #include "cc/surfaces/compositor_frame_sink_support.h" |
9 #include "ui/aura/client/cursor_client.h" | 9 #include "ui/aura/client/cursor_client.h" |
10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 const SurfaceChangedCallback& callback) { | 44 const SurfaceChangedCallback& callback) { |
45 DCHECK(!surface_changed_callback_); | 45 DCHECK(!surface_changed_callback_); |
46 surface_changed_callback_ = callback; | 46 surface_changed_callback_ = callback; |
47 } | 47 } |
48 | 48 |
49 void CompositorFrameSinkLocal::DetachFromClient() { | 49 void CompositorFrameSinkLocal::DetachFromClient() { |
50 DCHECK(thread_checker_); | 50 DCHECK(thread_checker_); |
51 DCHECK(thread_checker_->CalledOnValidThread()); | 51 DCHECK(thread_checker_->CalledOnValidThread()); |
52 client_->SetBeginFrameSource(nullptr); | 52 client_->SetBeginFrameSource(nullptr); |
53 begin_frame_source_.reset(); | 53 begin_frame_source_.reset(); |
54 support_->EvictFrame(); | 54 support_->EvictCurrentSurface(); |
55 support_.reset(); | 55 support_.reset(); |
56 thread_checker_.reset(); | 56 thread_checker_.reset(); |
57 cc::CompositorFrameSink::DetachFromClient(); | 57 cc::CompositorFrameSink::DetachFromClient(); |
58 } | 58 } |
59 | 59 |
60 void CompositorFrameSinkLocal::SubmitCompositorFrame( | 60 void CompositorFrameSinkLocal::SubmitCompositorFrame( |
61 cc::CompositorFrame frame) { | 61 cc::CompositorFrame frame) { |
62 DCHECK(thread_checker_); | 62 DCHECK(thread_checker_); |
63 DCHECK(thread_checker_->CalledOnValidThread()); | 63 DCHECK(thread_checker_->CalledOnValidThread()); |
64 | 64 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 void CompositorFrameSinkLocal::OnDidFinishFrame(const cc::BeginFrameAck& ack) { | 115 void CompositorFrameSinkLocal::OnDidFinishFrame(const cc::BeginFrameAck& ack) { |
116 DCHECK(thread_checker_); | 116 DCHECK(thread_checker_); |
117 DCHECK(thread_checker_->CalledOnValidThread()); | 117 DCHECK(thread_checker_->CalledOnValidThread()); |
118 // If there was damage, the submitted CompositorFrame includes the ack. | 118 // If there was damage, the submitted CompositorFrame includes the ack. |
119 if (!ack.has_damage) | 119 if (!ack.has_damage) |
120 support_->BeginFrameDidNotSwap(ack); | 120 support_->BeginFrameDidNotSwap(ack); |
121 } | 121 } |
122 | 122 |
123 } // namespace aura | 123 } // namespace aura |
OLD | NEW |