| Index: tools/perf/page_sets/tough_canvas_cases/rendering_throughput/canvas_tough_cases_lib.js
|
| diff --git a/tools/perf/page_sets/tough_canvas_cases/rendering_throughput/canvas_tough_cases_lib.js b/tools/perf/page_sets/tough_canvas_cases/rendering_throughput/canvas_tough_cases_lib.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..676eb1a250fa05e2b99d2edd9100eb006be15954
|
| --- /dev/null
|
| +++ b/tools/perf/page_sets/tough_canvas_cases/rendering_throughput/canvas_tough_cases_lib.js
|
| @@ -0,0 +1,38 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +function Point(x, y) {
|
| + this.x = x;
|
| + this.y = y;
|
| +}
|
| +
|
| +function get_random_color_string() {
|
| + var characters = "0123456789ABCDEF";
|
| + var color = "#";
|
| +
|
| + for (var i = 1; i < 7; i++) {
|
| + color += characters[Math.floor(Math.random() * characters.length)];
|
| + }
|
| +
|
| + return color;
|
| +}
|
| +
|
| +function rand_sgn(number) {
|
| + return Math.floor(Math.random() * 2) ? 1*number : -1*number;
|
| +}
|
| +
|
| +function swap(array, i, j) {
|
| + var temp = array[i];
|
| + array[i] = array[j];
|
| + array[j] = temp;
|
| +}
|
| +
|
| +function shuffle(l) {
|
| + for (var i = 0; i < l.length -1; i++) {
|
| + var num_left = l.length - i;
|
| + var to_swap = i + Math.floor(Math.random() * num_left);
|
| + swap(l, i, to_swap);
|
| + }
|
| +}
|
| +
|
|
|