mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-05-19 19:02:21 +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:
parent
72d5d09c29
commit
a8ff41bd95
Binary file not shown.
@ -65,13 +65,15 @@
|
|||||||
mode: blockMode.readAPI,
|
mode: blockMode.readAPI,
|
||||||
object: unsafeWindow.CanvasRenderingContext2D,
|
object: unsafeWindow.CanvasRenderingContext2D,
|
||||||
fake: function(sx, sy, sw, sh){
|
fake: function(sx, sy, sw, sh){
|
||||||
var imageData = new window.ImageData(sw, sh);
|
|
||||||
var l = sw * sh * 4;
|
var l = sw * sh * 4;
|
||||||
|
var data = new Uint8ClampedArray(l);
|
||||||
for (var i = 0; i < l; i += 1){
|
for (var i = 0; i < l; i += 1){
|
||||||
imageData.data[i] = Math.floor(
|
data[i] = Math.floor(
|
||||||
Math.random() * 256
|
Math.random() * 256
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
var imageData = new window.ImageData(sw, sh);
|
||||||
|
imageData.data.set(cloneInto(data, unsafeWindow));
|
||||||
return imageData;
|
return imageData;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user