openlayers/ol3 — pull request #263 by twpayne (2013-03-04 17:58:45+00:00)
Title: Canvas renderer optimizations

This is the first of two or three optimizations for the canvas renderer. It avoids re-drawing tiles in the per-layer canvases if the canvas is known to already contain the correct tile in that part.

In addition, an `opaque` flag is added to all sources. If a tile can be transparent, it will be blended with the existing data in the canvas, leading to a mix of old and new data, so we must clear that area of the canvas before writing the tile [1]. However, if the tile is known to be opaque then we can avoid the clear. `opaque` is false by default (the slower but surer case), but is set to true for all provided tile sources that are known to return fully opaque tiles.

[1] It is possible that there may be a work around for this by setting the correct value for `context.globalCompositeOperation`, but I have not yet found the correct value.