Make the EGL platform cursor reset the array buffer
Otherwise bad things happen if the application leaves a buffer bound. [ChangeLog] The eglfs mouse cursor properly resets the array buffer to prevent rendering issues. This, just like with vertex attributes and textures, requires applications to be aware of such state changes in swapBuffers(). Change-Id: I8b383cc867d8d0d0572773eacfa650e7b33b9680 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This commit is contained in:
parent
09754d218a
commit
b366d0d016
@ -343,6 +343,8 @@ void QEGLPlatformCursor::draw(const QRectF &r)
|
||||
{
|
||||
if (!m_program) {
|
||||
// one time initialization
|
||||
initializeOpenGLFunctions();
|
||||
|
||||
createShaderPrograms();
|
||||
|
||||
if (!m_cursorAtlas.texture) {
|
||||
@ -387,6 +389,7 @@ void QEGLPlatformCursor::draw(const QRectF &r)
|
||||
};
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, m_cursor.texture);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
||||
m_program->enableAttributeArray(m_vertexCoordEntry);
|
||||
m_program->enableAttributeArray(m_textureCoordEntry);
|
||||
|
@ -44,6 +44,7 @@
|
||||
|
||||
#include <qpa/qplatformcursor.h>
|
||||
#include <qpa/qplatformscreen.h>
|
||||
#include <QtGui/QOpenGLFunctions>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -86,7 +87,7 @@ private:
|
||||
bool m_active;
|
||||
};
|
||||
|
||||
class QEGLPlatformCursor : public QPlatformCursor
|
||||
class QEGLPlatformCursor : public QPlatformCursor, protected QOpenGLFunctions
|
||||
{
|
||||
public:
|
||||
QEGLPlatformCursor(QPlatformScreen *screen);
|
||||
@ -113,7 +114,7 @@ private:
|
||||
void draw(const QRectF &rect);
|
||||
void update(const QRegion ®ion);
|
||||
void createShaderPrograms();
|
||||
static void createCursorTexture(uint *texture, const QImage &image);
|
||||
void createCursorTexture(uint *texture, const QImage &image);
|
||||
void initCursorAtlas();
|
||||
|
||||
// current cursor information
|
||||
|
Loading…
Reference in New Issue
Block a user