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

Side by Side Diff: services/ui/surfaces/gpu_compositor_frame_sink.cc

Issue 2544103002: Added MojoCompositorFrameSink::EvictFrame() and MojoCompositorFrameSinkClient::WillDrawSurface() (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « services/ui/surfaces/gpu_compositor_frame_sink.h ('k') | services/ui/ws/frame_generator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/surfaces/gpu_compositor_frame_sink.h" 5 #include "services/ui/surfaces/gpu_compositor_frame_sink.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 surface_factory_.SubmitCompositorFrame( 90 surface_factory_.SubmitCompositorFrame(
91 local_frame_id_, std::move(frame), 91 local_frame_id_, std::move(frame),
92 base::Bind(&GpuCompositorFrameSink::DidReceiveCompositorFrameAck, 92 base::Bind(&GpuCompositorFrameSink::DidReceiveCompositorFrameAck,
93 weak_factory_.GetWeakPtr())); 93 weak_factory_.GetWeakPtr()));
94 if (display_) { 94 if (display_) {
95 display_->SetLocalFrameId(local_frame_id_, 95 display_->SetLocalFrameId(local_frame_id_,
96 frame.metadata.device_scale_factor); 96 frame.metadata.device_scale_factor);
97 } 97 }
98 } 98 }
99 99
100 void GpuCompositorFrameSink::EvictFrame() {
101 // TODO(fsamuel, staraz): Implement this.
102 NOTIMPLEMENTED();
Fady Samuel 2016/12/01 21:55:41 Implement it here? surface_factory_.EvictSurface()
Alex Z. 2016/12/01 21:59:15 Done.
103 }
104
100 void GpuCompositorFrameSink::DidReceiveCompositorFrameAck() { 105 void GpuCompositorFrameSink::DidReceiveCompositorFrameAck() {
101 if (!client_) 106 if (!client_)
102 return; 107 return;
103 client_->DidReceiveCompositorFrameAck(); 108 client_->DidReceiveCompositorFrameAck();
104 DCHECK_GT(ack_pending_count_, 0); 109 DCHECK_GT(ack_pending_count_, 0);
105 if (!surface_returned_resources_.empty()) { 110 if (!surface_returned_resources_.empty()) {
106 client_->ReclaimResources(surface_returned_resources_); 111 client_->ReclaimResources(surface_returned_resources_);
107 surface_returned_resources_.clear(); 112 surface_returned_resources_.clear();
108 } 113 }
109 ack_pending_count_--; 114 ack_pending_count_--;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 241 }
237 242
238 void GpuCompositorFrameSink::OnPrivateConnectionLost() { 243 void GpuCompositorFrameSink::OnPrivateConnectionLost() {
239 private_connection_lost_ = true; 244 private_connection_lost_ = true;
240 // Request destruction of |this| only if both connections are lost. 245 // Request destruction of |this| only if both connections are lost.
241 display_compositor_->OnCompositorFrameSinkPrivateConnectionLost( 246 display_compositor_->OnCompositorFrameSinkPrivateConnectionLost(
242 frame_sink_id_, client_connection_lost_); 247 frame_sink_id_, client_connection_lost_);
243 } 248 }
244 249
245 } // namespace ui 250 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/surfaces/gpu_compositor_frame_sink.h ('k') | services/ui/ws/frame_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698