summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-04-06 15:47:54 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-04-10 18:01:28 +0300
commitf1bcca1465b5824c425b395ee6700a1431ca5509 (patch)
tree8a3e728135da7af8ffa3338260204a6a7c8a3507
parent2417d13f08fc0457b6e9d38a1da7df110a71837a (diff)
downloadqtlocation-mapboxgl-f1bcca1465b5824c425b395ee6700a1431ca5509.tar.gz
[android] Initialize NativeMapView with OpenGL ES 2.0 minimum texture size
-rwxr-xr-xplatform/android/src/native_map_view.cpp5
-rwxr-xr-xplatform/android/src/native_map_view.hpp10
2 files changed, 9 insertions, 6 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp
index 861f068cb1..9f6328cd51 100755
--- a/platform/android/src/native_map_view.cpp
+++ b/platform/android/src/native_map_view.cpp
@@ -15,6 +15,7 @@
#include <jni/jni.hpp>
#include <mbgl/map/backend_scope.hpp>
+#include <mbgl/math/minmax.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/event.hpp>
#include <mbgl/util/exception.hpp>
@@ -320,8 +321,8 @@ void NativeMapView::update(jni::JNIEnv&) {
}
void NativeMapView::resizeView(jni::JNIEnv&, int w, int h) {
- width = w;
- height = h;
+ width = util::max(64, w);
+ height = util::max(64, h);
map->setSize({ static_cast<uint32_t>(width), static_cast<uint32_t>(height) });
}
diff --git a/platform/android/src/native_map_view.hpp b/platform/android/src/native_map_view.hpp
index d48d5a107c..770065a8a3 100755
--- a/platform/android/src/native_map_view.hpp
+++ b/platform/android/src/native_map_view.hpp
@@ -315,10 +315,12 @@ private:
bool firstRender = true;
double fps = 0.0;
- int width = 0;
- int height = 0;
- int fbWidth = 0;
- int fbHeight = 0;
+ // Minimum texture size according to OpenGL ES 2.0 specification.
+ int width = 64;
+ int height = 64;
+ int fbWidth = 64;
+ int fbHeight = 64;
+
bool framebufferSizeChanged = true;
int availableProcessors = 0;