Changeset 196415 in webkit
- Timestamp:
- Feb 10, 2016 11:42:00 PM (8 years ago)
- Location:
- trunk/PerformanceTests
- Files:
-
- 6 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/PerformanceTests/Animometer/resources/extensions.js
r196381 r196415 84 84 return element; 85 85 }, 86 86 87 87 browserPrefix: function() 88 88 { 89 89 // Get the HTML element's CSSStyleDeclaration 90 90 var styles = window.getComputedStyle(document.documentElement, ''); 91 91 92 92 // Convert the styles list to an array 93 93 var stylesArray = Array.prototype.slice.call(styles); 94 94 95 95 // Concatenate all the styles in one big string 96 96 var stylesString = stylesArray.join(''); … … 98 98 // Search the styles string for a known prefix type, settle on Opera if none is found. 99 99 var prefixes = stylesString.match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o']); 100 100 101 101 // prefixes has two elements; e.g. for webkit it has ['-webkit-', 'webkit']; 102 102 var prefix = prefixes[1]; … … 113 113 }; 114 114 }, 115 115 116 116 setElementPrefixedProperty: function(element, property, value) 117 117 { 118 118 element.style[property] = element.style[this.browserPrefix().js + property[0].toUpperCase() + property.substr(1)] = value; 119 }, 120 121 progressValue: function(value, min, max) 122 { 123 return (value - min) / (max - min); 124 }, 125 126 lerp: function(value, min, max) 127 { 128 return min + (max - min) * value; 119 129 } 120 130 }; -
trunk/PerformanceTests/Animometer/resources/runner/benchmark-runner.js
r196304 r196415 95 95 96 96 var benchmark = new contentWindow.benchmarkClass(options); 97 document.body.style.backgroundColor = benchmark.backgroundColor(); 97 98 benchmark.run().then(function(results) { 98 99 var suiteResults = self._suitesResults[suite.name] || {}; … … 154 155 if (currentIteration < self._client.iterationCount) 155 156 self.runAllSteps(); 156 else if (this._client && this._client.didFinishLastIteration) 157 else if (this._client && this._client.didFinishLastIteration) { 158 document.body.style.backgroundColor = ""; 157 159 self._client.didFinishLastIteration(); 160 } 158 161 } 159 162 -
trunk/PerformanceTests/Animometer/resources/runner/tests.js
r194756 r196415 14 14 [ 15 15 { 16 url: "master/multiply.html", 17 name: "Multiply" 18 }, 19 { 16 20 url: "master/canvas-stage.html?pathType=arcs", 17 21 name: "Canvas arcs" … … 24 28 url: "master/canvas-stage.html?pathType=line&lineCap=square", 25 29 name: "Canvas line segments" 30 }, 31 { 32 url: "master/focus.html", 33 name: "Focus" 34 }, 35 { 36 url: "master/image-data.html", 37 name: "Images" 26 38 }, 27 39 { -
trunk/PerformanceTests/Animometer/tests/master/resources/stage.css
r194408 r196415 9 9 padding: 0; 10 10 background-color: rgb(241, 241, 241); 11 font-family: -apple-system, "Helvetica Neue", Helvetica, Verdana, sans-serif; 11 12 } 12 13 13 14 #stage { 14 width: 100%; 15 height: 100%; 16 background-color: rgb(241, 241, 241); 15 position: relative; 16 width: 100%; 17 height: 100%; 18 background-color: rgb(241, 241, 241); 17 19 } 20 21 #center-text { 22 position: absolute; 23 z-index: 3; 24 top: 50%; 25 left: 50%; 26 transform: translateX(-50%) translateY(-50%); 27 } -
trunk/PerformanceTests/Animometer/tests/resources/main.js
r196381 r196415 728 728 randomBool: function() 729 729 { 730 return !!Math.round(this.random(0, 1)); 730 return !!Math.round(Math.random()); 731 }, 732 733 randomSign: function() 734 { 735 return Math.random() >= .5 ? 1 : -1; 731 736 }, 732 737 … … 907 912 }, 908 913 914 get timestamp() 915 { 916 return this._currentTimestamp - this._startTimestamp; 917 }, 918 919 backgroundColor: function() 920 { 921 var stage = window.getComputedStyle(document.getElementById("stage")); 922 return stage["background-color"]; 923 }, 924 909 925 run: function() 910 926 { … … 939 955 if (this._currentTimestamp - this._previousTimestamp >= 100) { 940 956 this._didWarmUp = true; 957 this._startTimestamp = this._currentTimestamp; 941 958 this._controller.start(this._currentTimestamp, this._stage); 942 959 this._previousTimestamp = this._currentTimestamp; -
trunk/PerformanceTests/ChangeLog
r196381 r196415 1 2016-02-10 Jon Lee <jonlee@apple.com> 2 3 Add new benchmark tests. 4 https://bugs.webkit.org/show_bug.cgi?id=154063 5 6 Provisionally reviewed by Said Abou-Hallawa. 7 8 Add tests for get/put image data, filters, opacity, and css transforms. 9 10 * Animometer/resources/runner/benchmark-runner.js: 11 (_runBenchmarkAndRecordResults): Update the body background color to match that of 12 the stage. 13 (this._runNextIteration): Clear the background color style for the results page. 14 * Animometer/resources/runner/tests.js: 15 * Animometer/tests/master/focus.html: Added. 16 * Animometer/tests/master/image-data.html: Added. 17 * Animometer/tests/master/multiply.html: Added. 18 * Animometer/tests/master/resources/focus.js: Added. 19 * Animometer/tests/master/resources/image-data.js: Added. 20 * Animometer/tests/master/resources/multiply.js: Added. 21 * Animometer/tests/master/resources/stage.css: Move common styles out. 22 * Animometer/tests/resources/main.js: Update Stage.randomBool to use Math.random. 23 Add Stage.randomSign for randomly setting a direction. Add the notion of the 24 current timestamp of the test to Benchmark, since some animations cycle through 25 colors and rely on an incremental counter like the time. 26 1 27 2016-02-09 Said Abou-Hallawa <sabouhallawa@apple.com> 2 28 … … 8 34 * Animometer/resources/debug-runner/tests.js: Include the new tests in the 9 35 "HTML suite" of the debug runner. 10 36 11 37 * Animometer/resources/extensions.js: 12 38 (Utilities.browserPrefix): 13 39 (Utilities.setElementPrefixedProperty): Utility functions to allow setting 14 40 prefixed style properties. 15 41 16 42 * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: 17 43 Set the mix-blend-mode and the filter to some random values if the options 18 44 of the test requested that. 19 45 20 46 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: 21 47 (parseShapeParameters): Parse the url options "blend" and "filter" and set 22 48 the corresponding flags. 23 49 24 50 * Animometer/tests/resources/main.js: 25 51 (randomStyleMixBlendMode):
Note: See TracChangeset
for help on using the changeset viewer.