diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-02-19 09:48:32 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-02-19 09:48:32 -0800 |
commit | 5f3f6b02c10c1592ef0c85f119ec2fbe6e59bca7 (patch) | |
tree | 1e19f9acc38d092197da17f9531268c833047b1f | |
parent | 044edf0a64be1880ad4f681909cd82475a3ab133 (diff) | |
parent | 1fc1c855ebd5b76c26f369f59e5876110e515e7e (diff) |
Merge pull request #858 from ehsan/drawimage-memcpy
Use the copy composite operation when calling drawImage
-rw-r--r-- | src/library_sdl.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index 4ad7a9a9..66e9e901 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -1079,7 +1079,9 @@ var LibrarySDL = { } var surf = SDL.makeSurface(raw.width, raw.height, 0, false, 'load:' + filename); var surfData = SDL.surfaces[surf]; + surfData.ctx.globalCompositeOperation = "copy"; surfData.ctx.drawImage(raw, 0, 0, raw.width, raw.height, 0, 0, raw.width, raw.height); + surfData.ctx.globalCompositeOperation = "source-over"; // XXX SDL does not specify that loaded images must have available pixel data, in fact // there are cases where you just want to blit them, so you just need the hardware // accelerated version. However, code everywhere seems to assume that the pixels |