diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-08-29 12:52:49 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-09-06 12:52:14 -0700 |
commit | 3635b9f1476ffd5d8f38a7abdf5742faef012850 (patch) | |
tree | e1ec24db4a0b90e7eb0c23768312183d1a2a526d /src/mbgl/style/observer.hpp | |
parent | 5b4f6335e384169bcd88633e38d59a500319a47b (diff) | |
download | qtlocation-mapboxgl-3635b9f1476ffd5d8f38a7abdf5742faef012850.tar.gz |
[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.
Diffstat (limited to 'src/mbgl/style/observer.hpp')
-rw-r--r-- | src/mbgl/style/observer.hpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/mbgl/style/observer.hpp b/src/mbgl/style/observer.hpp index c4d31ae249..41b1b46da7 100644 --- a/src/mbgl/style/observer.hpp +++ b/src/mbgl/style/observer.hpp @@ -3,6 +3,7 @@ #include <mbgl/text/glyph_store_observer.hpp> #include <mbgl/sprite/sprite_store_observer.hpp> #include <mbgl/style/source_observer.hpp> +#include <mbgl/map/update.hpp> namespace mbgl { namespace style { @@ -11,13 +12,7 @@ class Observer : public GlyphStoreObserver, public SpriteStoreObserver, public SourceObserver { public: - /** - * In addition to the individual glyph, sprite, and source events, the - * following "rollup" events are provided for convenience. They are - * strictly additive; e.g. when a source is loaded, both `onSourceLoaded` - * and `onNeedsRepaint` will be called. - */ - void onNeedsRepaint() override {} + virtual void onUpdate(Update) {} virtual void onStyleError() {} virtual void onResourceError(std::exception_ptr) {} }; |