Changeset 190917 in webkit
- Timestamp:
- Oct 12, 2015 7:10:08 PM (9 years ago)
- Location:
- trunk/PerformanceTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/PerformanceTests/Animometer/runner/resources/tests.js
r190913 r190917 168 168 }, 169 169 { 170 url: "simple/simple-canvas-paths.html?pathType=lineFill", 171 name: "Canvas line path, fill" 172 }, 173 { 174 url: "simple/simple-canvas-paths.html?pathType=quadraticFill", 175 name: "Canvas quadratic path, fill" 176 }, 177 { 178 url: "simple/simple-canvas-paths.html?pathType=bezierFill", 179 name: "Canvas bezier path, fill" 180 }, 181 { 170 182 url: "simple/simple-canvas-paths.html?&pathType=arcToFill", 171 183 name: "Canvas arcTo segments, fill" -
trunk/PerformanceTests/Animometer/tests/simple/resources/simple-canvas-paths.js
r190913 r190917 1 1 // === PAINT OBJECTS === 2 3 function CanvasLinePoint(stage, coordinateMaximum) { 4 this._point = stage.randomPosition(new Point(Math.min(stage.size.x, coordinateMaximum), Math.min(stage.size.y, coordinateMaximum))); 5 } 6 CanvasLinePoint.prototype.draw = function(context) { 7 context.lineTo(this._point.x, this._point.y); 8 }; 2 9 3 10 function CanvasQuadraticSegment(stage) { … … 141 148 }); 142 149 context.stroke(); 150 } 151 152 function SimpleCanvasPathFillStage(element, options, canvasObject) { 153 SimpleCanvasStage.call(this, element, options, canvasObject); 154 } 155 SimpleCanvasPathFillStage.prototype = Object.create(SimpleCanvasStage.prototype); 156 SimpleCanvasPathFillStage.prototype.constructor = SimpleCanvasPathFillStage; 157 SimpleCanvasPathFillStage.prototype.animate = function() { 158 var context = this.context; 159 context.fillStyle = this.randomColor(); 160 context.beginPath(); 161 context.moveTo(0,0); 162 this._objects.forEach(function(object) { 163 object.draw(context); 164 }); 165 context.fill(); 143 166 } 144 167 … … 167 190 case "rect": 168 191 return new SimpleCanvasStage(element, this._options, CanvasRect); 192 case "lineFill": 193 return new SimpleCanvasPathFillStage(element, this._options, CanvasLinePoint); 194 case "quadraticFill": 195 return new SimpleCanvasPathFillStage(element, this._options, CanvasQuadraticPoint); 196 case "bezierFill": 197 return new SimpleCanvasPathFillStage(element, this._options, CanvasBezierPoint); 169 198 case "arcToFill": 170 199 return new SimpleCanvasStage(element, this._options, CanvasArcToSegmentFill); -
trunk/PerformanceTests/ChangeLog
r190913 r190917 1 2015-10-12 Jon Lee <jonlee@apple.com> 2 3 Add canvas path fill tests 4 https://bugs.webkit.org/show_bug.cgi?id=150071 5 <rdar://problem/23082001> 6 7 Reviewed by Dean Jackson. 8 9 * Animometer/runner/resources/tests.js: Add new pathTypes for path fills. 10 * Animometer/tests/simple/resources/simple-canvas-paths.js: 11 (CanvasLinePoint): Add basic point for a line, and call lineTo. 12 (SimpleCanvasPathFillStage): Add a new stage similar to SimpleCanvasPathStrokeStage. 13 (CanvasPathBenchmark.prototype.createStage): Add the tests. 14 1 15 2015-10-12 Jon Lee <jonlee@apple.com> 2 16
Note: See TracChangeset
for help on using the changeset viewer.