summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-08-19 23:15:37 +0300
committerMike Morris <mikemorris@users.noreply.github.com>2016-08-26 10:55:42 -0400
commit643a628723ace63f0ccf71b1de1db35ae8d80e7a (patch)
treef4e519c0fd4f764658fede24cc197627900d0230
parent8801c9031b407d02274f36eb1c7e959252541064 (diff)
downloadqtlocation-mapboxgl-643a628723ace63f0ccf71b1de1db35ae8d80e7a.tar.gz
[node] stopwatch
-rw-r--r--.gitmodules3
-rw-r--r--platform/default/headless_view.cpp20
m---------platform/ios/uitest/OHHTTPStubs0
-rw-r--r--src/mbgl/map/map.cpp2
4 files changed, 16 insertions, 9 deletions
diff --git a/.gitmodules b/.gitmodules
index af156810c6..8eea444671 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -9,6 +9,3 @@
[submodule "platform/ios/uitest/KIF"]
path = platform/ios/uitest/KIF
url = https://github.com/kif-framework/KIF.git
-[submodule "platform/ios/uitest/OHHTTPStubs"]
- path = platform/ios/uitest/OHHTTPStubs
- url = https://github.com/AliSoftware/OHHTTPStubs.git
diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp
index 28c300b41e..945de32037 100644
--- a/platform/default/headless_view.cpp
+++ b/platform/default/headless_view.cpp
@@ -1,5 +1,6 @@
-#include <mbgl/platform/default/headless_view.hpp>
#include <mbgl/platform/default/headless_display.hpp>
+#include <mbgl/platform/default/headless_view.hpp>
+#include <mbgl/util/stopwatch.hpp>
#include <cassert>
#include <cstring>
@@ -41,21 +42,28 @@ void HeadlessView::resize(const uint16_t width, const uint16_t height) {
}
PremultipliedImage HeadlessView::readStillImage() {
+ util::stopwatch stopwatch("readStillImage", Event::General);
assert(active);
const unsigned int w = dimensions[0] * pixelRatio;
const unsigned int h = dimensions[1] * pixelRatio;
PremultipliedImage image { w, h };
- MBGL_CHECK_ERROR(glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, image.data.get()));
+ {
+ util::stopwatch stopwatch2("glReadPixels", Event::General);
+ MBGL_CHECK_ERROR(glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, image.data.get()));
+ }
const auto stride = image.stride();
auto tmp = std::make_unique<uint8_t[]>(stride);
uint8_t* rgba = image.data.get();
- for (int i = 0, j = h - 1; i < j; i++, j--) {
- std::memcpy(tmp.get(), rgba + i * stride, stride);
- std::memcpy(rgba + i * stride, rgba + j * stride, stride);
- std::memcpy(rgba + j * stride, tmp.get(), stride);
+ {
+ util::stopwatch stopwatch3("memcpy", Event::General);
+ for (int i = 0, j = h - 1; i < j; i++, j--) {
+ std::memcpy(tmp.get(), rgba + i * stride, stride);
+ std::memcpy(rgba + i * stride, rgba + j * stride, stride);
+ std::memcpy(rgba + j * stride, tmp.get(), stride);
+ }
}
return image;
diff --git a/platform/ios/uitest/OHHTTPStubs b/platform/ios/uitest/OHHTTPStubs
deleted file mode 160000
-Subproject deed01a1592210a4c37f3f5c5f2b32fe0e41c60
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 3a307735ab..eab4c77e2e 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -21,6 +21,7 @@
#include <mbgl/util/exception.hpp>
#include <mbgl/util/async_task.hpp>
#include <mbgl/util/mapbox.hpp>
+#include <mbgl/util/stopwatch.hpp>
#include <mbgl/util/tile_coordinate.hpp>
namespace mbgl {
@@ -241,6 +242,7 @@ void Map::Impl::update() {
if (mode == MapMode::Continuous) {
view.invalidate();
} else if (callback && style->isLoaded()) {
+ util::stopwatch stopwatch2("render", Event::General);
view.activate();
render();
view.deactivate();