-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Flickering when crossing international date line #7040
Conversation
@kkaefer, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jfirebaugh, @brunoabinader and @1ec5 to be potential reviewers. |
What's happening here is the following: We use the concept of "unwrapped" tiles. Those are tile IDs that have an additional "wrap" component that indicates the offset of the pyramid, e.g. in the situation above, we are rendering the tile
|
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.
Neat :)
} | ||
|
||
void Map::triggerRepaint() { | ||
impl->backend.invalidate(); | ||
} | ||
|
||
void Map::Impl::update() { | ||
bool Map::Impl::updateState() { |
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.
The return value doesn't seem to be used.
This seems like it's changing some pretty fundamental parts of the render loop. What kind of testing have you done? |
befcd79
to
a7272e5
Compare
@kkaefer asked me to list some more specific concerns:
|
It looks like the main substance of the change here is to move the majority of Here are two alternate options that seem better to me:
Did you try either of these approaches, or see any obvious issues with them that I'm missing? |
I've tried your second suggestion, and now remembered that I had tried it but discarded: It works well on iOS + macOS, since something in its UI logic seems to guarantee that all user interactions (like panning) are dispatched into state transform calls on the map object (e.g. However, when adding logging to This means the only safe way of how this could work is the first alternative: completely abandon the concept of "updates without render". The separation of The other case where this was used is for static rendering: Whenever you change something about a map object, we do an |
I've tried implementing the first suggestion as well, but contrary to what I wrote in my previous comment, I don't think it's viable either: While it works perfectly fine for continuous rendering (iOS/Android), it doesn't work for static map rendering: Another alternative to calling |
An alternative fix is in https://github.com/mapbox/mapbox-gl-native/compare/7040-dateline-flickering-alternative. It moves transition updates to |
Yeah, if the SDK code interleaves state updates in between The first option, doing all updates immediate prior to rendering the frame, with no opportunity for the SDK to interleave state changes, is definitely the safest and easiest to reason about. It seems like it could be made to work for static rendering: wire |
Prototype looks good! One minor drawback I'm seeing is that our typical static workflow of "update all transform state, then call |
Yeah, probably we should have an |
I tested it and it seems that we've been calling |
Replaced by #7574. |
When panning the map across the international date line that map tiles seem to flicker:
cc: @kkaefer