summaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-01-09 13:05:13 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-01-10 10:15:22 -0800
commite7778509c546f4d1e0dd73e2d1deceb146c90de2 (patch)
treed8101c341d45a6a011cb37101f486814be7a6259 /test/src
parentea4c0b77c39926c770b0003097509e36dc26621d (diff)
downloadqtlocation-mapboxgl-e7778509c546f4d1e0dd73e2d1deceb146c90de2.tar.gz
[core] Fix flickering caused by regression in #7586
It should be safe to invoke GeometryTileWorker::setData multiple times without invoking GeometryTileWorker::setLayers. Therefore GeometryTileWorker::redoLayout() must not consume the layers.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/mbgl/test/stub_tile_observer.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/src/mbgl/test/stub_tile_observer.hpp b/test/src/mbgl/test/stub_tile_observer.hpp
new file mode 100644
index 0000000000..43ae4d8360
--- /dev/null
+++ b/test/src/mbgl/test/stub_tile_observer.hpp
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <mbgl/tile/tile_observer.hpp>
+
+using namespace mbgl;
+
+/**
+ * An implementation of TileObserver that forwards all methods to dynamically-settable lambas.
+ */
+class StubTileObserver : public TileObserver {
+public:
+ void onTileChanged(Tile& tile) override {
+ if (tileChanged) tileChanged(tile);
+ }
+
+ void onTileError(Tile& tile, std::exception_ptr error) override {
+ if (tileError) tileError(tile, error);
+ }
+
+ std::function<void (Tile&)> tileChanged;
+ std::function<void (Tile&, std::exception_ptr)> tileError;
+};