broadway: Do copy rects with compositing mode "copy"
This commit is contained in:
@ -99,7 +99,7 @@ function initContext(canvas, x, y, id)
|
|||||||
canvas.style["top"] = y + "px";
|
canvas.style["top"] = y + "px";
|
||||||
canvas.style["display"] = "none";
|
canvas.style["display"] = "none";
|
||||||
var context = canvas.getContext("2d");
|
var context = canvas.getContext("2d");
|
||||||
context.globalCompositeOperation = "src-over";
|
context.globalCompositeOperation = "source-over";
|
||||||
document.body.appendChild(canvas);
|
document.body.appendChild(canvas);
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
@ -236,6 +236,7 @@ function handleCommands(cmd_obj)
|
|||||||
i = i + size;
|
i = i + size;
|
||||||
var img = new Image();
|
var img = new Image();
|
||||||
img.src = url;
|
img.src = url;
|
||||||
|
surfaces[id].globalCompositeOperation = "source-over";
|
||||||
if (img.complete) {
|
if (img.complete) {
|
||||||
surfaces[id].drawImage(img, x, y);
|
surfaces[id].drawImage(img, x, y);
|
||||||
} else {
|
} else {
|
||||||
@ -296,6 +297,7 @@ function handleCommands(cmd_obj)
|
|||||||
var dy = base64_16s(cmd, i);
|
var dy = base64_16s(cmd, i);
|
||||||
i = i + 3;
|
i = i + 3;
|
||||||
|
|
||||||
|
context.globalCompositeOperation = "copy";
|
||||||
context.drawImage(context.canvas,
|
context.drawImage(context.canvas,
|
||||||
minx - dx, miny - dy, maxx - minx, maxy - miny,
|
minx - dx, miny - dy, maxx - minx, maxy - miny,
|
||||||
minx, miny, maxx - minx, maxy - miny);
|
minx, miny, maxx - minx, maxy - miny);
|
||||||
|
|||||||
Reference in New Issue
Block a user