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 "services/ui/ws/display_client_compositor_frame_sink.h" | 5 #include "services/ui/ws/display_client_compositor_frame_sink.h" |
6 | 6 |
7 #include "base/threading/thread_checker.h" | 7 #include "base/threading/thread_checker.h" |
8 #include "cc/output/compositor_frame_sink_client.h" | 8 #include "cc/output/compositor_frame_sink_client.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 void DisplayClientCompositorFrameSink::ReclaimResources( | 83 void DisplayClientCompositorFrameSink::ReclaimResources( |
84 const cc::ReturnedResourceArray& resources) { | 84 const cc::ReturnedResourceArray& resources) { |
85 DCHECK(thread_checker_->CalledOnValidThread()); | 85 DCHECK(thread_checker_->CalledOnValidThread()); |
86 if (!client_) | 86 if (!client_) |
87 return; | 87 return; |
88 client_->ReclaimResources(resources); | 88 client_->ReclaimResources(resources); |
89 } | 89 } |
90 | 90 |
91 void DisplayClientCompositorFrameSink::WillDrawSurface( | |
92 const cc::LocalSurfaceId& local_surface_id, | |
93 const gfx::Rect& damage_rect) { | |
94 // TODO(fsamuel, staraz): Implement this. | |
95 } | |
96 | |
97 void DisplayClientCompositorFrameSink::OnNeedsBeginFrames( | 91 void DisplayClientCompositorFrameSink::OnNeedsBeginFrames( |
98 bool needs_begin_frames) { | 92 bool needs_begin_frames) { |
99 DCHECK(thread_checker_->CalledOnValidThread()); | 93 DCHECK(thread_checker_->CalledOnValidThread()); |
100 compositor_frame_sink_->SetNeedsBeginFrame(needs_begin_frames); | 94 compositor_frame_sink_->SetNeedsBeginFrame(needs_begin_frames); |
101 } | 95 } |
102 | 96 |
103 void DisplayClientCompositorFrameSink::OnDidFinishFrame( | 97 void DisplayClientCompositorFrameSink::OnDidFinishFrame( |
104 const cc::BeginFrameAck& ack) { | 98 const cc::BeginFrameAck& ack) { |
105 // If there was damage, the submitted CompositorFrame includes the ack. | 99 // If there was damage, the submitted CompositorFrame includes the ack. |
106 if (!ack.has_damage) | 100 if (!ack.has_damage) |
107 compositor_frame_sink_->BeginFrameDidNotSwap(ack); | 101 compositor_frame_sink_->BeginFrameDidNotSwap(ack); |
108 } | 102 } |
109 | 103 |
110 } // namespace ws | 104 } // namespace ws |
111 } // namespace ui | 105 } // namespace ui |
OLD | NEW |