forked from organicmaps/organicmaps
Fixed BAD_SURFACE on eglQuerySurfaceSize on some Android devices
This commit is contained in:
parent
61ccc67ee3
commit
4fec678eab
3 changed files with 18 additions and 4 deletions
|
@ -174,7 +174,7 @@ bool Framework::IsDrapeEngineCreated()
|
|||
|
||||
void Framework::Resize(int w, int h)
|
||||
{
|
||||
m_contextFactory->CastFactory<AndroidOGLContextFactory>()->UpdateSurfaceSize();
|
||||
m_contextFactory->CastFactory<AndroidOGLContextFactory>()->UpdateSurfaceSize(w, h);
|
||||
m_work.OnSize(w, h);
|
||||
|
||||
//TODO: remove after correct visible rect calculation.
|
||||
|
|
|
@ -214,10 +214,24 @@ int AndroidOGLContextFactory::GetHeight() const
|
|||
return m_surfaceHeight;
|
||||
}
|
||||
|
||||
void AndroidOGLContextFactory::UpdateSurfaceSize()
|
||||
void AndroidOGLContextFactory::UpdateSurfaceSize(int w, int h)
|
||||
{
|
||||
ASSERT(IsValid(), ());
|
||||
QuerySurfaceSize();
|
||||
if ((m_surfaceWidth != w && m_surfaceWidth != h) ||
|
||||
(m_surfaceHeight != w && m_surfaceHeight != h))
|
||||
{
|
||||
LOG(LINFO, ("Surface size changed and must be re-queried."));
|
||||
if (!QuerySurfaceSize())
|
||||
{
|
||||
m_surfaceWidth = w;
|
||||
m_surfaceHeight = h;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_surfaceWidth = w;
|
||||
m_surfaceHeight = h;
|
||||
}
|
||||
}
|
||||
|
||||
bool AndroidOGLContextFactory::QuerySurfaceSize()
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
int GetWidth() const;
|
||||
int GetHeight() const;
|
||||
void UpdateSurfaceSize();
|
||||
void UpdateSurfaceSize(int w, int h);
|
||||
|
||||
bool IsSupportedOpenGLES3() const { return m_supportedES3; }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue