OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 /** | 5 /** |
6 * @fileoverview Perform various "gestures" and calculate average frame rate. | 6 * @fileoverview Perform various "gestures" and calculate average frame rate. |
7 * "Gestures" are recorded scrolling behaviors in terms of time (ms) and | 7 * "Gestures" are recorded scrolling behaviors in terms of time (ms) and |
8 * absolute positions. | 8 * absolute positions. |
9 * | 9 * |
10 * How to run a single gesture: | 10 * How to run a single gesture: |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 __t_last = __get_time(); | 407 __t_last = __get_time(); |
408 } | 408 } |
409 }, document.body); | 409 }, document.body); |
410 } | 410 } |
411 | 411 |
412 function __start_recording() { | 412 function __start_recording() { |
413 __start(__advance_gesture_recording); | 413 __start(__advance_gesture_recording); |
414 } | 414 } |
415 | 415 |
416 function __make_body_composited() { | 416 function __make_body_composited() { |
417 document.body.style.webkitTransform = "translateZ(0)"; | 417 document.body.style.transform = "translateZ(0)"; |
418 } | 418 } |
419 | 419 |
420 function __start(gesture_function) { | 420 function __start(gesture_function) { |
421 if (__running) | 421 if (__running) |
422 return; | 422 return; |
423 // Attempt to create a gesture function from a string name. | 423 // Attempt to create a gesture function from a string name. |
424 if (typeof gesture_function == "string") { | 424 if (typeof gesture_function == "string") { |
425 if (!__gestures[gesture_function]) { | 425 if (!__gestures[gesture_function]) { |
426 if (!__gesture_library[gesture_function]) | 426 if (!__gesture_library[gesture_function]) |
427 throw new Error("Unrecognized gesture name"); | 427 throw new Error("Unrecognized gesture name"); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 | 484 |
485 function __reset() { | 485 function __reset() { |
486 __running = false; | 486 __running = false; |
487 __running_all = false; | 487 __running_all = false; |
488 document.title = __old_title; | 488 document.title = __old_title; |
489 document.body.scrollTop = 0; | 489 document.body.scrollTop = 0; |
490 __init_stats(); | 490 __init_stats(); |
491 } | 491 } |
492 | 492 |
493 function __force_compositor() { | 493 function __force_compositor() { |
494 document.body.style.webkitTransform = "translateZ(0)"; | 494 document.body.style.transform = "translateZ(0)"; |
495 } | 495 } |
OLD | NEW |