Fix empty traversal for mixed empty and non-empty tiles #11611
Closed
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.
Fixes #9356
This PR fixes a bug in empty tile traversal code where sometimes a parent tile wouldn't refine if one of its children is a long chain of empty tiles followed by a tile with content. The old logic would assume the parent shouldn't refine because there was a renderable descendant, and refining would create a hole. However, some cases (like in #9356 and #11564) actually require the hole to render properly.
I went through and redid the logic of that function, and was able to simplify and document it so it's easier to follow.
The biggest difference is that now only tiles that would be rendered for the current camera view are examined, before it would traverse deeper in the tree if there are a lot of empty tiles.
@jjhembd could you review?
CC @lilleyse