Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/drape
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2017-07-24 19:21:24 +0300
committerAleksandr Zatsepin <alexzatsepin@users.noreply.github.com>2017-07-24 20:13:29 +0300
commit3b5467b186bc35f0fdda1f9a15d33530787fa811 (patch)
tree3265e48d11e1b2bbee64cfb536080a2d82e0b1cb /drape
parent068c10e8d0d65e3513c8e87e5bc649ebea885cfe (diff)
Disabled transparent 3d buildings on Android 4.2 and less
Diffstat (limited to 'drape')
-rw-r--r--drape/framebuffer.cpp7
-rw-r--r--drape/support_manager.cpp15
-rw-r--r--drape/support_manager.hpp2
3 files changed, 24 insertions, 0 deletions
diff --git a/drape/framebuffer.cpp b/drape/framebuffer.cpp
index 010cd4d5cd..cef169a37c 100644
--- a/drape/framebuffer.cpp
+++ b/drape/framebuffer.cpp
@@ -1,5 +1,6 @@
#include "drape/framebuffer.hpp"
#include "drape/glfunctions.hpp"
+#include "drape/support_manager.hpp"
#include "base/assert.hpp"
#include "base/logging.hpp"
@@ -111,6 +112,12 @@ void Framebuffer::SetSize(uint32_t width, uint32_t height)
if (!m_isSupported)
return;
+ if (!SupportManager::Instance().IsFramebufferSupported())
+ {
+ m_isSupported = false;
+ return;
+ }
+
if (m_width == width && m_height == height)
return;
diff --git a/drape/support_manager.cpp b/drape/support_manager.cpp
index 5528f467bc..beac26753f 100644
--- a/drape/support_manager.cpp
+++ b/drape/support_manager.cpp
@@ -5,6 +5,10 @@
#include "base/logging.hpp"
+#ifdef OMIM_OS_ANDROID
+#include "android/jni/com/mapswithme/platform/Platform.hpp"
+#endif
+
#include "3party/Alohalytics/src/alohalytics.h"
#include <algorithm>
@@ -68,6 +72,17 @@ void SupportManager::Init()
#endif
settings::Set(kSupportedAntialiasing, m_isAntialiasingEnabledByDefault);
}
+
+ // Disable framebuffer for old Android OS versions.
+#ifdef OMIM_OS_ANDROID
+ int constexpr kMinSdkVersionForFramebuffer = 18;
+ int const sdkVersion = android::GetAndroidSdkVersion();
+ if (sdkVersion != 0)
+ m_isFramebufferSupported = (sdkVersion >= kMinSdkVersionForFramebuffer);
+
+ if (!m_isFramebufferSupported)
+ LOG(LINFO, ("Framebuffer is not supported on Android API level ", sdkVersion));
+#endif
}
SupportManager & SupportManager::Instance()
diff --git a/drape/support_manager.hpp b/drape/support_manager.hpp
index e7a9df6aa9..4b2bb14a83 100644
--- a/drape/support_manager.hpp
+++ b/drape/support_manager.hpp
@@ -20,6 +20,7 @@ public:
bool IsTegraDevice() const { return m_isTegra; }
int GetMaxLineWidth() const { return m_maxLineWidth; }
bool IsAntialiasingEnabledByDefault() const { return m_isAntialiasingEnabledByDefault; }
+ bool IsFramebufferSupported() const { return m_isFramebufferSupported; }
private:
SupportManager() = default;
@@ -29,6 +30,7 @@ private:
bool m_isTegra = false;
int m_maxLineWidth = 1;
bool m_isAntialiasingEnabledByDefault = false;
+ bool m_isFramebufferSupported = true;
DISALLOW_COPY_AND_MOVE(SupportManager);
};