Skip to content

Commit 3f363c0

Browse files
committed
Replace the anonymous SimpleCanvasStage subclass with an explicitly named one, with some name juggling.
1 parent 25a5449 commit 3f363c0

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

MotionMark/tests/core/resources/canvas-stage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* THE POSSIBILITY OF SUCH DAMAGE.
2424
*/
2525

26-
class SimpleCanvasStage extends Stage {
26+
class CanvasStage extends Stage {
2727
constructor(canvasObject)
2828
{
2929
super();

MotionMark/tests/core/resources/canvas-tests.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class CanvasBezierSegment extends CanvasLinePoint {
199199

200200
// === STAGES ===
201201

202-
class CanvasLineSegmentStage extends SimpleCanvasStage {
202+
class CanvasLineSegmentStage extends CanvasStage {
203203
constructor()
204204
{
205205
super(CanvasLineSegment);
@@ -265,7 +265,7 @@ class CanvasLineSegmentStage extends SimpleCanvasStage {
265265
}
266266
}
267267

268-
class CanvasLinePathStage extends SimpleCanvasStage {
268+
class CanvasLinePathStage extends CanvasStage {
269269
constructor()
270270
{
271271
super([CanvasLinePoint, CanvasLinePoint, CanvasQuadraticSegment, CanvasBezierSegment]);
@@ -325,7 +325,7 @@ class CanvasPathBenchmark extends Benchmark {
325325
stage = new CanvasLinePathStage();
326326
break;
327327
case "arcs":
328-
stage = new SimpleCanvasStage(CanvasArc);
328+
stage = new CanvasStage(CanvasArc);
329329
break;
330330
}
331331

MotionMark/tests/simple/resources/simple-canvas.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@
2222
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
2323
* THE POSSIBILITY OF SUCH DAMAGE.
2424
*/
25-
Utilities.extendObject(SimpleCanvasStage.prototype, {
26-
tune: function(count)
25+
26+
class SimpleCanvasStage extends CanvasStage {
27+
constructor(canvasObject)
28+
{
29+
super(canvasObject)
30+
}
31+
32+
tune(count)
2733
{
2834
if (count == 0)
2935
return;
@@ -42,18 +48,18 @@ Utilities.extendObject(SimpleCanvasStage.prototype, {
4248
for (var i = 0; i < newIndex; ++i)
4349
this.objects.push(new this._canvasObject(this, coordinateMaximumFactor));
4450
}
45-
},
51+
}
4652

47-
animate: function()
53+
animate()
4854
{
4955
var context = this.context;
5056
context.clearRect(0, 0, this.size.x, this.size.y);
5157
for (var i = 0, length = this.offsetIndex; i < length; ++i)
5258
this.objects[i].draw(context);
53-
},
59+
}
5460

55-
complexity: function()
61+
complexity()
5662
{
5763
return this.offsetIndex;
5864
}
59-
});
65+
}

0 commit comments

Comments
 (0)