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

Call QuadtreePrimitive.tileLoadProgressEvent after rendering frame state #5161

Merged
merged 5 commits into from
Mar 30, 2017
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 @@ -30,6 +30,7 @@ Change Log
* Fix billboard, point and label clustering in 2D and Columbus view. [#5136](https://github.com/AnalyticalGraphicsInc/cesium/pull/5136)
* Fixed issues with imagerySplitPosition and the international date line in 2D mode. [#5151](https://github.com/AnalyticalGraphicsInc/cesium/pull/5151)
* Fixed an issue with `TileBoundingBox` that caused the terrain to disappear in certain places [4032](https://github.com/AnalyticalGraphicsInc/cesium/issues/4032)
* `QuadtreePrimitive` now uses `frameState.afterRender` to fire `tileLoadProgressEvent` [#3450](https://github.com/AnalyticalGraphicsInc/cesium/issues/3450)

### 1.31 - 2017-03-01

Expand Down
8 changes: 7 additions & 1 deletion Source/Scene/QuadtreePrimitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,13 @@ define([
}
}

raiseTileLoadProgressEvent(primitive);
frameState.afterRender.push(createTileProgressFunction(primitive));
}

function createTileProgressFunction(primitive) {
return function() {
raiseTileLoadProgressEvent(primitive);
};
}

function visitTile(primitive, frameState, tile) {
Expand Down
10 changes: 8 additions & 2 deletions Specs/Scene/QuadtreePrimitiveSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ defineSuite([
quadtree.update(scene.frameState);
quadtree.endFrame(scene.frameState);

scene.renderForSpecs();

// There will now be two zero-level tiles in the load queue.
expect(progressEventSpy.calls.mostRecent().args[0]).toEqual(2);

Expand All @@ -189,6 +191,8 @@ defineSuite([
quadtree.update(scene.frameState);
quadtree.endFrame(scene.frameState);

scene.renderForSpecs();

// Now there should only be one left in the update queue
expect(progressEventSpy.calls.mostRecent().args[0]).toEqual(1);

Expand All @@ -199,6 +203,8 @@ defineSuite([
quadtree.update(scene.frameState);
quadtree.endFrame(scene.frameState);

scene.renderForSpecs();

// Now that tile's four children should be in the load queue.
expect(progressEventSpy.calls.mostRecent().args[0]).toEqual(4);
});
Expand Down Expand Up @@ -372,7 +378,7 @@ defineSuite([
expect(quadtree._tileLoadQueueHigh).toContain(quadtree._levelZeroTiles[1]);
expect(quadtree._tileLoadQueueMedium.length).toBe(0);
expect(quadtree._tileLoadQueueLow.length).toBe(0);

// Mark the first root tile renderable (but not done loading)
quadtree._levelZeroTiles[0].renderable = true;

Expand Down Expand Up @@ -420,7 +426,7 @@ defineSuite([
quadtree._levelZeroTiles[0].children[1].upsampledFromParent = true;
quadtree._levelZeroTiles[0].children[2].upsampledFromParent = true;
quadtree._levelZeroTiles[0].children[3].upsampledFromParent = true;

quadtree.beginFrame(scene.frameState);
quadtree.update(scene.frameState);
quadtree.endFrame(scene.frameState);
Expand Down