Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions MotionMark/resources/debug-runner/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

Utilities.extendObject(Strings.text, {
samples: "Samples",
complexity: "Time Complexity",
Expand Down Expand Up @@ -456,3 +457,28 @@ Suites.push(new Suite("Basic canvas path suite",
}
]
));

Suites.push(new Suite("Tentative 1.4 suite",
[
{
url: "dev/stories/stories.html",
name: "Stories"
},
{
url: "dev/map-zoomer/map-zoomer.html",
name: "Map Zoomer"
},
{
url: "dev/radial-chart/radial-chart.html",
name: "Canvas Radial Chart"
},
{
url: "dev/dashboard/dashboard.html",
name: "Dashboard"
},
{
url: "dev/text-rendering.html",
name: "Text Rendering"
}
]
));
24 changes: 22 additions & 2 deletions MotionMark/resources/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ class Point {
this.y = y;
}

clone()
{
return new Point(this.x, this.y);
}

// Used when the point object is used as a size object.
get width()
{
Expand Down Expand Up @@ -290,6 +295,21 @@ class Point {
return new Point(this.x * other, this.y * other);
return new Point(this.x * other.x, this.y * other.y);
}

min(other)
{
return new Point(Math.min(this.x, other.x), Math.min(this.y, other.y));
}

max(other)
{
return new Point(Math.max(this.x, other.x), Math.max(this.y, other.y));
}

scale(factor)
{
return new Point(this.x * factor, this.y * factor);
}

move(angle, velocity, timeDelta)
{
Expand All @@ -298,12 +318,12 @@ class Point {

length()
{
return Math.sqrt(this.x * this.x + this.y * this.y);
return Math.hypot(this.x, this.y);
}

normalize()
{
var l = Math.sqrt(this.x * this.x + this.y * this.y);
const l = this.length();
this.x /= l;
this.y /= l;
return this;
Expand Down
14 changes: 14 additions & 0 deletions MotionMark/resources/runner/motionmark.css
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,10 @@ body.images-loaded #intro {
.frame-container {
position: absolute;

/*
top: 50%;
left: 50%;
*/
}

.frame-container > iframe {
Expand All @@ -400,24 +402,36 @@ body.images-loaded #intro {
}

body.small .frame-container {
/*
width: 568px;
height: 320px;
margin-left: -284px;
margin-top: -160px;
*/
width: 100%;
height: 100%;
}

body.medium .frame-container {
/*
width: 900px;
height: 600px;
margin-left: -450px;
margin-top: -300px;
*/
width: 100%;
height: 100%;
}

body.large .frame-container {
/*
width: 1600px;
height: 800px;
margin-left: -800px;
margin-top: -400px;
*/
width: 100%;
height: 100%;
}

/* Results section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class BouncingCanvasParticlesStage extends BouncingParticlesStage {
{
await super.initialize(benchmark, options);
this.context = this.element.getContext("2d");
this.context.scale(this.devicePixelRatio, this.devicePixelRatio);
}

animate(timeDelta)
Expand Down
1 change: 1 addition & 0 deletions MotionMark/tests/core/resources/canvas-stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class CanvasStage extends Stage {
{
await super.initialize(benchmark, options);
this.context = this.element.getContext("2d");
this.context.scale(this.devicePixelRatio, this.devicePixelRatio);
}

tune(count)
Expand Down
5 changes: 4 additions & 1 deletion MotionMark/tests/core/resources/image-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ class ImageDataStage extends Stage {
for (var i = 0; i < this._offsetIndex; ++i) {
var element = this.testElements[i];
var context = element.getContext("2d");
context.scale(this.devicePixelRatio, this.devicePixelRatio);

// Get image data
var imageData = context.getImageData(0, 0, ImageDataStage.imageWidth, ImageDataStage.imageHeight);
Expand All @@ -158,7 +159,9 @@ class ImageDataStage extends Stage {
context.putImageData(imageData, 0, 0);
else {
this._refreshElement(element);
element.getContext("2d").drawImage(Stage.randomElementInArray(this.images), 0, 0, ImageDataStage.imageWidth, ImageDataStage.imageHeight);
const context = element.getContext("2d");
context.scale(this.devicePixelRatio, this.devicePixelRatio);
context.drawImage(Stage.randomElementInArray(this.images), 0, 0, ImageDataStage.imageWidth, ImageDataStage.imageHeight);
}
}
}
Expand Down
37 changes: 37 additions & 0 deletions MotionMark/tests/dev/dashboard/Description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Dashboard SVG Test

Goals
-----

Measure SVG/rendering workloads that are common for data visualization.


Design
------

A test based on D3.js that updates various SVG graphcs


Features tested
---------------

* TBD


Work per measured frame
----------------------

D3 updates to the SVG DOM, and work triggered by those updates.


Licensing requirements
----------------------

None


Remaining work
--------------

* Use some more SVG features
* Flesh out the content some more; use more D3 features.
Loading