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

Unified Diff: tools/perf/page_sets/tough_canvas_cases/rendering_throughput/canvas_tough_cases_lib.js

Issue 2047773002: Added telemetry pages for the canvas element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some formatting Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
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);
+ }
+}
+

Powered by Google App Engine
This is Rietveld 408576698