diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-01-09 13:05:13 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-01-10 10:15:22 -0800 |
commit | e7778509c546f4d1e0dd73e2d1deceb146c90de2 (patch) | |
tree | d8101c341d45a6a011cb37101f486814be7a6259 /test/src | |
parent | ea4c0b77c39926c770b0003097509e36dc26621d (diff) | |
download | qtlocation-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.hpp | 22 |
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; +}; |