-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
3D Tiles cache management #3808
Merged
Merged
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
078e88a
Added number of ready tiles to stats
pjcozzi af7b359
Add total tiles debug stat
pjcozzi 6dfa3bb
Separate color and pick stats
pjcozzi 47deee4
Merge remote-tracking branch 'origin/3d-tiles' into 3d-tiles-cache
pjcozzi cd4cca6
Fix test
pjcozzi 6c10764
Fix Cesium3DTileBatchTableResources tests
pjcozzi 831ae5e
Add missing interface function
pjcozzi cb6719c
Add doubly linked list
pjcozzi 8c47fe0
Remove fdefineSuite
pjcozzi 1fd0a2a
Start of cache replacement for 3D Tiles
pjcozzi aa439c1
Added trimLoadedTiles
pjcozzi 00ebcfb
Updated Sandcastle app
pjcozzi 6b648ca
Remove unused lastTouchedFrameNumber
pjcozzi 8c07268
Merge remote-tracking branch 'origin/3d-tiles' into 3d-tiles-cache
pjcozzi 2520cdc
Fix JSHint warnings
pjcozzi 78579d9
Add reference doc
pjcozzi 3d24ecf
Add tileUnload event
pjcozzi 4f352cf
Update Sandcastle example
pjcozzi befe171
Added cache replacement tests
pjcozzi 98e50d4
Fix tests when all tests are ran
pjcozzi 71fa03f
Remove TODOs that are now part of the roadmap
pjcozzi 9d942a4
Small tweaks
lilleyse de9b45a
Changes based on review
pjcozzi 515f3bd
Updates based on review
pjcozzi File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/*global define*/ | ||
define([ | ||
'../Core/defined', | ||
'../Core/defineProperties', | ||
'../Core/DeveloperError' | ||
], function( | ||
defined, | ||
defineProperties, | ||
DeveloperError) { | ||
'use strict'; | ||
|
||
/** | ||
* @private | ||
*/ | ||
function DoublyLinkedList() { | ||
this.head = undefined; | ||
this.tail = undefined; | ||
this._length = 0; | ||
} | ||
|
||
defineProperties(DoublyLinkedList.prototype, { | ||
length : { | ||
get : function() { | ||
return this._length; | ||
} | ||
} | ||
}); | ||
|
||
function DoublyLinkedListNode(item, previous, next) { | ||
this.item = item; | ||
this.previous = previous; | ||
this.next = next; | ||
} | ||
|
||
DoublyLinkedList.prototype.add = function(item) { | ||
var node = new DoublyLinkedListNode(item, this.tail, undefined); | ||
|
||
if (defined(this.tail)) { | ||
this.tail.next = node; | ||
this.tail = node; | ||
} else { | ||
// Insert into empty linked list | ||
this.head = node; | ||
this.tail = node; | ||
} | ||
|
||
++this._length; | ||
|
||
return node; | ||
}; | ||
|
||
function remove(list, node) { | ||
if (defined(node.previous) && defined(node.next)) { | ||
node.previous.next = node.next; | ||
node.next.previous = node.previous; | ||
} else if (defined(node.previous)) { | ||
// Remove last node | ||
node.previous.next = undefined; | ||
list.tail = node.previous; | ||
} else if (defined(node.next)) { | ||
// Remove first node | ||
node.next.previous = undefined; | ||
list.head = node.next; | ||
} else { | ||
// Remove last node in the linked list | ||
list.head = undefined; | ||
list.tail = undefined; | ||
} | ||
|
||
node.next = undefined; | ||
node.previous = undefined; | ||
} | ||
|
||
DoublyLinkedList.prototype.remove = function(node) { | ||
if (!defined(node)) { | ||
return; | ||
} | ||
|
||
remove(this, node); | ||
|
||
--this._length; | ||
}; | ||
|
||
DoublyLinkedList.prototype.splice = function(node, nextNode) { | ||
if (!defined(node) || !defined(nextNode)) { | ||
throw new DeveloperError('node and nextNode are required.'); | ||
} | ||
|
||
if (node === nextNode) { | ||
return; | ||
} | ||
|
||
// Remove nextNode, then insert after node | ||
remove(this, nextNode); | ||
|
||
var oldNodeNext = node.next; | ||
node.next = nextNode; | ||
|
||
// nextNode is the new tail | ||
if (this.tail === node) { | ||
this.tail = nextNode; | ||
} else { | ||
oldNodeNext.previous = nextNode; | ||
} | ||
|
||
nextNode.next = oldNodeNext; | ||
nextNode.previous = node; | ||
}; | ||
|
||
return DoublyLinkedList; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DoublyLinkedListNode