Attempt to fix strange GL behaviour on iOS8

This commit is contained in:
VladiMihaylenko 2017-03-17 14:19:07 +03:00 committed by Sergey Yershov
parent a55eff1605
commit 51ab2c729d
4 changed files with 14 additions and 0 deletions

View file

@ -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<HWTexture> OpenGLHWTextureAllocator::CreateTexture()
drape_ptr<HWTextureAllocator> CreateAllocator()
{
if (!Platform::IsCustomTextureAllocatorSupported())
return make_unique_dp<OpenGLHWTextureAllocator>();;
#if defined(OMIM_OS_IPHONE) && !defined(OMIM_OS_IPHONE_SIMULATOR)
return make_unique_dp<HWTextureAllocatorApple>();
#else

View file

@ -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

View file

@ -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))

View file

@ -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, CloseDir> dir(opendir(directory.c_str()));