eglfs: move m_pos into Cursor

Change-Id: I51e92d265e7ea6372ae58b357f75362e2d9a2df9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Girish Ramakrishnan 2012-06-19 17:09:06 -07:00 committed by Qt by Nokia
parent 1655cb5a69
commit 7042de0894
3 changed files with 9 additions and 10 deletions

View File

@ -206,14 +206,14 @@ public:
}
void setPos(const QPoint &pos) Q_DECL_OVERRIDE {
m_pos = pos;
m_cursor.pos = pos;
moveDispmanxLayer(m_window, cursorRect().topLeft());
}
void pointerEvent(const QMouseEvent &event) Q_DECL_OVERRIDE {
if (event.type() != QEvent::MouseMove)
return;
m_pos = event.pos();
m_cursor.pos = event.pos();
moveDispmanxLayer(m_window, cursorRect().topLeft());
}

View File

@ -50,7 +50,7 @@
QT_BEGIN_NAMESPACE
QEglFSCursor::QEglFSCursor(QEglFSScreen *screen)
: m_screen(screen), m_pos(0, 0), m_program(0), m_vertexCoordEntry(0), m_textureCoordEntry(0), m_textureEntry(0)
: m_screen(screen), m_program(0), m_vertexCoordEntry(0), m_textureCoordEntry(0), m_textureEntry(0)
{
initCursorAtlas();
@ -224,23 +224,23 @@ bool QEglFSCursor::setCurrentCursor(QCursor *cursor)
void QEglFSCursor::update(const QRegion &rgn)
{
QWindowSystemInterface::handleSynchronousExposeEvent(m_screen->topLevelAt(m_pos), rgn);
QWindowSystemInterface::handleSynchronousExposeEvent(m_screen->topLevelAt(m_cursor.pos), rgn);
}
QRect QEglFSCursor::cursorRect() const
{
return QRect(m_pos - m_cursor.hotSpot, m_cursor.size);
return QRect(m_cursor.pos - m_cursor.hotSpot, m_cursor.size);
}
QPoint QEglFSCursor::pos() const
{
return m_pos;
return m_cursor.pos;
}
void QEglFSCursor::setPos(const QPoint &pos)
{
const QRect oldCursorRect = cursorRect();
m_pos = pos;
m_cursor.pos = pos;
update(oldCursorRect | cursorRect());
}
@ -249,7 +249,7 @@ void QEglFSCursor::pointerEvent(const QMouseEvent &event)
if (event.type() != QEvent::MouseMove)
return;
const QRect oldCursorRect = cursorRect();
m_pos = event.pos();
m_cursor.pos = event.pos();
update(oldCursorRect | cursorRect());
}

View File

@ -83,11 +83,10 @@ protected:
QSize size; // size of the cursor
QPoint hotSpot;
QImage customCursorImage;
QPoint pos; // current cursor position
uint customCursorTexture;
} m_cursor;
QPoint m_pos; // current cursor position
private:
void createShaderPrograms();
static void createCursorTexture(uint *texture, const QImage &image);