Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ImageryLayer.cancelReprojections() handling #9163

Merged
merged 4 commits into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Fixed an issue where Plane doesn't rotate correctly around the main local axis. [#8268](https://github.com/CesiumGS/cesium/issues/8268)
- Fixed clipping planes with non-uniform scale. [#9135](https://github.com/CesiumGS/cesium/pull/9135)
- Fixed an issue where ground primitives would get clipped at certain camera angles. [#9114](https://github.com/CesiumGS/cesium/issues/9114)
- Fixed a bug that could cause half of the globe to disappear when setting the `terrainProvider. [#9161](https://github.com/CesiumGS/cesium/pull/9161)
- Fixed a crash when loading Cesium OSM buildings with shadows enabled. [#9172](https://github.com/CesiumGS/cesium/pull/9172)

### 1.73 - 2020-09-01
Expand Down
8 changes: 8 additions & 0 deletions Source/Renderer/ComputeCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ function ComputeCommand(options) {
*/
this.postExecute = options.postExecute;

/**
* Function that is called when the command is canceled
*
* @type {Function}
* @default undefined
*/
this.canceled = options.canceled;

/**
* Whether the renderer resources will persist beyond this call. If not, they
* will be destroyed after completion.
Expand Down
9 changes: 9 additions & 0 deletions Source/Scene/ImageryLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,10 @@ ImageryLayer.prototype._reprojectTexture = function (
imagery.state = ImageryState.READY;
imagery.releaseReference();
},
canceled: function () {
imagery.state = ImageryState.TEXTURE_LOADED;
imagery.releaseReference();
},
});
this._reprojectComputeCommands.push(computeCommand);
} else {
Expand Down Expand Up @@ -1268,6 +1272,11 @@ ImageryLayer.prototype.queueReprojectionCommands = function (frameState) {
* @private
*/
ImageryLayer.prototype.cancelReprojections = function () {
this._reprojectComputeCommands.forEach(function (command) {
if (defined(command.canceled)) {
command.canceled();
}
});
this._reprojectComputeCommands.length = 0;
};

Expand Down