More graceful handling of QSurfaceFormat::samples() with EGL.
Earlier, if we asked for say 16 and the implementation only handled 4, we defaulted to 0 (no antialiasing). Now, we instead try a progressively lower number until we find a match. Task-number: QTBUG-22669 Change-Id: I63f4b8aadf8e06713d19fdc9b9d73672162c816a Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>bb10
parent
fb62fdac1c
commit
a541fd4d71
|
|
@ -152,13 +152,19 @@ bool q_reduceConfigAttributes(QVector<EGLint> *configAttributes)
|
|||
}
|
||||
}
|
||||
|
||||
i = configAttributes->indexOf(EGL_SAMPLES);
|
||||
if (i >= 0) {
|
||||
EGLint value = configAttributes->value(i+1, 0);
|
||||
if (value > 1)
|
||||
configAttributes->replace(i+1, qMin(EGLint(16), value / 2));
|
||||
else
|
||||
configAttributes->remove(i, 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
i = configAttributes->indexOf(EGL_SAMPLE_BUFFERS);
|
||||
if (i >= 0) {
|
||||
configAttributes->remove(i,2);
|
||||
i = configAttributes->indexOf(EGL_SAMPLES);
|
||||
if (i >= 0) {
|
||||
configAttributes->remove(i,2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue