OLD | NEW |
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 "blimp/client/core/compositor/blimp_compositor.h" | 5 #include "blimp/client/core/compositor/blimp_compositor.h" |
6 | 6 |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 content_layer->SetSurfaceId( | 236 content_layer->SetSurfaceId( |
237 cc::SurfaceId(surface_factory_->frame_sink_id(), local_frame_id_), 1.f, | 237 cc::SurfaceId(surface_factory_->frame_sink_id(), local_frame_id_), 1.f, |
238 surface_size); | 238 surface_size); |
239 content_layer->SetBounds(current_surface_size_); | 239 content_layer->SetBounds(current_surface_size_); |
240 content_layer->SetIsDrawable(true); | 240 content_layer->SetIsDrawable(true); |
241 content_layer->SetContentsOpaque(true); | 241 content_layer->SetContentsOpaque(true); |
242 | 242 |
243 layer_->AddChild(content_layer); | 243 layer_->AddChild(content_layer); |
244 } | 244 } |
245 | 245 |
246 surface_factory_->SubmitCompositorFrame(local_frame_id_, std::move(frame), | 246 surface_factory_->SubmitCompositorFrame( |
247 base::Closure()); | 247 local_frame_id_, std::move(frame), |
| 248 base::Bind(&BlimpCompositor::SubmitCompositorFrameAck, |
| 249 weak_ptr_factory_.GetWeakPtr())); |
| 250 } |
| 251 |
| 252 void BlimpCompositor::SubmitCompositorFrameAck() { |
| 253 DCHECK(surface_factory_); |
| 254 compositor_dependencies_->GetCompositorTaskRunner()->PostTask( |
| 255 FROM_HERE, |
| 256 base::Bind(&BlimpCompositorFrameSinkProxyClient::SwapCompositorFrameAck, |
| 257 proxy_client_)); |
248 } | 258 } |
249 | 259 |
250 void BlimpCompositor::UnbindProxyClient() { | 260 void BlimpCompositor::UnbindProxyClient() { |
251 DCHECK(thread_checker_.CalledOnValidThread()); | 261 DCHECK(thread_checker_.CalledOnValidThread()); |
252 DCHECK(surface_factory_); | 262 DCHECK(surface_factory_); |
253 | 263 |
254 DestroyDelegatedContent(); | 264 DestroyDelegatedContent(); |
255 surface_factory_.reset(); | 265 surface_factory_.reset(); |
256 proxy_client_ = nullptr; | 266 proxy_client_ = nullptr; |
257 } | 267 } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 it->second.Run(); | 359 it->second.Run(); |
350 it = pending_commit_trackers_.erase(it); | 360 it = pending_commit_trackers_.erase(it); |
351 } else { | 361 } else { |
352 ++it; | 362 ++it; |
353 } | 363 } |
354 } | 364 } |
355 } | 365 } |
356 | 366 |
357 } // namespace client | 367 } // namespace client |
358 } // namespace blimp | 368 } // namespace blimp |
OLD | NEW |