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 "cc/trees/proxy_impl.h" | 5 #include "cc/trees/proxy_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 if (!synthetic_begin_frame_source_) | 294 if (!synthetic_begin_frame_source_) |
295 return; | 295 return; |
296 | 296 |
297 if (interval == base::TimeDelta()) { | 297 if (interval == base::TimeDelta()) { |
298 // TODO(brianderson): We should not be receiving 0 intervals. | 298 // TODO(brianderson): We should not be receiving 0 intervals. |
299 interval = BeginFrameArgs::DefaultInterval(); | 299 interval = BeginFrameArgs::DefaultInterval(); |
300 } | 300 } |
301 synthetic_begin_frame_source_->OnUpdateVSyncParameters(timebase, interval); | 301 synthetic_begin_frame_source_->OnUpdateVSyncParameters(timebase, interval); |
302 } | 302 } |
303 | 303 |
| 304 void ProxyImpl::SetBeginFrameSource(BeginFrameSource* source) { |
| 305 // TODO(enne): this overrides any preexisting begin frame source. Those |
| 306 // other sources will eventually be removed and this will be the only path. |
| 307 scheduler_->SetBeginFrameSource(source); |
| 308 } |
| 309 |
304 void ProxyImpl::SetEstimatedParentDrawTime(base::TimeDelta draw_time) { | 310 void ProxyImpl::SetEstimatedParentDrawTime(base::TimeDelta draw_time) { |
305 DCHECK(IsImplThread()); | 311 DCHECK(IsImplThread()); |
306 scheduler_->SetEstimatedParentDrawTime(draw_time); | 312 scheduler_->SetEstimatedParentDrawTime(draw_time); |
307 } | 313 } |
308 | 314 |
309 void ProxyImpl::DidSwapBuffersOnImplThread() { | 315 void ProxyImpl::DidSwapBuffersOnImplThread() { |
310 DCHECK(IsImplThread()); | 316 DCHECK(IsImplThread()); |
311 scheduler_->DidSwapBuffers(); | 317 scheduler_->DidSwapBuffers(); |
312 } | 318 } |
313 | 319 |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 bool ProxyImpl::IsMainThreadBlocked() const { | 686 bool ProxyImpl::IsMainThreadBlocked() const { |
681 return task_runner_provider_->IsMainThreadBlocked(); | 687 return task_runner_provider_->IsMainThreadBlocked(); |
682 } | 688 } |
683 | 689 |
684 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { | 690 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { |
685 DCHECK(IsMainThreadBlocked() && commit_completion_event_); | 691 DCHECK(IsMainThreadBlocked() && commit_completion_event_); |
686 return main_thread_blocked_commit_vars_unsafe_; | 692 return main_thread_blocked_commit_vars_unsafe_; |
687 } | 693 } |
688 | 694 |
689 } // namespace cc | 695 } // namespace cc |
OLD | NEW |