| 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 FrameRateTest harness variant for benchmarking | 6 * @fileoverview FrameRateTest harness variant for benchmarking |
| 7 * pages that contain content that is animated (e.g. canvas2d, webGL) | 7 * pages that contain content that is animated (e.g. canvas2d, webGL) |
| 8 * | 8 * |
| 9 * How to instrument an animated web page for use with the frame rate test | 9 * How to instrument an animated web page for use with the frame rate test |
| 10 * harness: | 10 * harness: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 if (__warmup_frames > 0){ | 41 if (__warmup_frames > 0){ |
| 42 __warmup_frames--; | 42 __warmup_frames--; |
| 43 return; | 43 return; |
| 44 } | 44 } |
| 45 | 45 |
| 46 // Signal that page is ready to begin benchamarking | 46 // Signal that page is ready to begin benchamarking |
| 47 __initialized = true; | 47 __initialized = true; |
| 48 | 48 |
| 49 if (__running) { | 49 if (__running) { |
| 50 __advance_gesture(); | 50 __advance_gesture(); |
| 51 __update_fps(); | 51 __record_frame_time(); |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 function __requestAnimationFrame(callback, element) { | 55 function __requestAnimationFrame(callback, element) { |
| 56 __did_render_frame(); | 56 __did_render_frame(); |
| 57 __raf(callback, element); | 57 __raf(callback, element); |
| 58 } | 58 } |
| 59 | 59 |
| 60 function __requestAnimationFrame_no_sampling(callback, element) { | 60 function __requestAnimationFrame_no_sampling(callback, element) { |
| 61 __raf(callback, element); | 61 __raf(callback, element); |
| 62 } | 62 } |
| 63 | 63 |
| 64 | 64 |
| OLD | NEW |