Skip to content

Commit

Permalink
Expand the grid size of the Multiply test automatically when needed
Browse files Browse the repository at this point in the history
WebKit#52

Enlarge the grid size and reduce the tile size when a larger complexity is needed
to lower the frame rate.

Refactor the spiral iterator into a separate class. Keep calling its next() method
to move to the next cell. When its isDone() returns true enlarge the iterator grid
size and resize the already created tiles to fit in the new grid size.

Add a new class for the roundedRect tile called "Tile". This class can handle the
location, size and animation of the Tile.
  • Loading branch information
shallawa committed Apr 26, 2024
1 parent f1c7edb commit 3151355
Show file tree
Hide file tree
Showing 2 changed files with 248 additions and 95 deletions.
26 changes: 26 additions & 0 deletions MotionMark/resources/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,41 @@ Point = Utilities.createClass(
return this.x;
},

// Used when the point object is used as a size object.
set width(w)
{
this.x = w;
},

// Used when the point object is used as a size object.
get height()
{
return this.y;
},

// Used when the point object is used as a size object.
set height(h)
{
this.y = h;
},

// Used when the point object is used as a size object.
get center()
{
return new Point(this.x / 2, this.y / 2);
},

// Used when the point object is used as a size object.
area: function() {
return this.x * this.y;
},

// Used when the point object is used as a size object.
expand(width, height) {
this.x += width;
this.y += height;
},

str: function()
{
return "x = " + this.x + ", y = " + this.y;
Expand Down Expand Up @@ -320,6 +343,9 @@ Point = Utilities.createClass(
}
});

// FIXME: Add a seprate class for Size.
let Size = Point;

Utilities.extendObject(Point, {
zero: new Point(0, 0),

Expand Down
Loading

0 comments on commit 3151355

Please sign in to comment.