mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +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
2 changed files with 4 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue