[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.1.0.4.tar.bz2/hwcomposer/qeglfscontext.cpp
^
|
@@ -52,13 +52,26 @@
QEglFSContext::QEglFSContext(HwComposerContext *hwc, QEglFSPageFlipper *pageFlipper, const QSurfaceFormat &format, QPlatformOpenGLContext *share,
EGLDisplay display, EGLenum eglApi)
: QEGLPlatformContext(hwc->surfaceFormatFor(format), share, display, QEglFSIntegration::chooseConfig(display, hwc->surfaceFormatFor(format)), eglApi),
- m_pageFlipper(pageFlipper), m_hwc(hwc)
+ m_hwc(hwc), m_pageFlipper(pageFlipper), m_swapIntervalConfigured(false)
{
}
bool QEglFSContext::makeCurrent(QPlatformSurface *surface)
{
- return QEGLPlatformContext::makeCurrent(surface);
+ bool current = QEGLPlatformContext::makeCurrent(surface);
+ if (current && !m_swapIntervalConfigured) {
+ m_swapIntervalConfigured = true;
+ int swapInterval = 1;
+ QByteArray swapIntervalString = qgetenv("QT_QPA_EGLFS_SWAPINTERVAL");
+ if (!swapIntervalString.isEmpty()) {
+ bool ok;
+ swapInterval = swapIntervalString.toInt(&ok);
+ if (!ok)
+ swapInterval = 1;
+ }
+ eglSwapInterval(eglDisplay(), swapInterval);
+ }
+ return current;
}
EGLSurface QEglFSContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.1.0.4.tar.bz2/hwcomposer/qeglfscontext.h
^
|
@@ -62,6 +62,7 @@
private:
HwComposerContext *m_hwc;
QEglFSPageFlipper *m_pageFlipper;
+ bool m_swapIntervalConfigured;
};
QT_END_NAMESPACE
|