Rename redraw to render

This commit is contained in:
Tom Payne
2012-07-22 01:22:18 +02:00
parent 33449e657a
commit abc1b4ff04
7 changed files with 24 additions and 24 deletions

View File

@@ -73,4 +73,4 @@ ol.dom.LayerRenderer.prototype.handleLayerVisibleChange = function() {
/** /**
*/ */
ol.dom.LayerRenderer.prototype.redraw = goog.abstractMethod; ol.dom.LayerRenderer.prototype.render = goog.abstractMethod;

View File

@@ -163,7 +163,7 @@ ol.dom.Map.prototype.handleCenterChanged = function() {
} else { } else {
this.resetLayersPane_(); this.resetLayersPane_();
} }
this.redraw(); this.render();
}; };
@@ -191,7 +191,7 @@ ol.dom.Map.prototype.handleResolutionChanged = function() {
// FIXME: resetLayersPane_ should be called // FIXME: resetLayersPane_ should be called
// elsewhere as we may be frozen here // elsewhere as we may be frozen here
this.resetLayersPane_(); this.resetLayersPane_();
this.redraw(); this.render();
}; };

View File

@@ -35,7 +35,7 @@ goog.inherits(ol.dom.TileLayerRenderer, ol.dom.LayerRenderer);
/** /**
* @inheritDoc * @inheritDoc
*/ */
ol.dom.TileLayerRenderer.prototype.redraw = function() { ol.dom.TileLayerRenderer.prototype.render = function() {
var map = this.getMap(); var map = this.getMap();
var center = map.getCenter(); var center = map.getCenter();

View File

@@ -1,4 +1,3 @@
// FIXME rename redraw to render
// FIXME rename freeze/thaw to freezeRendering/unfreezeRendering // FIXME rename freeze/thaw to freezeRendering/unfreezeRendering
// FIXME add change resolution by zoom step function // FIXME add change resolution by zoom step function
// FIXME recheck layer/map projection compatability when projection changes // FIXME recheck layer/map projection compatability when projection changes
@@ -626,10 +625,10 @@ ol.Map.prototype.recalculateTransforms_ = function() {
/** /**
*/ */
ol.Map.prototype.redraw = function() { ol.Map.prototype.render = function() {
if (!this.animating_) { if (!this.animating_) {
if (this.freezeCount_ === 0) { if (this.freezeCount_ === 0) {
if (this.redrawInternal()) { if (this.renderInternal()) {
this.animate_(); this.animate_();
} }
} else { } else {
@@ -643,13 +642,14 @@ ol.Map.prototype.redraw = function() {
* @protected * @protected
* @return {boolean} Animating. * @return {boolean} Animating.
*/ */
ol.Map.prototype.redrawInternal = function() { ol.Map.prototype.renderInternal = function() {
this.dirty_ = false; this.dirty_ = false;
var animate = false; var animate = false;
this.forEachVisibleLayer(function(layer, layerRenderer) { this.forEachVisibleLayer(function(layer, layerRenderer) {
if (layerRenderer.redraw()) { if (layerRenderer.render()) {
animate = true; animate = true;
} }
}); });
@@ -783,7 +783,7 @@ ol.Map.prototype.thaw = function() {
goog.asserts.assert(this.freezeCount_ > 0); goog.asserts.assert(this.freezeCount_ > 0);
if (--this.freezeCount_ === 0) { if (--this.freezeCount_ === 0) {
if (!this.animating_ && this.dirty_) { if (!this.animating_ && this.dirty_) {
if (this.redrawInternal()) { if (this.renderInternal()) {
this.animate_(); this.animate_();
} }
} }
@@ -812,7 +812,7 @@ ol.MapAnimation = function(map) {
* @inheritDoc * @inheritDoc
*/ */
ol.MapAnimation.prototype.onAnimationFrame = function() { ol.MapAnimation.prototype.onAnimationFrame = function() {
if (!this.map_.redrawInternal()) { if (!this.map_.renderInternal()) {
goog.fx.anim.unregisterAnimation(this); goog.fx.anim.unregisterAnimation(this);
} }
}; };

View File

@@ -55,4 +55,4 @@ ol.webgl.LayerRenderer.prototype.handleWebGLContextLost = goog.nullFunction;
/** /**
*/ */
ol.webgl.LayerRenderer.prototype.redraw = goog.abstractMethod; ol.webgl.LayerRenderer.prototype.render = goog.abstractMethod;

View File

@@ -1,5 +1,5 @@
// FIXME clear tileTextureCache // FIXME clear tileTextureCache
// FIXME defer texture loads until after redraw when animating // FIXME defer texture loads until after render when animating
// FIXME generational tile texture garbage collector newFrame/get // FIXME generational tile texture garbage collector newFrame/get
// FIXME defer cleanup until post-render // FIXME defer cleanup until post-render
// FIXME check against gl.getParameter(webgl.MAX_TEXTURE_SIZE) // FIXME check against gl.getParameter(webgl.MAX_TEXTURE_SIZE)
@@ -325,7 +325,7 @@ ol.webgl.Map.prototype.handleBackgroundColorChanged = function() {
backgroundColor.g / 255, backgroundColor.g / 255,
backgroundColor.b / 255, backgroundColor.b / 255,
backgroundColor.a / 255); backgroundColor.a / 255);
this.redraw(); this.render();
}; };
@@ -334,7 +334,7 @@ ol.webgl.Map.prototype.handleBackgroundColorChanged = function() {
*/ */
ol.webgl.Map.prototype.handleCenterChanged = function() { ol.webgl.Map.prototype.handleCenterChanged = function() {
goog.base(this, 'handleCenterChanged'); goog.base(this, 'handleCenterChanged');
this.redraw(); this.render();
}; };
@@ -344,7 +344,7 @@ ol.webgl.Map.prototype.handleCenterChanged = function() {
ol.webgl.Map.prototype.handleLayerAdd = function(layer) { ol.webgl.Map.prototype.handleLayerAdd = function(layer) {
goog.base(this, 'handleLayerAdd', layer); goog.base(this, 'handleLayerAdd', layer);
if (layer.getVisible()) { if (layer.getVisible()) {
this.redraw(); this.render();
} }
}; };
@@ -354,7 +354,7 @@ ol.webgl.Map.prototype.handleLayerAdd = function(layer) {
* @protected * @protected
*/ */
ol.webgl.Map.prototype.handleLayerRendererChange = function(event) { ol.webgl.Map.prototype.handleLayerRendererChange = function(event) {
this.redraw(); this.render();
}; };
@@ -364,7 +364,7 @@ ol.webgl.Map.prototype.handleLayerRendererChange = function(event) {
ol.webgl.Map.prototype.handleLayerRemove = function(layer) { ol.webgl.Map.prototype.handleLayerRemove = function(layer) {
goog.base(this, 'handleLayerRemove', layer); goog.base(this, 'handleLayerRemove', layer);
if (layer.getVisible()) { if (layer.getVisible()) {
this.redraw(); this.render();
} }
}; };
@@ -374,7 +374,7 @@ ol.webgl.Map.prototype.handleLayerRemove = function(layer) {
*/ */
ol.webgl.Map.prototype.handleResolutionChanged = function() { ol.webgl.Map.prototype.handleResolutionChanged = function() {
goog.base(this, 'handleResolutionChanged'); goog.base(this, 'handleResolutionChanged');
this.redraw(); this.render();
}; };
@@ -392,7 +392,7 @@ ol.webgl.Map.prototype.handleSizeChanged = function() {
var gl = this.gl_; var gl = this.gl_;
if (!goog.isNull(gl)) { if (!goog.isNull(gl)) {
gl.viewport(0, 0, size.width, size.height); gl.viewport(0, 0, size.width, size.height);
this.redraw(); this.render();
} }
}; };
@@ -424,14 +424,14 @@ ol.webgl.Map.prototype.handleWebGLContextRestored = function() {
gl.disable(goog.webgl.CULL_FACE); gl.disable(goog.webgl.CULL_FACE);
gl.disable(goog.webgl.DEPTH_TEST); gl.disable(goog.webgl.DEPTH_TEST);
gl.disable(goog.webgl.SCISSOR_TEST); gl.disable(goog.webgl.SCISSOR_TEST);
this.redraw(); this.render();
}; };
/** /**
* @inheritDoc * @inheritDoc
*/ */
ol.webgl.Map.prototype.redrawInternal = function() { ol.webgl.Map.prototype.renderInternal = function() {
var center = this.getCenter(); var center = this.getCenter();
var resolution = this.getResolution(); var resolution = this.getResolution();
@@ -440,7 +440,7 @@ ol.webgl.Map.prototype.redrawInternal = function() {
} }
var size = this.getSize(); var size = this.getSize();
var animate = goog.base(this, 'redrawInternal'); var animate = goog.base(this, 'renderInternal');
var gl = this.getGL(); var gl = this.getGL();

View File

@@ -266,7 +266,7 @@ ol.webgl.TileLayerRenderer.prototype.handleTileChange = function() {
/** /**
* @inheritDoc * @inheritDoc
*/ */
ol.webgl.TileLayerRenderer.prototype.redraw = function() { ol.webgl.TileLayerRenderer.prototype.render = function() {
var gl = this.getGL(); var gl = this.getGL();