| 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 proxy_main_weak_ptr_)); | 427 proxy_main_weak_ptr_)); |
| 428 } | 428 } |
| 429 | 429 |
| 430 void ProxyImpl::OnDrawForCompositorFrameSink(bool resourceless_software_draw) { | 430 void ProxyImpl::OnDrawForCompositorFrameSink(bool resourceless_software_draw) { |
| 431 DCHECK(IsImplThread()); | 431 DCHECK(IsImplThread()); |
| 432 scheduler_->OnDrawForCompositorFrameSink(resourceless_software_draw); | 432 scheduler_->OnDrawForCompositorFrameSink(resourceless_software_draw); |
| 433 } | 433 } |
| 434 | 434 |
| 435 void ProxyImpl::NeedsImplSideInvalidation() { | 435 void ProxyImpl::NeedsImplSideInvalidation() { |
| 436 DCHECK(IsImplThread()); | 436 DCHECK(IsImplThread()); |
| 437 // TODO(khushalsagar): Plumb this to the scheduler when | 437 scheduler_->SetNeedsImplSideInvalidation(); |
| 438 // https://codereview.chromium.org/2659123004/ lands. See crbug.com/686267. | |
| 439 NOTIMPLEMENTED(); | |
| 440 } | 438 } |
| 441 | 439 |
| 442 void ProxyImpl::WillBeginImplFrame(const BeginFrameArgs& args) { | 440 void ProxyImpl::WillBeginImplFrame(const BeginFrameArgs& args) { |
| 443 DCHECK(IsImplThread()); | 441 DCHECK(IsImplThread()); |
| 444 layer_tree_host_impl_->WillBeginImplFrame(args); | 442 layer_tree_host_impl_->WillBeginImplFrame(args); |
| 445 } | 443 } |
| 446 | 444 |
| 447 void ProxyImpl::DidFinishImplFrame() { | 445 void ProxyImpl::DidFinishImplFrame() { |
| 448 DCHECK(IsImplThread()); | 446 DCHECK(IsImplThread()); |
| 449 layer_tree_host_impl_->DidFinishImplFrame(); | 447 layer_tree_host_impl_->DidFinishImplFrame(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 460 begin_main_frame_state->begin_frame_args = args; | 458 begin_main_frame_state->begin_frame_args = args; |
| 461 begin_main_frame_state->begin_frame_callbacks = | 459 begin_main_frame_state->begin_frame_callbacks = |
| 462 layer_tree_host_impl_->ProcessLayerTreeMutations(); | 460 layer_tree_host_impl_->ProcessLayerTreeMutations(); |
| 463 begin_main_frame_state->scroll_info = | 461 begin_main_frame_state->scroll_info = |
| 464 layer_tree_host_impl_->ProcessScrollDeltas(); | 462 layer_tree_host_impl_->ProcessScrollDeltas(); |
| 465 begin_main_frame_state->evicted_ui_resources = | 463 begin_main_frame_state->evicted_ui_resources = |
| 466 layer_tree_host_impl_->EvictedUIResourcesExist(); | 464 layer_tree_host_impl_->EvictedUIResourcesExist(); |
| 467 MainThreadTaskRunner()->PostTask( | 465 MainThreadTaskRunner()->PostTask( |
| 468 FROM_HERE, base::Bind(&ProxyMain::BeginMainFrame, proxy_main_weak_ptr_, | 466 FROM_HERE, base::Bind(&ProxyMain::BeginMainFrame, proxy_main_weak_ptr_, |
| 469 base::Passed(&begin_main_frame_state))); | 467 base::Passed(&begin_main_frame_state))); |
| 468 layer_tree_host_impl_->DidSendBeginMainFrame(); |
| 470 devtools_instrumentation::DidRequestMainThreadFrame(layer_tree_host_id_); | 469 devtools_instrumentation::DidRequestMainThreadFrame(layer_tree_host_id_); |
| 471 } | 470 } |
| 472 | 471 |
| 473 DrawResult ProxyImpl::ScheduledActionDrawIfPossible() { | 472 DrawResult ProxyImpl::ScheduledActionDrawIfPossible() { |
| 474 TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionDraw"); | 473 TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionDraw"); |
| 475 DCHECK(IsImplThread()); | 474 DCHECK(IsImplThread()); |
| 476 | 475 |
| 477 // The scheduler should never generate this call when it can't draw. | 476 // The scheduler should never generate this call when it can't draw. |
| 478 DCHECK(layer_tree_host_impl_->CanDraw()); | 477 DCHECK(layer_tree_host_impl_->CanDraw()); |
| 479 | 478 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 } | 548 } |
| 550 | 549 |
| 551 void ProxyImpl::ScheduledActionInvalidateCompositorFrameSink() { | 550 void ProxyImpl::ScheduledActionInvalidateCompositorFrameSink() { |
| 552 TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionInvalidateCompositorFrameSink"); | 551 TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionInvalidateCompositorFrameSink"); |
| 553 DCHECK(IsImplThread()); | 552 DCHECK(IsImplThread()); |
| 554 DCHECK(layer_tree_host_impl_->compositor_frame_sink()); | 553 DCHECK(layer_tree_host_impl_->compositor_frame_sink()); |
| 555 layer_tree_host_impl_->compositor_frame_sink()->Invalidate(); | 554 layer_tree_host_impl_->compositor_frame_sink()->Invalidate(); |
| 556 } | 555 } |
| 557 | 556 |
| 558 void ProxyImpl::ScheduledActionPerformImplSideInvalidation() { | 557 void ProxyImpl::ScheduledActionPerformImplSideInvalidation() { |
| 559 NOTIMPLEMENTED(); | 558 TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionPerformImplSideInvalidation"); |
| 559 DCHECK(IsImplThread()); |
| 560 layer_tree_host_impl_->InvalidateContentOnImplSide(); |
| 560 } | 561 } |
| 561 | 562 |
| 562 void ProxyImpl::SendBeginMainFrameNotExpectedSoon() { | 563 void ProxyImpl::SendBeginMainFrameNotExpectedSoon() { |
| 563 DCHECK(IsImplThread()); | 564 DCHECK(IsImplThread()); |
| 564 MainThreadTaskRunner()->PostTask( | 565 MainThreadTaskRunner()->PostTask( |
| 565 FROM_HERE, base::Bind(&ProxyMain::BeginMainFrameNotExpectedSoon, | 566 FROM_HERE, base::Bind(&ProxyMain::BeginMainFrameNotExpectedSoon, |
| 566 proxy_main_weak_ptr_)); | 567 proxy_main_weak_ptr_)); |
| 567 } | 568 } |
| 568 | 569 |
| 569 DrawResult ProxyImpl::DrawInternal(bool forced_draw) { | 570 DrawResult ProxyImpl::DrawInternal(bool forced_draw) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { | 640 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { |
| 640 DCHECK(IsMainThreadBlocked() && commit_completion_event_); | 641 DCHECK(IsMainThreadBlocked() && commit_completion_event_); |
| 641 return main_thread_blocked_commit_vars_unsafe_; | 642 return main_thread_blocked_commit_vars_unsafe_; |
| 642 } | 643 } |
| 643 | 644 |
| 644 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() { | 645 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() { |
| 645 return task_runner_provider_->MainThreadTaskRunner(); | 646 return task_runner_provider_->MainThreadTaskRunner(); |
| 646 } | 647 } |
| 647 | 648 |
| 648 } // namespace cc | 649 } // namespace cc |
| OLD | NEW |