Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: cc/scheduler/scheduler_state_machine.cc

Issue 1050833002: cc: Remove background ticking from LTHI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another attempt at rebasing. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/scheduler/scheduler_state_machine.h" 5 #include "cc/scheduler/scheduler_state_machine.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 children_need_begin_frames_ = children_need_begin_frames; 733 children_need_begin_frames_ = children_need_begin_frames;
734 } 734 }
735 735
736 void SchedulerStateMachine::SetDeferCommits(bool defer_commits) { 736 void SchedulerStateMachine::SetDeferCommits(bool defer_commits) {
737 defer_commits_ = defer_commits; 737 defer_commits_ = defer_commits;
738 } 738 }
739 739
740 // These are the cases where we definitely (or almost definitely) have a 740 // These are the cases where we definitely (or almost definitely) have a
741 // new frame to animate and/or draw and can draw. 741 // new frame to animate and/or draw and can draw.
742 bool SchedulerStateMachine::BeginFrameNeededToAnimateOrDraw() const { 742 bool SchedulerStateMachine::BeginFrameNeededToAnimateOrDraw() const {
743 // If we are not visible, we don't need BeginFrame messages.
744 if (!visible_)
745 return false;
sunnyps 2015/04/07 22:55:04 Better move this to the BeginFrameNeeded method no
brianderson 2015/04/08 01:21:59 +1 to moving the visibility checks to BeginFrameNe
mithro-old 2015/04/08 23:40:50 Done.
746
743 // The forced draw respects our normal draw scheduling, so we need to 747 // The forced draw respects our normal draw scheduling, so we need to
744 // request a BeginImplFrame for it. 748 // request a BeginImplFrame for it.
745 if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW) 749 if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW)
746 return true; 750 return true;
747 751
748 // TODO(mithro): Remove background animation ticking. crbug.com/371747 752 return needs_animate_ || needs_redraw_;
749 if (needs_animate_)
750 return true;
751
752 // Only background tick for animations - not draws, which will never happen.
753 if (!visible_)
754 return false;
755
756 return needs_redraw_;
757 } 753 }
758 754
759 // These are cases where we are very likely to draw soon, but might not 755 // These are cases where we are very likely to draw soon, but might not
760 // actually have a new frame to draw when we receive the next BeginImplFrame. 756 // actually have a new frame to draw when we receive the next BeginImplFrame.
761 // Proactively requesting the BeginImplFrame helps hide the round trip latency 757 // Proactively requesting the BeginImplFrame helps hide the round trip latency
762 // of the SetNeedsBeginFrame request that has to go to the Browser. 758 // of the SetNeedsBeginFrame request that has to go to the Browser.
763 bool SchedulerStateMachine::ProactiveBeginFrameWanted() const { 759 bool SchedulerStateMachine::ProactiveBeginFrameWanted() const {
764 // Do not be proactive when invisible. 760 // Do not be proactive when invisible.
765 if (!visible_) 761 if (!visible_)
766 return false; 762 return false;
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 static_cast<int>(begin_impl_frame_state_), 1102 static_cast<int>(begin_impl_frame_state_),
1107 static_cast<int>(commit_state_), 1103 static_cast<int>(commit_state_),
1108 has_pending_tree_ ? 'T' : 'F', 1104 has_pending_tree_ ? 'T' : 'F',
1109 pending_tree_is_ready_for_activation_ ? 'T' : 'F', 1105 pending_tree_is_ready_for_activation_ ? 'T' : 'F',
1110 active_tree_needs_first_draw_ ? 'T' : 'F', 1106 active_tree_needs_first_draw_ ? 'T' : 'F',
1111 max_pending_swaps_, 1107 max_pending_swaps_,
1112 pending_swaps_); 1108 pending_swaps_);
1113 } 1109 }
1114 1110
1115 } // namespace cc 1111 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698