Skip to content

Commit

Permalink
Add willReadFrequently: true to Images test
Browse files Browse the repository at this point in the history
We expect authors to use this path in the wild so we should prefer
measuring it.
  • Loading branch information
jrmuizel committed Jun 15, 2023
1 parent 623628c commit b473a56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MotionMark1.2/tests/master/resources/image-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ var ImageDataStage = Utilities.createSubclass(Stage,
animate: function(timeDelta) {
for (var i = 0; i < this._offsetIndex; ++i) {
var element = this.testElements[i];
var context = element.getContext("2d");
var context = element.getContext("2d", { willReadFrequently: true });

// Get image data
var imageData = context.getImageData(0, 0, this.imageWidth, this.imageHeight);
Expand All @@ -170,7 +170,7 @@ var ImageDataStage = Utilities.createSubclass(Stage,
context.putImageData(imageData, 0, 0);
else {
this._refreshElement(element);
element.getContext("2d").drawImage(Stage.randomElementInArray(this.images), 0, 0, this.imageWidth, this.imageHeight);
element.getContext("2d", { willReadFrequently: true }).drawImage(Stage.randomElementInArray(this.images), 0, 0, this.imageWidth, this.imageHeight);
}
}
},
Expand Down

0 comments on commit b473a56

Please sign in to comment.