diff --git a/drape/hw_texture.cpp b/drape/hw_texture.cpp index 5e6f09bef7..547a82c6c0 100644 --- a/drape/hw_texture.cpp +++ b/drape/hw_texture.cpp @@ -3,6 +3,8 @@ #include "glfunctions.hpp" #include "glextensions_list.hpp" +#include "platform/platform.hpp" + #include "base/math.hpp" #if defined(OMIM_OS_IPHONE) @@ -173,6 +175,9 @@ drape_ptr OpenGLHWTextureAllocator::CreateTexture() drape_ptr CreateAllocator() { + if (!Platform::IsCustomTextureAllocatorSupported()) + return make_unique_dp();; + #if defined(OMIM_OS_IPHONE) && !defined(OMIM_OS_IPHONE_SIMULATOR) return make_unique_dp(); #else diff --git a/platform/platform.hpp b/platform/platform.hpp index b5c1085428..6d0ee17094 100644 --- a/platform/platform.hpp +++ b/platform/platform.hpp @@ -93,6 +93,8 @@ public: static bool IsFileExistsByFullPath(string const & filePath); + /// @return true if we can create custom texture allocator in drape + static bool IsCustomTextureAllocatorSupported(); /// @return always the same writable dir for current user with slash at the end string WritableDir() const { return m_writableDir; } /// Set writable dir — use for testing and linux stuff only diff --git a/platform/platform_ios.mm b/platform/platform_ios.mm index 5d617f3483..bd116a543d 100644 --- a/platform/platform_ios.mm +++ b/platform/platform_ios.mm @@ -63,6 +63,9 @@ Platform::Platform() device.systemVersion); } +// static +bool Platform::IsCustomTextureAllocatorSupported() { return !isIOS8; } + Platform::EError Platform::MkDir(string const & dirName) const { if (::mkdir(dirName.c_str(), 0755)) diff --git a/platform/platform_unix_impl.cpp b/platform/platform_unix_impl.cpp index 1336022c0f..34b91fb71a 100644 --- a/platform/platform_unix_impl.cpp +++ b/platform/platform_unix_impl.cpp @@ -145,12 +145,16 @@ Platform::EError Platform::GetFileType(string const & path, EFileType & type) return ERR_OK; } +// static bool Platform::IsFileExistsByFullPath(string const & filePath) { struct stat s; return stat(filePath.c_str(), &s) == 0; } +// static +bool Platform::IsCustomTextureAllocatorSupported() { return true; } + bool Platform::IsDirectoryEmpty(string const & directory) { unique_ptr dir(opendir(directory.c_str()));