Changeset 190920 in webkit


Ignore:
Timestamp:
Oct 12, 2015 7:11:44 PM (9 years ago)
Author:
jonlee@apple.com
Message:

Add canvas line path tests
https://bugs.webkit.org/show_bug.cgi?id=150076
<rdar://problem/23082285>

Reviewed by Dean Jackson.

  • Animometer/runner/resources/tests.js: Add new line path tests, with different

line joins.

  • Animometer/tests/simple/resources/simple-canvas-paths.js:

(CanvasLinePathStage): The stage is the same as the SimpleCanvasPathStrokeStage
but sets the lineJoin on the context.
(CanvasPathBenchmark.prototype.createStage): Add the tests.

Location:
trunk/PerformanceTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/Animometer/runner/resources/tests.js

    r190918 r190920  
    152152        },
    153153        {
     154            url: "simple/simple-canvas-paths.html?pathType=linePath&lineJoin=bevel",
     155            name: "Canvas line path, bevel join"
     156        },
     157        {
     158            url: "simple/simple-canvas-paths.html?pathType=linePath&lineJoin=round",
     159            name: "Canvas line path, round join"
     160        },
     161        {
     162            url: "simple/simple-canvas-paths.html?pathType=linePath&lineJoin=miter",
     163            name: "Canvas line path, miter join"
     164        },
     165        {
    154166            url: "simple/simple-canvas-paths.html?pathType=quadratic",
    155167            name: "Canvas quadratic segments"
  • trunk/PerformanceTests/Animometer/tests/simple/resources/simple-canvas-paths.js

    r190919 r190920  
    213213CanvasLineSegmentStage.prototype = Object.create(SimpleCanvasStage.prototype);
    214214CanvasLineSegmentStage.prototype.constructor = CanvasLineSegmentStage;
     215
     216function CanvasLinePathStage(element, options)
     217{
     218    SimpleCanvasPathStrokeStage.call(this, element, options, CanvasLinePoint);
     219    this.context.lineJoin = options["lineJoin"] || "bevel";
     220}
     221CanvasLinePathStage.prototype = Object.create(SimpleCanvasPathStrokeStage.prototype);
     222CanvasLinePathStage.prototype.constructor = CanvasLinePathStage;
    215223
    216224// === BENCHMARK ===
     
    226234    case "line":
    227235        return new CanvasLineSegmentStage(element, this._options);
     236    case "linePath": {
     237        if ("lineJoin" in this._options)
     238            return new CanvasLinePathStage(element, this._options);
     239        break;
     240    }
    228241    case "quadratic":
    229242        return new SimpleCanvasStage(element, this._options, CanvasQuadraticSegment);
  • trunk/PerformanceTests/ChangeLog

    r190919 r190920  
     12015-10-12  Jon Lee  <jonlee@apple.com>
     2
     3        Add canvas line path tests
     4        https://bugs.webkit.org/show_bug.cgi?id=150076
     5        <rdar://problem/23082285>
     6
     7        Reviewed by Dean Jackson.
     8
     9        * Animometer/runner/resources/tests.js: Add new line path tests, with different
     10        line joins.
     11        * Animometer/tests/simple/resources/simple-canvas-paths.js:
     12        (CanvasLinePathStage): The stage is the same as the SimpleCanvasPathStrokeStage
     13        but sets the lineJoin on the context.
     14        (CanvasPathBenchmark.prototype.createStage): Add the tests.
     15
    1162015-10-12  Jon Lee  <jonlee@apple.com>
    217
Note: See TracChangeset for help on using the changeset viewer.