| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 void ProxyImpl::SetBeginFrameSource(BeginFrameSource* source) { | 269 void ProxyImpl::SetBeginFrameSource(BeginFrameSource* source) { |
| 270 // During shutdown, destroying the CompositorFrameSink may unset the | 270 // During shutdown, destroying the CompositorFrameSink may unset the |
| 271 // BeginFrameSource. | 271 // BeginFrameSource. |
| 272 if (scheduler_) { | 272 if (scheduler_) { |
| 273 // TODO(enne): this overrides any preexisting begin frame source. Those | 273 // TODO(enne): this overrides any preexisting begin frame source. Those |
| 274 // other sources will eventually be removed and this will be the only path. | 274 // other sources will eventually be removed and this will be the only path. |
| 275 scheduler_->SetBeginFrameSource(source); | 275 scheduler_->SetBeginFrameSource(source); |
| 276 } | 276 } |
| 277 } | 277 } |
| 278 | 278 |
| 279 void ProxyImpl::SetEstimatedParentDrawTime(base::TimeDelta draw_time) { | |
| 280 DCHECK(IsImplThread()); | |
| 281 scheduler_->SetEstimatedParentDrawTime(draw_time); | |
| 282 } | |
| 283 | |
| 284 void ProxyImpl::DidSwapBuffersCompleteOnImplThread() { | 279 void ProxyImpl::DidSwapBuffersCompleteOnImplThread() { |
| 285 TRACE_EVENT0("cc,benchmark", "ProxyImpl::DidSwapBuffersCompleteOnImplThread"); | 280 TRACE_EVENT0("cc,benchmark", "ProxyImpl::DidSwapBuffersCompleteOnImplThread"); |
| 286 DCHECK(IsImplThread()); | 281 DCHECK(IsImplThread()); |
| 287 scheduler_->DidSwapBuffersComplete(); | 282 scheduler_->DidSwapBuffersComplete(); |
| 288 channel_impl_->DidCompleteSwapBuffers(); | 283 channel_impl_->DidCompleteSwapBuffers(); |
| 289 } | 284 } |
| 290 | 285 |
| 291 void ProxyImpl::OnCanDrawStateChanged(bool can_draw) { | 286 void ProxyImpl::OnCanDrawStateChanged(bool can_draw) { |
| 292 TRACE_EVENT1("cc", "ProxyImpl::OnCanDrawStateChanged", "can_draw", can_draw); | 287 TRACE_EVENT1("cc", "ProxyImpl::OnCanDrawStateChanged", "can_draw", can_draw); |
| 293 DCHECK(IsImplThread()); | 288 DCHECK(IsImplThread()); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 bool ProxyImpl::IsMainThreadBlocked() const { | 612 bool ProxyImpl::IsMainThreadBlocked() const { |
| 618 return task_runner_provider_->IsMainThreadBlocked(); | 613 return task_runner_provider_->IsMainThreadBlocked(); |
| 619 } | 614 } |
| 620 | 615 |
| 621 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { | 616 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { |
| 622 DCHECK(IsMainThreadBlocked() && commit_completion_event_); | 617 DCHECK(IsMainThreadBlocked() && commit_completion_event_); |
| 623 return main_thread_blocked_commit_vars_unsafe_; | 618 return main_thread_blocked_commit_vars_unsafe_; |
| 624 } | 619 } |
| 625 | 620 |
| 626 } // namespace cc | 621 } // namespace cc |
| OLD | NEW |