Only update canvas if not dirty

This commit is contained in:
Tim Schaub
2015-07-09 16:31:40 -06:00
parent d5aa0d9a8e
commit 643c2e6f21

View File

@@ -318,7 +318,10 @@ ol.source.Raster.prototype.onWorkerComplete_ =
this.dispatchEvent(new ol.source.RasterEvent(
ol.source.RasterEventType.AFTEROPERATIONS, frameState, data));
this.canvasContext_.putImageData(output, 0, 0);
var resolution = frameState.viewState.resolution / frameState.pixelRatio;
if (!this.isDirty_(frameState.extent, resolution)) {
this.canvasContext_.putImageData(output, 0, 0);
}
callback(null);
};