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

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

Issue 27710005: cc: Use HighResNow as timebase if it is fast and reliable (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix DCHECK Created 7 years, 1 month 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/test/layer_tree_test.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/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "ui/gfx/frame_time.h"
12 13
13 namespace cc { 14 namespace cc {
14 15
15 SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings& settings) 16 SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings& settings)
16 : settings_(settings), 17 : settings_(settings),
17 output_surface_state_(OUTPUT_SURFACE_LOST), 18 output_surface_state_(OUTPUT_SURFACE_LOST),
18 begin_impl_frame_state_(BEGIN_IMPL_FRAME_STATE_IDLE), 19 begin_impl_frame_state_(BEGIN_IMPL_FRAME_STATE_IDLE),
19 commit_state_(COMMIT_STATE_IDLE), 20 commit_state_(COMMIT_STATE_IDLE),
20 texture_state_(LAYER_TEXTURE_STATE_UNLOCKED), 21 texture_state_(LAYER_TEXTURE_STATE_UNLOCKED),
21 forced_redraw_state_(FORCED_REDRAW_STATE_IDLE), 22 forced_redraw_state_(FORCED_REDRAW_STATE_IDLE),
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 major_state->SetString("output_surface_state_", 187 major_state->SetString("output_surface_state_",
187 OutputSurfaceStateToString(output_surface_state_)); 188 OutputSurfaceStateToString(output_surface_state_));
188 major_state->SetString( 189 major_state->SetString(
189 "forced_redraw_state", 190 "forced_redraw_state",
190 ForcedRedrawOnTimeoutStateToString(forced_redraw_state_)); 191 ForcedRedrawOnTimeoutStateToString(forced_redraw_state_));
191 major_state->SetString("readback_state", 192 major_state->SetString("readback_state",
192 SynchronousReadbackStateToString(readback_state_)); 193 SynchronousReadbackStateToString(readback_state_));
193 state->Set("major_state", major_state.release()); 194 state->Set("major_state", major_state.release());
194 195
195 scoped_ptr<base::DictionaryValue> timestamps_state(new base::DictionaryValue); 196 scoped_ptr<base::DictionaryValue> timestamps_state(new base::DictionaryValue);
196 base::TimeTicks now = base::TimeTicks::Now(); 197 base::TimeTicks now = gfx::FrameTime::Now();
197 timestamps_state->SetDouble( 198 timestamps_state->SetDouble(
198 "0_interval", 199 "0_interval",
199 last_begin_impl_frame_args_.interval.InMicroseconds() / 1000.0L); 200 last_begin_impl_frame_args_.interval.InMicroseconds() / 1000.0L);
200 timestamps_state->SetDouble( 201 timestamps_state->SetDouble(
201 "1_now_to_deadline", 202 "1_now_to_deadline",
202 (last_begin_impl_frame_args_.deadline - now).InMicroseconds() / 1000.0L); 203 (last_begin_impl_frame_args_.deadline - now).InMicroseconds() / 1000.0L);
203 timestamps_state->SetDouble( 204 timestamps_state->SetDouble(
204 "2_frame_time_to_now", 205 "2_frame_time_to_now",
205 (now - last_begin_impl_frame_args_.frame_time).InMicroseconds() / 206 (now - last_begin_impl_frame_args_.frame_time).InMicroseconds() /
206 1000.0L); 207 1000.0L);
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 case OUTPUT_SURFACE_ACTIVE: 1053 case OUTPUT_SURFACE_ACTIVE:
1053 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: 1054 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT:
1054 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: 1055 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION:
1055 return true; 1056 return true;
1056 } 1057 }
1057 NOTREACHED(); 1058 NOTREACHED();
1058 return false; 1059 return false;
1059 } 1060 }
1060 1061
1061 } // namespace cc 1062 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/test/layer_tree_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698