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

Fix crash with switching terrain provider and picking #6918

Merged
merged 3 commits into from
Aug 14, 2018
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 @@ -23,6 +23,7 @@ Change Log
* Improved `Plane` entities so they are better aligned with the globe surface [#6887](https://github.com/AnalyticalGraphicsInc/cesium/pull/6887)
* Fixed crash when rendering translucent objects when all shadow maps in the scene set `fromLightSource` to false. [#6883](https://github.com/AnalyticalGraphicsInc/cesium/pull/6883)
* Fixed night shading in 2D and Columbus view. [#4122](https://github.com/AnalyticalGraphicsInc/cesium/issues/4122)
* Fixed crash that happened when calling `scene.pick` after setting a new terrain provider [#6918](https://github.com/AnalyticalGraphicsInc/cesium/pull/6918)

### 1.48 - 2018-08-01

Expand Down
11 changes: 5 additions & 6 deletions Source/Scene/QuadtreePrimitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ define([
return;
}

if (this._tilesInvalidated) {
invalidateAllTiles(this);
this._tilesInvalidated = false;
}

// Gets commands for any texture re-projections
this._tileProvider.initialize(frameState);

Expand Down Expand Up @@ -376,16 +381,10 @@ define([
return;
}

if (this._tilesInvalidated) {
invalidateAllTiles(this);
}

// Load/create resources for terrain and imagery. Prepare texture re-projections for the next frame.
processTileLoadQueue(this, frameState);
updateHeights(this, frameState);
updateTileLoadProgress(this, frameState);

this._tilesInvalidated = false;
};

/**
Expand Down
4 changes: 3 additions & 1 deletion Specs/Scene/GlobeSurfaceTileProviderSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,12 +674,14 @@ defineSuite([
var surface = scene.globe._surface;
var replacementQueue = surface._tileReplacementQueue;
expect(replacementQueue.count).toBeGreaterThan(0);
var oldTile = replacementQueue.head;

surface.tileProvider.terrainProvider = new EllipsoidTerrainProvider();

scene.renderForSpecs();

expect(replacementQueue.count).toBe(0);
expect(replacementQueue.count).toBeGreaterThan(0);
expect(replacementQueue.head).not.toBe(oldTile);
});
});

Expand Down