summaryrefslogtreecommitdiff
path: root/test/src/mbgl
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-08-29 12:52:49 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-09-06 12:52:14 -0700
commit3635b9f1476ffd5d8f38a7abdf5742faef012850 (patch)
treee1ec24db4a0b90e7eb0c23768312183d1a2a526d /test/src/mbgl
parent5b4f6335e384169bcd88633e38d59a500319a47b (diff)
downloadqtlocation-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 'test/src/mbgl')
-rw-r--r--test/src/mbgl/test/stub_style_observer.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/src/mbgl/test/stub_style_observer.hpp b/test/src/mbgl/test/stub_style_observer.hpp
index ae0a23f0aa..879b06d6b8 100644
--- a/test/src/mbgl/test/stub_style_observer.hpp
+++ b/test/src/mbgl/test/stub_style_observer.hpp
@@ -43,8 +43,8 @@ public:
if (tileError) tileError(source, tileID, error);
}
- void onNeedsRepaint() override {
- if (needsRepaint) needsRepaint();
+ void onTileUpdated(Source& source, const OverscaledTileID& tileID) override {
+ if (tileUpdated) tileUpdated(source, tileID);
};
void onResourceError(std::exception_ptr error) override {
@@ -59,6 +59,6 @@ public:
std::function<void (Source&, std::exception_ptr)> sourceError;
std::function<void (Source&, const OverscaledTileID&, bool isNewTile)> tileLoaded;
std::function<void (Source&, const OverscaledTileID&, std::exception_ptr)> tileError;
- std::function<void ()> needsRepaint;
+ std::function<void (Source&, const OverscaledTileID&)> tileUpdated;
std::function<void (std::exception_ptr)> resourceError;
};