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

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: Add missing include Created 7 years, 2 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/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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 major_state->SetString("output_surface_state_", 186 major_state->SetString("output_surface_state_",
186 OutputSurfaceStateToString(output_surface_state_)); 187 OutputSurfaceStateToString(output_surface_state_));
187 major_state->SetString( 188 major_state->SetString(
188 "forced_redraw_state", 189 "forced_redraw_state",
189 ForcedRedrawOnTimeoutStateToString(forced_redraw_state_)); 190 ForcedRedrawOnTimeoutStateToString(forced_redraw_state_));
190 major_state->SetString("readback_state", 191 major_state->SetString("readback_state",
191 SynchronousReadbackStateToString(readback_state_)); 192 SynchronousReadbackStateToString(readback_state_));
192 state->Set("major_state", major_state.release()); 193 state->Set("major_state", major_state.release());
193 194
194 scoped_ptr<base::DictionaryValue> timestamps_state(new base::DictionaryValue); 195 scoped_ptr<base::DictionaryValue> timestamps_state(new base::DictionaryValue);
195 base::TimeTicks now = base::TimeTicks::Now(); 196 base::TimeTicks now = gfx::FrameTime::Now();
196 timestamps_state->SetDouble( 197 timestamps_state->SetDouble(
197 "0_interval", 198 "0_interval",
198 last_begin_impl_frame_args_.interval.InMicroseconds() / 1000.0L); 199 last_begin_impl_frame_args_.interval.InMicroseconds() / 1000.0L);
199 timestamps_state->SetDouble( 200 timestamps_state->SetDouble(
200 "1_now_to_deadline", 201 "1_now_to_deadline",
201 (last_begin_impl_frame_args_.deadline - now).InMicroseconds() / 1000.0L); 202 (last_begin_impl_frame_args_.deadline - now).InMicroseconds() / 1000.0L);
202 timestamps_state->SetDouble( 203 timestamps_state->SetDouble(
203 "2_frame_time_to_now", 204 "2_frame_time_to_now",
204 (now - last_begin_impl_frame_args_.frame_time).InMicroseconds() / 205 (now - last_begin_impl_frame_args_.frame_time).InMicroseconds() /
205 1000.0L); 206 1000.0L);
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 case OUTPUT_SURFACE_ACTIVE: 1037 case OUTPUT_SURFACE_ACTIVE:
1037 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: 1038 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT:
1038 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: 1039 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION:
1039 return true; 1040 return true;
1040 } 1041 }
1041 NOTREACHED(); 1042 NOTREACHED();
1042 return false; 1043 return false;
1043 } 1044 }
1044 1045
1045 } // namespace cc 1046 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698