| OLD | NEW |
| 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" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 major_state->SetString("output_surface_state_", | 187 major_state->SetString("output_surface_state_", |
| 188 OutputSurfaceStateToString(output_surface_state_)); | 188 OutputSurfaceStateToString(output_surface_state_)); |
| 189 major_state->SetString( | 189 major_state->SetString( |
| 190 "forced_redraw_state", | 190 "forced_redraw_state", |
| 191 ForcedRedrawOnTimeoutStateToString(forced_redraw_state_)); | 191 ForcedRedrawOnTimeoutStateToString(forced_redraw_state_)); |
| 192 major_state->SetString("readback_state", | 192 major_state->SetString("readback_state", |
| 193 SynchronousReadbackStateToString(readback_state_)); | 193 SynchronousReadbackStateToString(readback_state_)); |
| 194 state->Set("major_state", major_state.release()); | 194 state->Set("major_state", major_state.release()); |
| 195 | 195 |
| 196 scoped_ptr<base::DictionaryValue> timestamps_state(new base::DictionaryValue); | 196 scoped_ptr<base::DictionaryValue> timestamps_state(new base::DictionaryValue); |
| 197 base::TimeTicks now = gfx::FrameTime::Now(); | 197 gfx::FrameTime now = gfx::FrameTime::Now(); |
| 198 timestamps_state->SetDouble( | 198 timestamps_state->SetDouble( |
| 199 "0_interval", | 199 "0_interval", last_begin_impl_frame_args_.interval.InMillisecondsF()); |
| 200 last_begin_impl_frame_args_.interval.InMicroseconds() / 1000.0L); | |
| 201 timestamps_state->SetDouble( | 200 timestamps_state->SetDouble( |
| 202 "1_now_to_deadline", | 201 "1_now_to_deadline", |
| 203 (last_begin_impl_frame_args_.deadline - now).InMicroseconds() / 1000.0L); | 202 (last_begin_impl_frame_args_.deadline - now).InMillisecondsF()); |
| 204 timestamps_state->SetDouble( | 203 timestamps_state->SetDouble( |
| 205 "2_frame_time_to_now", | 204 "2_frame_time_to_now", |
| 206 (now - last_begin_impl_frame_args_.frame_time).InMicroseconds() / | 205 (now - last_begin_impl_frame_args_.frame_time).InMillisecondsF()); |
| 207 1000.0L); | |
| 208 timestamps_state->SetDouble( | 206 timestamps_state->SetDouble( |
| 209 "3_frame_time_to_deadline", | 207 "3_frame_time_to_deadline", |
| 210 (last_begin_impl_frame_args_.deadline - | 208 (last_begin_impl_frame_args_.deadline - |
| 211 last_begin_impl_frame_args_.frame_time).InMicroseconds() / | 209 last_begin_impl_frame_args_.frame_time).InMillisecondsF()); |
| 212 1000.0L); | 210 timestamps_state->SetDouble("4_now", now.Unsafe_InMillisecondsF()); |
| 213 timestamps_state->SetDouble( | |
| 214 "4_now", (now - base::TimeTicks()).InMicroseconds() / 1000.0L); | |
| 215 timestamps_state->SetDouble( | 211 timestamps_state->SetDouble( |
| 216 "5_frame_time", | 212 "5_frame_time", |
| 217 (last_begin_impl_frame_args_.frame_time - base::TimeTicks()) | 213 last_begin_impl_frame_args_.frame_time.Unsafe_InMillisecondsF()); |
| 218 .InMicroseconds() / | |
| 219 1000.0L); | |
| 220 timestamps_state->SetDouble( | 214 timestamps_state->SetDouble( |
| 221 "6_deadline", | 215 "6_deadline", |
| 222 (last_begin_impl_frame_args_.deadline - base::TimeTicks()) | 216 last_begin_impl_frame_args_.deadline.Unsafe_InMillisecondsF()); |
| 223 .InMicroseconds() / | |
| 224 1000.0L); | |
| 225 state->Set("major_timestamps_in_ms", timestamps_state.release()); | 217 state->Set("major_timestamps_in_ms", timestamps_state.release()); |
| 226 | 218 |
| 227 scoped_ptr<base::DictionaryValue> minor_state(new base::DictionaryValue); | 219 scoped_ptr<base::DictionaryValue> minor_state(new base::DictionaryValue); |
| 228 minor_state->SetInteger("commit_count", commit_count_); | 220 minor_state->SetInteger("commit_count", commit_count_); |
| 229 minor_state->SetInteger("current_frame_number", current_frame_number_); | 221 minor_state->SetInteger("current_frame_number", current_frame_number_); |
| 230 | 222 |
| 231 minor_state->SetInteger("last_frame_number_swap_performed", | 223 minor_state->SetInteger("last_frame_number_swap_performed", |
| 232 last_frame_number_swap_performed_); | 224 last_frame_number_swap_performed_); |
| 233 minor_state->SetInteger( | 225 minor_state->SetInteger( |
| 234 "last_frame_number_begin_main_frame_sent", | 226 "last_frame_number_begin_main_frame_sent", |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 case OUTPUT_SURFACE_ACTIVE: | 1045 case OUTPUT_SURFACE_ACTIVE: |
| 1054 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1046 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
| 1055 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1047 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
| 1056 return true; | 1048 return true; |
| 1057 } | 1049 } |
| 1058 NOTREACHED(); | 1050 NOTREACHED(); |
| 1059 return false; | 1051 return false; |
| 1060 } | 1052 } |
| 1061 | 1053 |
| 1062 } // namespace cc | 1054 } // namespace cc |
| OLD | NEW |