summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3djs
diff options
context:
space:
mode:
authorgman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 01:26:46 +0000
committergman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 01:26:46 +0000
commit3c2216cd87438196389b5076095a5f1d627b1ca2 (patch)
treecbe1a1d4746b21503dd9e7213a81201ac14e6320 /o3d/samples/o3djs
parentf0ef2da98a8bc281600d565ff7788f2bec129d9f (diff)
downloadchromium_src-3c2216cd87438196389b5076095a5f1d627b1ca2.zip
chromium_src-3c2216cd87438196389b5076095a5f1d627b1ca2.tar.gz
chromium_src-3c2216cd87438196389b5076095a5f1d627b1ca2.tar.bz2
Change our selenium tests to call
window.o3d_prepForSelenium if it exists and fix becahdemo to use this feature. Review URL: http://codereview.chromium.org/155191 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20113 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples/o3djs')
-rw-r--r--o3d/samples/o3djs/performance.js25
1 files changed, 13 insertions, 12 deletions
diff --git a/o3d/samples/o3djs/performance.js b/o3d/samples/o3djs/performance.js
index 055bf2e..e81396f 100644
--- a/o3d/samples/o3djs/performance.js
+++ b/o3d/samples/o3djs/performance.js
@@ -56,7 +56,7 @@ o3djs.performance.createPerformanceMonitor = function(
targetFPSMin, targetFPSMax, increaseQuality, decreaseQuality, opt_options) {
return new o3djs.performance.PerformanceMonitor(targetFPSMin, targetFPSMax,
increaseQuality, decreaseQuality, opt_options);
-}
+};
/**
* A class that monitors performance [in terms of FPS] and helps to adjust the
@@ -77,20 +77,20 @@ o3djs.performance.PerformanceMonitor = function(
/**
* A function to increase quality/lower FPS.
- * @type {function(): void}
+ * @type {function(): void}
*/
this.increaseQuality = increaseQuality;
/**
* A function to decrease quality/raise FPS.
- * @type {function(): void}
+ * @type {function(): void}
*/
this.decreaseQuality = decreaseQuality;
/**
* The mean time taken per frame so far, in seconds. This is only valid once
* we've collected at least minSamples samples.
- * @type {number}
+ * @type {number}
*/
this.meanFrameTime = 0;
@@ -99,14 +99,14 @@ o3djs.performance.PerformanceMonitor = function(
* or equal to this.damping. After that point, we no longer update
* this.sampleCount, so it will clip at this.damping.
*
- * @type {number}
+ * @type {number}
*/
this.sampleCount = 0;
/**
* The minimum number of samples to collect before trying to adjust quality.
*
- * @type {number}
+ * @type {number}
*/
this.minSamples = opt_options.opt_minSamples || 60;
@@ -117,7 +117,7 @@ o3djs.performance.PerformanceMonitor = function(
* between 60 and 600 are probably reasonable values, depending on your needs,
* but the number must be no less than minSamples.
*
- * @type {number}
+ * @type {number}
*/
this.damping = opt_options.opt_damping || 120;
@@ -125,7 +125,7 @@ o3djs.performance.PerformanceMonitor = function(
* The minimum number of samples to take in between adjustments, to cut down
* on overshoot. It defaults to 2 * minSamples.
*
- * @type {number}
+ * @type {number}
*/
this.delayCycles = opt_options.opt_delayCycles || 2 * this.minSamples;
@@ -137,7 +137,7 @@ o3djs.performance.PerformanceMonitor = function(
if (this.damping < this.minSamples) {
throw Error('Damping must be at least minSamples.');
}
-}
+};
/**
* Options for the PerformanceMonitor.
@@ -171,8 +171,8 @@ o3djs.performance.PerformanceMonitor.prototype.onRender = function(seconds) {
var test = true;
if (this.sampleCount < this.damping) {
if (this.sampleCount >= this.minSamples) {
- this.scaleInput_ = 1 / (this.sampleCount + 1);
- this.scaleMean_ = this.sampleCount * this.scaleInput_;
+ this.scaleInput_ = 1 / (this.sampleCount + 1);
+ this.scaleMean_ = this.sampleCount * this.scaleInput_;
} else {
test = false;
}
@@ -191,5 +191,6 @@ o3djs.performance.PerformanceMonitor.prototype.onRender = function(seconds) {
this.delayCyclesLeft_ = this.delayCycles;
}
}
-}
+};
+