From 1772c8198b52f8d7576527ef267c7a7e234be542 Mon Sep 17 00:00:00 2001 From: philip Date: Sat, 11 Jan 2020 18:07:09 +0000 Subject: [PATCH] Added comment pointing to an area of improvement --- src/ol/reproj.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ol/reproj.js b/src/ol/reproj.js index 518e815572..cca5d98ffa 100644 --- a/src/ol/reproj.js +++ b/src/ol/reproj.js @@ -314,6 +314,10 @@ export function render(width, height, pixelRatio, context.scale(sourceResolution / pixelRatio, -sourceResolution / pixelRatio); + // This is rather inefficient as we draw the *entire* source canvas into the destination and + // rely on the clipping to eliminate nearly all the pixels. It seems smarter to only + // draw the relevant region of the source canvas. However, I'm having difficulty figuring + // out what the parameters ought to be. context.drawImage(stitchContext.canvas, 0, 0); context.restore(); });