eglfs: Allow cursor atlas to be specified using an env variable
authorGirish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Wed, 16 May 2012 18:18:09 +0000 (11:18 -0700)
committerQt by Nokia <qt-info@nokia.com>
Thu, 17 May 2012 03:14:34 +0000 (05:14 +0200)
The atlas it assumed to have 8 cursors per row. All cursors have
to be square.

Change-Id: I7ffbad4662be450b146f84032bb26187894d528f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/plugins/platforms/eglfs/qeglfscursor.cpp

index f997b64..20cd7b9 100644 (file)
@@ -114,7 +114,10 @@ void QEglFSCursor::createCursorTexture(uint *texture, const QImage &image)
 
 void QEglFSCursor::initCursorAtlas()
 {
-    QImage image = QImage(":/cursor-atlas.png").convertToFormat(QImage::Format_ARGB32_Premultiplied);
+    static QByteArray atlas = qgetenv("QT_QPA_EGLFS_CURSORATLAS");
+    if (atlas.isEmpty())
+        atlas = ":/cursor-atlas.png";
+    QImage image = QImage(atlas).convertToFormat(QImage::Format_ARGB32_Premultiplied);
     m_cursorAtlas.cursorWidth = image.width() / CURSORS_PER_ROW;
     m_cursorAtlas.cursorHeight = image.height() / ((Qt::LastCursor + CURSORS_PER_ROW - 1) / CURSORS_PER_ROW);
     m_cursorAtlas.hotSpot = QPoint(m_cursorAtlas.cursorWidth/2, m_cursorAtlas.cursorHeight/2); // ## be smarter