mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 10:31:54 +01: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:
parent
72d5d09c29
commit
a8ff41bd95
Binary file not shown.
@ -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;
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user