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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 layer_tree_host_impl_->InvalidateContentOnImplSide(); | 562 layer_tree_host_impl_->InvalidateContentOnImplSide(); |
563 } | 563 } |
564 | 564 |
565 void ProxyImpl::SendBeginMainFrameNotExpectedSoon() { | 565 void ProxyImpl::SendBeginMainFrameNotExpectedSoon() { |
566 DCHECK(IsImplThread()); | 566 DCHECK(IsImplThread()); |
567 MainThreadTaskRunner()->PostTask( | 567 MainThreadTaskRunner()->PostTask( |
568 FROM_HERE, base::Bind(&ProxyMain::BeginMainFrameNotExpectedSoon, | 568 FROM_HERE, base::Bind(&ProxyMain::BeginMainFrameNotExpectedSoon, |
569 proxy_main_weak_ptr_)); | 569 proxy_main_weak_ptr_)); |
570 } | 570 } |
571 | 571 |
| 572 int ProxyImpl::SyncTreeSourceFrameNumber() { |
| 573 if (layer_tree_host_impl_->pending_tree()) |
| 574 return layer_tree_host_impl_->pending_tree()->source_frame_number(); |
| 575 else |
| 576 return 0; |
| 577 } |
| 578 |
572 DrawResult ProxyImpl::DrawInternal(bool forced_draw) { | 579 DrawResult ProxyImpl::DrawInternal(bool forced_draw) { |
573 TRACE_EVENT_SYNTHETIC_DELAY("cc.Draw"); | 580 TRACE_EVENT_SYNTHETIC_DELAY("cc.Draw"); |
574 | 581 |
575 DCHECK(IsImplThread()); | 582 DCHECK(IsImplThread()); |
576 DCHECK(layer_tree_host_impl_.get()); | 583 DCHECK(layer_tree_host_impl_.get()); |
577 | 584 |
578 base::AutoReset<bool> mark_inside(&inside_draw_, true); | 585 base::AutoReset<bool> mark_inside(&inside_draw_, true); |
579 | 586 |
580 if (layer_tree_host_impl_->pending_tree()) { | 587 if (layer_tree_host_impl_->pending_tree()) { |
581 bool update_lcd_text = false; | 588 bool update_lcd_text = false; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { | 650 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { |
644 DCHECK(IsMainThreadBlocked() && commit_completion_event_); | 651 DCHECK(IsMainThreadBlocked() && commit_completion_event_); |
645 return main_thread_blocked_commit_vars_unsafe_; | 652 return main_thread_blocked_commit_vars_unsafe_; |
646 } | 653 } |
647 | 654 |
648 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() { | 655 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() { |
649 return task_runner_provider_->MainThreadTaskRunner(); | 656 return task_runner_provider_->MainThreadTaskRunner(); |
650 } | 657 } |
651 | 658 |
652 } // namespace cc | 659 } // namespace cc |
OLD | NEW |