forked from organicmaps/organicmaps
Fixed EGL context creation which led to artifacts on Meizu MX4
This commit is contained in:
parent
63a9b151f4
commit
485b6e02e8
2 changed files with 14 additions and 2 deletions
|
@ -13,7 +13,11 @@ ConfigComparator::ConfigComparator(EGLDisplay display)
|
|||
|
||||
int ConfigComparator::operator()(EGLConfig const & l, EGLConfig const & r) const
|
||||
{
|
||||
return configWeight(l) - configWeight(r);
|
||||
int const weight = configWeight(l) - configWeight(r);
|
||||
if (weight == 0)
|
||||
return configAlphaSize(l) - configAlphaSize(r);
|
||||
|
||||
return weight;
|
||||
}
|
||||
|
||||
int ConfigComparator::configWeight(EGLConfig const & config) const
|
||||
|
@ -34,6 +38,13 @@ int ConfigComparator::configWeight(EGLConfig const & config) const
|
|||
}
|
||||
}
|
||||
|
||||
int ConfigComparator::configAlphaSize(EGLConfig const & config) const
|
||||
{
|
||||
int val = 0;
|
||||
eglGetConfigAttrib(m_display, config, EGL_ALPHA_SIZE, &val);
|
||||
return val;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -71,4 +82,4 @@ void CheckEGL(my::SrcPoint const & src)
|
|||
}
|
||||
}
|
||||
|
||||
} // namespace android
|
||||
} // namespace android
|
||||
|
|
|
@ -15,6 +15,7 @@ public:
|
|||
|
||||
int operator()(EGLConfig const & l, EGLConfig const & r) const;
|
||||
int configWeight(EGLConfig const & config) const;
|
||||
int configAlphaSize(EGLConfig const & config) const;
|
||||
|
||||
private:
|
||||
EGLDisplay m_display;
|
||||
|
|
Loading…
Add table
Reference in a new issue