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

Unified Diff: benchmarks/spinning-balls/v.js

Issue 8228004: Remove some unused and unneeded flags. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 2 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
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: benchmarks/spinning-balls/v.js
===================================================================
--- benchmarks/spinning-balls/v.js (revision 9575)
+++ benchmarks/spinning-balls/v.js (working copy)
@@ -42,6 +42,9 @@
} )();
}
+
+
+
var kNPoints = 8000;
var kNModifications = 20;
var kNVisiblePoints = 200;
@@ -54,11 +57,23 @@
var dyingPoints = void 0;
var scene = void 0;
var renderingStartTime = void 0;
+var omitFrameDueToVisibilityChange = false;
var scene = void 0;
var pausePlot = void 0;
var splayTree = void 0;
+handleVisibilityChange();
+function handleVisibilityChange() {
+ console.log("visibility change");
+ omitFrameDueToVisibilityChange = true;
+ document.addEventListener("webkitvisibilitychange", handleVisibilityChange);
+ document.addEventListener("msvisibilitychange", handleVisibilityChange);
+ document.addEventListener("mozvisibilitychange", handleVisibilityChange);
+ document.addEventListener("visibilitychange", handleVisibilityChange);
+}
+
+
function Point(x, y, z, payload) {
this.x = x;
this.y = y;
@@ -353,9 +368,12 @@
scene.draw();
var renderingEndTime = Date.now();
- var pause = renderingEndTime - renderingStartTime;
- pausePlot.addPause(pause);
+ if (!omitFrameDueToVisibilityChange) {
+ var pause = renderingEndTime - renderingStartTime;
+ pausePlot.addPause(pause);
+ }
renderingStartTime = renderingEndTime;
+ omitFrameDueToVisibilityChange = false;
pausePlot.draw();
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698