Skip to content

Commit b473a56

Browse files
committed
Add willReadFrequently: true to Images test
We expect authors to use this path in the wild so we should prefer measuring it.
1 parent 623628c commit b473a56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MotionMark1.2/tests/master/resources/image-data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ var ImageDataStage = Utilities.createSubclass(Stage,
143143
animate: function(timeDelta) {
144144
for (var i = 0; i < this._offsetIndex; ++i) {
145145
var element = this.testElements[i];
146-
var context = element.getContext("2d");
146+
var context = element.getContext("2d", { willReadFrequently: true });
147147

148148
// Get image data
149149
var imageData = context.getImageData(0, 0, this.imageWidth, this.imageHeight);
@@ -170,7 +170,7 @@ var ImageDataStage = Utilities.createSubclass(Stage,
170170
context.putImageData(imageData, 0, 0);
171171
else {
172172
this._refreshElement(element);
173-
element.getContext("2d").drawImage(Stage.randomElementInArray(this.images), 0, 0, this.imageWidth, this.imageHeight);
173+
element.getContext("2d", { willReadFrequently: true }).drawImage(Stage.randomElementInArray(this.images), 0, 0, this.imageWidth, this.imageHeight);
174174
}
175175
}
176176
},

0 commit comments

Comments
 (0)