1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-06-11 23:49:52 +02:00

Fixed problem with FF 33

Got error message due to xrayed TypedArray:
Accessing TypedArray data over Xrays is slow, and forbidden in order to
encourage performant code. To copy TypedArrays across origin boundaries,
consider using Components.utils.cloneInto().
This commit is contained in:
kkapsner 2014-11-16 11:14:15 +01:00
parent 72d5d09c29
commit a8ff41bd95
2 changed files with 4 additions and 2 deletions

Binary file not shown.

View File

@ -65,13 +65,15 @@
mode: blockMode.readAPI,
object: unsafeWindow.CanvasRenderingContext2D,
fake: function(sx, sy, sw, sh){
var imageData = new window.ImageData(sw, sh);
var l = sw * sh * 4;
var data = new Uint8ClampedArray(l);
for (var i = 0; i < l; i += 1){
imageData.data[i] = Math.floor(
data[i] = Math.floor(
Math.random() * 256
);
}
var imageData = new window.ImageData(sw, sh);
imageData.data.set(cloneInto(data, unsafeWindow));
return imageData;
}
},