[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:
John Firebaugh
2016-08-29 12:52:49 -07:00
parent 5b4f6335e3
commit 3635b9f147
11 changed files with 28 additions and 33 deletions

View File

@@ -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 {