summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuha Alanen <juha.alanen@mapbox.com>2019-10-16 10:50:06 +0300
committerJuha Alanen <juha.alanen@mapbox.com>2019-10-21 16:27:45 +0300
commit096b424022e9074aa513266c9107f2d7d8f763e0 (patch)
treed1b3edbea5cc27c45ea8fc2c8d0679bb403d79d6
parentbb21217ed3f5ce80c677208f2f90e15a2f188a9b (diff)
downloadqtlocation-mapboxgl-upstream/jmalanen-event.tar.gz
[glfw] Handle eventsupstream/jmalanen-event
-rw-r--r--platform/glfw/glfw_view.cpp25
-rw-r--r--platform/glfw/glfw_view.hpp5
2 files changed, 30 insertions, 0 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index c39b2c904a..88f8f82cbd 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -811,3 +811,28 @@ void GLFWView::toggleCustomSource() {
mbgl::style::VisibilityType::None : mbgl::style::VisibilityType::Visible);
}
}
+
+void GLFWView::onDidFinishRenderingMap(mbgl::MapObserver::RenderMode mode) {
+ if (mode == mbgl::MapObserver::RenderMode::Partial) {
+ mbgl::Log::Info(mbgl::Event::General, "MapChangeDidFinishRenderingMap");
+ } else {
+ mbgl::Log::Info(mbgl::Event::General, "MapChangeDidFinishRenderingMapFullyRendered");
+ }
+}
+
+void GLFWView::onDidFinishRenderingFrame(mbgl::MapObserver::RenderFrameStatus status) {
+ std::string mode = status.mode == mbgl::MapObserver::RenderMode::Partial ? "Partial" : "Full";
+ mbgl::Log::Info(mbgl::Event::General,
+ "onDidFinishRenderingFrame - mode: %s, needsRepaint: %d, placementChanged: %d",
+ mode.c_str(),
+ status.needsRepaint,
+ status.placementChanged);
+}
+
+void GLFWView::onDidBecomeIdle() {
+ mbgl::Log::Info(mbgl::Event::General, "onDidBecomeIdle");
+}
+
+void GLFWView::onDidFinishSourceLoad(const std::string &source) {
+ mbgl::Log::Info(mbgl::Event::General, "onDidFinishSourceLoad: %s", source.c_str());
+}
diff --git a/platform/glfw/glfw_view.hpp b/platform/glfw/glfw_view.hpp
index dbe6ceb046..3d2c796b07 100644
--- a/platform/glfw/glfw_view.hpp
+++ b/platform/glfw/glfw_view.hpp
@@ -71,6 +71,11 @@ private:
static void onMouseMove(GLFWwindow *window, double x, double y);
static void onWindowFocus(GLFWwindow *window, int focused);
+ void onDidFinishRenderingMap(mbgl::MapObserver::RenderMode) final;
+ void onDidFinishRenderingFrame(mbgl::MapObserver::RenderFrameStatus) final;
+ void onDidBecomeIdle() final;
+ void onDidFinishSourceLoad(const std::string &) final;
+
// Internal
void report(float duration);