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

Side by Side Diff: cc/scheduler.cc

Issue 11879012: cc: Redraw incomplete frames when new texture uploads finish (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decouple_draw3b
Patch Set: Add trace events and isImplThread DCHECKS Created 7 years, 11 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
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.h" 5 #include "cc/scheduler.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 m_stateMachine.setNeedsForcedCommit(); 70 m_stateMachine.setNeedsForcedCommit();
71 processScheduledActions(); 71 processScheduledActions();
72 } 72 }
73 73
74 void Scheduler::setNeedsRedraw() 74 void Scheduler::setNeedsRedraw()
75 { 75 {
76 m_stateMachine.setNeedsRedraw(); 76 m_stateMachine.setNeedsRedraw();
77 processScheduledActions(); 77 processScheduledActions();
78 } 78 }
79 79
80 void Scheduler::setNeedsRedrawOnVisibleTextureUpload()
81 {
82 m_stateMachine.setNeedsRedrawOnVisibleTextureUpload();
83 processScheduledActions();
84 }
85
80 void Scheduler::setNeedsForcedRedraw() 86 void Scheduler::setNeedsForcedRedraw()
81 { 87 {
82 m_stateMachine.setNeedsForcedRedraw(); 88 m_stateMachine.setNeedsForcedRedraw();
83 processScheduledActions(); 89 processScheduledActions();
84 } 90 }
85 91
86 void Scheduler::setMainThreadNeedsLayerTextures() 92 void Scheduler::setMainThreadNeedsLayerTextures()
87 { 93 {
88 m_stateMachine.setMainThreadNeedsLayerTextures(); 94 m_stateMachine.setMainThreadNeedsLayerTextures();
89 processScheduledActions(); 95 processScheduledActions();
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 176
171 switch (action) { 177 switch (action) {
172 case SchedulerStateMachine::ACTION_NONE: 178 case SchedulerStateMachine::ACTION_NONE:
173 break; 179 break;
174 case SchedulerStateMachine::ACTION_BEGIN_FRAME: 180 case SchedulerStateMachine::ACTION_BEGIN_FRAME:
175 m_client->scheduledActionBeginFrame(); 181 m_client->scheduledActionBeginFrame();
176 break; 182 break;
177 case SchedulerStateMachine::ACTION_COMMIT: 183 case SchedulerStateMachine::ACTION_COMMIT:
178 m_client->scheduledActionCommit(); 184 m_client->scheduledActionCommit();
179 break; 185 break;
186 case SchedulerStateMachine::ACTION_CHECK_FOR_NEW_TEXTURES:
187 m_client->scheduledActionCheckForNewTextures();
188 break;
180 case SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED: 189 case SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED:
181 m_client->scheduledActionActivatePendingTreeIfNeeded(); 190 m_client->scheduledActionActivatePendingTreeIfNeeded();
182 break; 191 break;
183 case SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE: { 192 case SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE: {
184 ScheduledActionDrawAndSwapResult result = m_client->scheduledActionD rawAndSwapIfPossible(); 193 ScheduledActionDrawAndSwapResult result = m_client->scheduledActionD rawAndSwapIfPossible();
185 m_stateMachine.didDrawIfPossibleCompleted(result.didDraw); 194 m_stateMachine.didDrawIfPossibleCompleted(result.didDraw);
186 if (result.didSwap) 195 if (result.didSwap)
187 m_frameRateController->didBeginFrame(); 196 m_frameRateController->didBeginFrame();
188 break; 197 break;
189 } 198 }
(...skipping 11 matching lines...) Expand all
201 } 210 }
202 action = m_stateMachine.nextAction(); 211 action = m_stateMachine.nextAction();
203 } 212 }
204 213
205 // Activate or deactivate the frame rate controller. 214 // Activate or deactivate the frame rate controller.
206 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); 215 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded());
207 m_client->didAnticipatedDrawTimeChange(m_frameRateController->nextTickTime() ); 216 m_client->didAnticipatedDrawTimeChange(m_frameRateController->nextTickTime() );
208 } 217 }
209 218
210 } // namespace cc 219 } // namespace cc
OLDNEW
« cc/layer_tree_host_impl.cc ('K') | « cc/scheduler.h ('k') | cc/scheduler_state_machine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698