Merge pull request #6321 from Daft-Freak/no-ie
Delete emscripten CanvasPixelArray (IE10/11) supportmain
commit
712457ec28
|
@ -95,28 +95,13 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec
|
|||
var src = pixels >> 2;
|
||||
var dst = 0;
|
||||
var num;
|
||||
if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) {
|
||||
// IE10/IE11: ImageData objects are backed by the deprecated CanvasPixelArray,
|
||||
// not UInt8ClampedArray. These don't have buffers, so we need to revert
|
||||
// to copying a byte at a time. We do the undefined check because modern
|
||||
// browsers do not define CanvasPixelArray anymore.
|
||||
num = data.length;
|
||||
while (dst < num) {
|
||||
var val = HEAP32[src]; // This is optimized. Instead, we could do {{{ makeGetValue('buffer', 'dst', 'i32') }}};
|
||||
data[dst ] = val & 0xff;
|
||||
data[dst+1] = (val >> 8) & 0xff;
|
||||
data[dst+2] = (val >> 16) & 0xff;
|
||||
data[dst+3] = 0xff;
|
||||
src++;
|
||||
dst += 4;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (SDL3.data32Data !== data) {
|
||||
SDL3.data32 = new Int32Array(data.buffer);
|
||||
SDL3.data8 = new Uint8Array(data.buffer);
|
||||
SDL3.data32Data = data;
|
||||
}
|
||||
var data32 = SDL3.data32;
|
||||
var data32 = SDL2.data32;
|
||||
num = data32.length;
|
||||
// logically we need to do
|
||||
// while (dst < num) {
|
||||
|
@ -156,7 +141,6 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec
|
|||
i = i + 4 | 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SDL3.ctx.putImageData(SDL3.image, 0, 0);
|
||||
}, surface->w, surface->h, surface->pixels, data->canvas_id);
|
||||
|
|
|
@ -92,28 +92,9 @@ Emscripten_CreateCursor(SDL_Surface* surface, int hot_x, int hot_y)
|
|||
var image = ctx.createImageData(w, h);
|
||||
var data = image.data;
|
||||
var src = pixels >> 2;
|
||||
var dst = 0;
|
||||
var num;
|
||||
if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) {
|
||||
// IE10/IE11: ImageData objects are backed by the deprecated CanvasPixelArray,
|
||||
// not UInt8ClampedArray. These don't have buffers, so we need to revert
|
||||
// to copying a byte at a time. We do the undefined check because modern
|
||||
// browsers do not define CanvasPixelArray anymore.
|
||||
num = data.length;
|
||||
while (dst < num) {
|
||||
var val = HEAP32[src]; // This is optimized. Instead, we could do {{{ makeGetValue('buffer', 'dst', 'i32') }}};
|
||||
data[dst ] = val & 0xff;
|
||||
data[dst+1] = (val >> 8) & 0xff;
|
||||
data[dst+2] = (val >> 16) & 0xff;
|
||||
data[dst+3] = (val >> 24) & 0xff;
|
||||
src++;
|
||||
dst += 4;
|
||||
}
|
||||
} else {
|
||||
|
||||
var data32 = new Int32Array(data.buffer);
|
||||
num = data32.length;
|
||||
data32.set(HEAP32.subarray(src, src + num));
|
||||
}
|
||||
data32.set(HEAP32.subarray(src, src + data32.length));
|
||||
|
||||
ctx.putImageData(image, 0, 0);
|
||||
var url = hot_x === 0 && hot_y === 0
|
||||
|
|
Loading…
Reference in New Issue