Skip to content

Commit 08cfbf9

Browse files
authored
Merge pull request #9163 from CesiumGS/contrib-imagery-layers-change
Improve ImageryLayer.cancelReprojections() handling
2 parents bdb7934 + 3f81df1 commit 08cfbf9

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Fixed an issue where Plane doesn't rotate correctly around the main local axis. [#8268](https://github.com/CesiumGS/cesium/issues/8268)
1313
- Fixed clipping planes with non-uniform scale. [#9135](https://github.com/CesiumGS/cesium/pull/9135)
1414
- Fixed an issue where ground primitives would get clipped at certain camera angles. [#9114](https://github.com/CesiumGS/cesium/issues/9114)
15+
- Fixed a bug that could cause half of the globe to disappear when setting the `terrainProvider. [#9161](https://github.com/CesiumGS/cesium/pull/9161)
1516
- Fixed a crash when loading Cesium OSM buildings with shadows enabled. [#9172](https://github.com/CesiumGS/cesium/pull/9172)
1617

1718
### 1.73 - 2020-09-01

Source/Renderer/ComputeCommand.js

+8
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ function ComputeCommand(options) {
6969
*/
7070
this.postExecute = options.postExecute;
7171

72+
/**
73+
* Function that is called when the command is canceled
74+
*
75+
* @type {Function}
76+
* @default undefined
77+
*/
78+
this.canceled = options.canceled;
79+
7280
/**
7381
* Whether the renderer resources will persist beyond this call. If not, they
7482
* will be destroyed after completion.

Source/Scene/ImageryLayer.js

+9
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,10 @@ ImageryLayer.prototype._reprojectTexture = function (
12351235
imagery.state = ImageryState.READY;
12361236
imagery.releaseReference();
12371237
},
1238+
canceled: function () {
1239+
imagery.state = ImageryState.TEXTURE_LOADED;
1240+
imagery.releaseReference();
1241+
},
12381242
});
12391243
this._reprojectComputeCommands.push(computeCommand);
12401244
} else {
@@ -1268,6 +1272,11 @@ ImageryLayer.prototype.queueReprojectionCommands = function (frameState) {
12681272
* @private
12691273
*/
12701274
ImageryLayer.prototype.cancelReprojections = function () {
1275+
this._reprojectComputeCommands.forEach(function (command) {
1276+
if (defined(command.canceled)) {
1277+
command.canceled();
1278+
}
1279+
});
12711280
this._reprojectComputeCommands.length = 0;
12721281
};
12731282

0 commit comments

Comments
 (0)