[core] Prepare style observer interfaces for source reloading
* Renamed {Source,Tile}Observer::onNeedsRepaint to onTileUpdated. Messages should be in terms of what happened to the observed object, not in terms of what the observer needs to do. This also removes a confusing overlap of virtual methods on StyleObserver.
* Added style::Observer::onUpdate(Update). This is also a violation of the above rule, but I'm hopeful that it will disappear when update batching is implemented.
This commit is contained in:
@@ -266,8 +266,8 @@ void Source::Impl::onTileError(Tile& tile, std::exception_ptr error) {
|
||||
observer->onTileError(base, tile.id, error);
|
||||
}
|
||||
|
||||
void Source::Impl::onNeedsRepaint() {
|
||||
observer->onNeedsRepaint();
|
||||
void Source::Impl::onTileUpdated(Tile& tile) {
|
||||
observer->onTileUpdated(base, tile.id);
|
||||
}
|
||||
|
||||
void Source::Impl::dumpDebugLogs() const {
|
||||
|
||||
Reference in New Issue
Block a user