diff options
author | Mike Morris <mikemorris@users.noreply.github.com> | 2016-08-12 10:31:02 -0400 |
---|---|---|
committer | Mike Morris <mikemorris@users.noreply.github.com> | 2016-08-26 10:55:42 -0400 |
commit | 3076b1dabbecbb19d5a054328419f84a65edafe2 (patch) | |
tree | 6e91d63b0a983fc54a8adb3d1b273fb9512c1a56 | |
parent | 1a65e9eb8cfb4ce39fb732e9321fc4f461852398 (diff) | |
download | qtlocation-mapboxgl-3076b1dabbecbb19d5a054328419f84a65edafe2.tar.gz |
[node] add logging for MapMode::Still partial tiles
-rw-r--r-- | src/mbgl/map/map.cpp | 15 | ||||
-rw-r--r-- | src/mbgl/style/style.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/tile/geometry_tile.cpp | 14 | ||||
-rw-r--r-- | src/mbgl/tile/tile.cpp | 1 |
4 files changed, 32 insertions, 0 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index eab4c77e2e..8521d828cf 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -201,6 +201,8 @@ void Map::Impl::update() { } if (updateFlags == Update::Nothing || (mode == MapMode::Still && !callback)) { + if (updateFlags == Update::Nothing) Log::Info(Event::General, "[Map::Impl::update] Update::Nothing"); + if (mode == MapMode::Still && !callback) Log::Info(Event::General, "[Map::Impl::update] Missing callback, return early"); return; } @@ -243,9 +245,19 @@ void Map::Impl::update() { view.invalidate(); } else if (callback && style->isLoaded()) { util::stopwatch stopwatch2("render", Event::General); + Log::Info(Event::General, "[Map::Impl::update] Activating view and rendering"); view.activate(); render(); view.deactivate(); + } else { + // Is this redundant with the early return above? + if (!callback) { + Log::Info(Event::General, "[Map::Impl::update] Missing callback"); + } + + if (!style->isLoaded()) { + Log::Info(Event::General, "[Map::Impl::update] Style not finished loading"); + } } updateFlags = Update::Nothing; @@ -268,6 +280,7 @@ void Map::Impl::render() { annotationManager->getSpriteAtlas()); if (mode == MapMode::Still) { + Log::Info(Event::General, "[Map::Impl::render] Pass view.readStillImage() to callback"); callback(nullptr, view.readStillImage()); callback = nullptr; } @@ -918,6 +931,8 @@ void Map::Impl::onStyleError() { } void Map::Impl::onResourceError(std::exception_ptr error) { + Log::Info(Event::General, "[Map::Impl::onResourceError]"); + if (mode == MapMode::Still && callback) { callback(error, {}); callback = nullptr; diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index e04384a96e..2275705b6e 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -202,6 +202,7 @@ void Style::update(const UpdateParameters& parameters) { for (const auto& source : sources) { if (!source->baseImpl->update(parameters)) { + Log::Info(Event::General, "[Style::update] Tiles not complete"); allTilesUpdated = false; } } @@ -209,6 +210,7 @@ void Style::update(const UpdateParameters& parameters) { // We can only stop updating "partial" tiles when all of them // were notified of the arrival of the new resources. if (allTilesUpdated) { + Log::Info(Event::General, "[Style::update] All tiles updated"); shouldReparsePartialTiles = false; } } diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp index daa358420b..0108dd34f7 100644 --- a/src/mbgl/tile/geometry_tile.cpp +++ b/src/mbgl/tile/geometry_tile.cpp @@ -11,6 +11,7 @@ #include <mbgl/geometry/feature_index.hpp> #include <mbgl/text/collision_tile.hpp> #include <mbgl/map/transform_state.hpp> +#include <mbgl/platform/log.hpp> namespace mbgl { @@ -62,6 +63,8 @@ std::vector<std::unique_ptr<Layer>> GeometryTile::cloneStyleLayers() const { void GeometryTile::setData(std::unique_ptr<GeometryTileData> data_) { if (!data_) { + Log::Info(Event::General, "[GeometryTile::setData] This is a 404 response. We're treating these as empty tiles."); + // This is a 404 response. We're treating these as empty tiles. workRequest.reset(); availableData = DataAvailability::All; @@ -74,6 +77,7 @@ void GeometryTile::setData(std::unique_ptr<GeometryTileData> data_) { // Mark the tile as pending again if it was complete before to prevent signaling a complete // state despite pending parse operations. if (availableData == DataAvailability::All) { + Log::Info(Event::General, "[GeometryTile::setData] Mark the tile as pending again"); availableData = DataAvailability::Some; } @@ -88,6 +92,10 @@ void GeometryTile::setData(std::unique_ptr<GeometryTileData> data_) { auto& resultBuckets = result.get<TileParseResultData>(); availableData = resultBuckets.complete ? DataAvailability::All : DataAvailability::Some; + if (availableData == DataAvailability::Some) { + Log::Info(Event::General, "[GeometryTile::setData] DataAvailability::Some"); + } + // Persist the configuration we just placed so that we can later check whether we need to // place again in case the configuration has changed. placedConfig = config; @@ -97,6 +105,7 @@ void GeometryTile::setData(std::unique_ptr<GeometryTileData> data_) { buckets = std::move(resultBuckets.buckets); if (isComplete()) { + Log::Info(Event::General, "[GeometryTile::setData] isComplete() after moving over buckets from this parse request"); featureIndex = std::move(resultBuckets.featureIndex); data = std::move(resultBuckets.tileData); } @@ -104,6 +113,7 @@ void GeometryTile::setData(std::unique_ptr<GeometryTileData> data_) { redoPlacement(); observer->onTileLoaded(*this, true); } else { + Log::Info(Event::General, "[GeometryTile::setData] DataAvailability::All"); availableData = DataAvailability::All; observer->onTileError(*this, result.get<std::exception_ptr>()); } @@ -124,6 +134,10 @@ bool GeometryTile::parsePending() { auto& resultBuckets = result.get<TileParseResultData>(); availableData = resultBuckets.complete ? DataAvailability::All : DataAvailability::Some; + if (availableData == DataAvailability::Some) { + Log::Info(Event::General, "[GeometryTile::parsePending] DataAvailability::Some"); + } + // Move over all buckets we received in this parse request, potentially overwriting // existing buckets in case we got a refresh parse. for (auto& bucket : resultBuckets.buckets) { diff --git a/src/mbgl/tile/tile.cpp b/src/mbgl/tile/tile.cpp index 6595c314ee..08c488ac52 100644 --- a/src/mbgl/tile/tile.cpp +++ b/src/mbgl/tile/tile.cpp @@ -25,6 +25,7 @@ void Tile::dumpDebugLogs() const { Log::Info(Event::General, "Tile::id: %s", util::toString(id).c_str()); Log::Info(Event::General, "Tile::renderable: %s", isRenderable() ? "yes" : "no"); Log::Info(Event::General, "Tile::complete: %s", isComplete() ? "yes" : "no"); + Log::Info(Event::General, "Tile::incomplete: %s", isIncomplete() ? "yes" : "no"); } void Tile::queryRenderedFeatures( |