diff --git a/src/ol/render/webgl/CircleReplay.js b/src/ol/render/webgl/CircleReplay.js index 3b976e5bb0..a5831991ef 100644 --- a/src/ol/render/webgl/CircleReplay.js +++ b/src/ol/render/webgl/CircleReplay.js @@ -21,7 +21,7 @@ import _ol_webgl_Buffer_ from '../../webgl/Buffer.js'; * @param {ol.Extent} maxExtent Max extent. * @struct */ -const _ol_render_webgl_CircleReplay_ = function(tolerance, maxExtent) { +const WebGLCircleReplay = function(tolerance, maxExtent) { _ol_render_webgl_Replay_.call(this, tolerance, maxExtent); /** @@ -68,7 +68,7 @@ const _ol_render_webgl_CircleReplay_ = function(tolerance, maxExtent) { }; -inherits(_ol_render_webgl_CircleReplay_, _ol_render_webgl_Replay_); +inherits(WebGLCircleReplay, _ol_render_webgl_Replay_); /** @@ -78,7 +78,7 @@ inherits(_ol_render_webgl_CircleReplay_, _ol_render_webgl_Replay_); * @param {number} end End. * @param {number} stride Stride. */ -_ol_render_webgl_CircleReplay_.prototype.drawCoordinates_ = function( +WebGLCircleReplay.prototype.drawCoordinates_ = function( flatCoordinates, offset, end, stride) { let numVertices = this.vertices.length; let numIndices = this.indices.length; @@ -121,7 +121,7 @@ _ol_render_webgl_CircleReplay_.prototype.drawCoordinates_ = function( /** * @inheritDoc */ -_ol_render_webgl_CircleReplay_.prototype.drawCircle = function(circleGeometry, feature) { +WebGLCircleReplay.prototype.drawCircle = function(circleGeometry, feature) { const radius = circleGeometry.getRadius(); const stride = circleGeometry.getStride(); if (radius) { @@ -155,7 +155,7 @@ _ol_render_webgl_CircleReplay_.prototype.drawCircle = function(circleGeometry, f /** * @inheritDoc **/ -_ol_render_webgl_CircleReplay_.prototype.finish = function(context) { +WebGLCircleReplay.prototype.finish = function(context) { // create, bind, and populate the vertices buffer this.verticesBuffer = new _ol_webgl_Buffer_(this.vertices); @@ -177,7 +177,7 @@ _ol_render_webgl_CircleReplay_.prototype.finish = function(context) { /** * @inheritDoc */ -_ol_render_webgl_CircleReplay_.prototype.getDeleteResourcesFunction = function(context) { +WebGLCircleReplay.prototype.getDeleteResourcesFunction = function(context) { // We only delete our stuff here. The shaders and the program may // be used by other CircleReplay instances (for other layers). And // they will be deleted when disposing of the ol.webgl.Context @@ -194,7 +194,7 @@ _ol_render_webgl_CircleReplay_.prototype.getDeleteResourcesFunction = function(c /** * @inheritDoc */ -_ol_render_webgl_CircleReplay_.prototype.setUpProgram = function(gl, context, size, pixelRatio) { +WebGLCircleReplay.prototype.setUpProgram = function(gl, context, size, pixelRatio) { // get the program const fragmentShader = _ol_render_webgl_circlereplay_defaultshader_.fragment; const vertexShader = _ol_render_webgl_circlereplay_defaultshader_.vertex; @@ -235,7 +235,7 @@ _ol_render_webgl_CircleReplay_.prototype.setUpProgram = function(gl, context, si /** * @inheritDoc */ -_ol_render_webgl_CircleReplay_.prototype.shutDownProgram = function(gl, locations) { +WebGLCircleReplay.prototype.shutDownProgram = function(gl, locations) { gl.disableVertexAttribArray(locations.a_position); gl.disableVertexAttribArray(locations.a_instruction); gl.disableVertexAttribArray(locations.a_radius); @@ -245,7 +245,7 @@ _ol_render_webgl_CircleReplay_.prototype.shutDownProgram = function(gl, location /** * @inheritDoc */ -_ol_render_webgl_CircleReplay_.prototype.drawReplay = function(gl, context, skippedFeaturesHash, hitDetection) { +WebGLCircleReplay.prototype.drawReplay = function(gl, context, skippedFeaturesHash, hitDetection) { if (!_ol_obj_.isEmpty(skippedFeaturesHash)) { this.drawReplaySkipping_(gl, context, skippedFeaturesHash); } else { @@ -268,7 +268,7 @@ _ol_render_webgl_CircleReplay_.prototype.drawReplay = function(gl, context, skip /** * @inheritDoc */ -_ol_render_webgl_CircleReplay_.prototype.drawHitDetectionReplayOneByOne = function(gl, context, skippedFeaturesHash, +WebGLCircleReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, context, skippedFeaturesHash, featureCallback, opt_hitExtent) { let i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex; featureIndex = this.startIndices.length - 2; @@ -315,7 +315,7 @@ _ol_render_webgl_CircleReplay_.prototype.drawHitDetectionReplayOneByOne = functi * @param {ol.webgl.Context} context Context. * @param {Object} skippedFeaturesHash Ids of features to skip. */ -_ol_render_webgl_CircleReplay_.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) { +WebGLCircleReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) { let i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex, featureStart; featureIndex = this.startIndices.length - 2; end = start = this.startIndices[featureIndex + 1]; @@ -354,7 +354,7 @@ _ol_render_webgl_CircleReplay_.prototype.drawReplaySkipping_ = function(gl, cont * @param {WebGLRenderingContext} gl gl. * @param {Array.} color Color. */ -_ol_render_webgl_CircleReplay_.prototype.setFillStyle_ = function(gl, color) { +WebGLCircleReplay.prototype.setFillStyle_ = function(gl, color) { gl.uniform4fv(this.defaultLocations_.u_fillColor, color); }; @@ -365,7 +365,7 @@ _ol_render_webgl_CircleReplay_.prototype.setFillStyle_ = function(gl, color) { * @param {Array.} color Color. * @param {number} lineWidth Line width. */ -_ol_render_webgl_CircleReplay_.prototype.setStrokeStyle_ = function(gl, color, lineWidth) { +WebGLCircleReplay.prototype.setStrokeStyle_ = function(gl, color, lineWidth) { gl.uniform4fv(this.defaultLocations_.u_strokeColor, color); gl.uniform1f(this.defaultLocations_.u_lineWidth, lineWidth); }; @@ -374,7 +374,7 @@ _ol_render_webgl_CircleReplay_.prototype.setStrokeStyle_ = function(gl, color, l /** * @inheritDoc */ -_ol_render_webgl_CircleReplay_.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { +WebGLCircleReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { let strokeStyleColor, strokeStyleWidth; if (strokeStyle) { const strokeStyleLineDash = strokeStyle.getLineDash(); @@ -418,4 +418,4 @@ _ol_render_webgl_CircleReplay_.prototype.setFillStrokeStyle = function(fillStyle this.styles_.push([fillStyleColor, strokeStyleColor, strokeStyleWidth]); } }; -export default _ol_render_webgl_CircleReplay_; +export default WebGLCircleReplay; diff --git a/src/ol/render/webgl/ReplayGroup.js b/src/ol/render/webgl/ReplayGroup.js index c4d25830c1..77ecf1d633 100644 --- a/src/ol/render/webgl/ReplayGroup.js +++ b/src/ol/render/webgl/ReplayGroup.js @@ -7,7 +7,7 @@ import {buffer, createOrUpdateFromCoordinate} from '../../extent.js'; import _ol_obj_ from '../../obj.js'; import _ol_render_replay_ from '../replay.js'; import ReplayGroup from '../ReplayGroup.js'; -import _ol_render_webgl_CircleReplay_ from '../webgl/CircleReplay.js'; +import WebGLCircleReplay from '../webgl/CircleReplay.js'; import _ol_render_webgl_ImageReplay_ from '../webgl/ImageReplay.js'; import _ol_render_webgl_LineStringReplay_ from '../webgl/LineStringReplay.js'; import _ol_render_webgl_PolygonReplay_ from '../webgl/PolygonReplay.js'; @@ -317,7 +317,7 @@ WebGLReplayGroup.HIT_DETECTION_SIZE_ = [1, 1]; * ol.Extent)>} */ WebGLReplayGroup.BATCH_CONSTRUCTORS_ = { - 'Circle': _ol_render_webgl_CircleReplay_, + 'Circle': WebGLCircleReplay, 'Image': _ol_render_webgl_ImageReplay_, 'LineString': _ol_render_webgl_LineStringReplay_, 'Polygon': _ol_render_webgl_PolygonReplay_, diff --git a/test/spec/ol/render/webgl/circlereplay.test.js b/test/spec/ol/render/webgl/circlereplay.test.js index 60d9311d9c..5c9d8ae884 100644 --- a/test/spec/ol/render/webgl/circlereplay.test.js +++ b/test/spec/ol/render/webgl/circlereplay.test.js @@ -1,7 +1,7 @@ import {getUid} from '../../../../../src/ol/index.js'; import Feature from '../../../../../src/ol/Feature.js'; import Circle from '../../../../../src/ol/geom/Circle.js'; -import _ol_render_webgl_CircleReplay_ from '../../../../../src/ol/render/webgl/CircleReplay.js'; +import WebGLCircleReplay from '../../../../../src/ol/render/webgl/CircleReplay.js'; import _ol_render_webgl_circlereplay_defaultshader_ from '../../../../../src/ol/render/webgl/circlereplay/defaultshader.js'; import _ol_render_webgl_circlereplay_defaultshader_Locations_ from '../../../../../src/ol/render/webgl/circlereplay/defaultshader/Locations.js'; import Fill from '../../../../../src/ol/style/Fill.js'; @@ -21,7 +21,7 @@ describe('ol.render.webgl.CircleReplay', function() { beforeEach(function() { const tolerance = 0.1; const maxExtent = [-10000, -20000, 10000, 20000]; - replay = new _ol_render_webgl_CircleReplay_(tolerance, maxExtent); + replay = new WebGLCircleReplay(tolerance, maxExtent); }); describe('#setFillStrokeStyle', function() { diff --git a/test/spec/ol/render/webgl/immediate.test.js b/test/spec/ol/render/webgl/immediate.test.js index 435988bb31..4519c10d16 100644 --- a/test/spec/ol/render/webgl/immediate.test.js +++ b/test/spec/ol/render/webgl/immediate.test.js @@ -7,7 +7,7 @@ import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js'; import MultiPolygon from '../../../../../src/ol/geom/MultiPolygon.js'; import Point from '../../../../../src/ol/geom/Point.js'; import Polygon from '../../../../../src/ol/geom/Polygon.js'; -import _ol_render_webgl_CircleReplay_ from '../../../../../src/ol/render/webgl/CircleReplay.js'; +import WebGLCircleReplay from '../../../../../src/ol/render/webgl/CircleReplay.js'; import _ol_render_webgl_ImageReplay_ from '../../../../../src/ol/render/webgl/ImageReplay.js'; import _ol_render_webgl_Immediate_ from '../../../../../src/ol/render/webgl/Immediate.js'; import _ol_render_webgl_LineStringReplay_ from '../../../../../src/ol/render/webgl/LineStringReplay.js'; @@ -252,20 +252,20 @@ describe('ol.render.webgl.Immediate', function() { describe('#drawCircle', function() { let tmpObj; beforeEach(function() { - tmpObj = mock(_ol_render_webgl_CircleReplay_, 'drawCircle'); + tmpObj = mock(WebGLCircleReplay, 'drawCircle'); }); it('draws a circle', function() { context.drawGeometry(circle); - expect(_ol_render_webgl_CircleReplay_.prototype.setFillStrokeStyle.calledOnce).to.be(true); - expect(_ol_render_webgl_CircleReplay_.prototype.drawCircle.calledOnce).to.be(true); - expect(_ol_render_webgl_CircleReplay_.prototype.finish.calledOnce).to.be(true); - expect(_ol_render_webgl_CircleReplay_.prototype.replay.calledOnce).to.be(true); - expect(_ol_render_webgl_CircleReplay_.prototype.getDeleteResourcesFunction.calledOnce).to.be(true); + expect(WebGLCircleReplay.prototype.setFillStrokeStyle.calledOnce).to.be(true); + expect(WebGLCircleReplay.prototype.drawCircle.calledOnce).to.be(true); + expect(WebGLCircleReplay.prototype.finish.calledOnce).to.be(true); + expect(WebGLCircleReplay.prototype.replay.calledOnce).to.be(true); + expect(WebGLCircleReplay.prototype.getDeleteResourcesFunction.calledOnce).to.be(true); }); after(function() { - restore(_ol_render_webgl_CircleReplay_, tmpObj); + restore(WebGLCircleReplay, tmpObj); }); }); });