summaryrefslogtreecommitdiff
path: root/platform/android/src/native_map_view.cpp
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2016-03-08 07:30:18 -0500
committerTobrun <tobrun.van.nuland@gmail.com>2016-03-08 08:06:55 -0500
commit20c3706536ac9e927f80a50e9ec8906dfd0d2baf (patch)
tree70ff4bb656f14a8e2c12d712900128e6857b5c38 /platform/android/src/native_map_view.cpp
parent15bc11ab233bc29a245297cca12428258ec0ce91 (diff)
downloadqtlocation-mapboxgl-20c3706536ac9e927f80a50e9ec8906dfd0d2baf.tar.gz
[android] #4240 - add flag to resize only when needed.
Diffstat (limited to 'platform/android/src/native_map_view.cpp')
-rwxr-xr-xplatform/android/src/native_map_view.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp
index 17b7755a23..23eb39dab8 100755
--- a/platform/android/src/native_map_view.cpp
+++ b/platform/android/src/native_map_view.cpp
@@ -191,10 +191,11 @@ void NativeMapView::invalidate() {
void NativeMapView::beforeRender() {
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::beforeRender()");
- // this fixes the viewport resizing issue,
- // but we are calling it every time.
- // we should only call this when the resizeView / resizeFramebuffer is called.
- glViewport(0,0,fbWidth,fbHeight);
+
+ if(sizeChanged){
+ sizeChanged = false;
+ glViewport(0, 0, fbWidth, fbHeight);
+ }
}
void NativeMapView::afterRender() {
@@ -751,6 +752,7 @@ void NativeMapView::updateFps() {
void NativeMapView::resizeView(int w, int h) {
width = w;
height = h;
+ sizeChanged = true;
map->update(mbgl::Update::Dimensions);
}