Hi Dmytro:
The bindTexture become a blocker to me:
http://bugreports.qt.nokia.com/browse/QTBUG-11462

bindTexture in simpleanchorlayout turns to be a random issue on my device,
however even when it works, the same code in qt-mobility doesn't work.

Do you have any idea for it?




ZHAO, Halley (Aihua)
Email: [email protected]<blocked::mailto:[email protected]>
Tel: +86(21)61166476   iNet: 8821-6476
SSG/OTC/Moblin 3W038 Pole: F4

diff --git a/src/multimedia/qgraphicsvideoitem.cpp 
b/src/multimedia/qgraphicsvideoitem.cpp
index c7d0516..5c4894e 100644
--- a/src/multimedia/qgraphicsvideoitem.cpp
+++ b/src/multimedia/qgraphicsvideoitem.cpp
@@ -386,7 +386,38 @@ void QGraphicsVideoItem::paint(
 
     Q_UNUSED(option);
     Q_UNUSED(widget);
-
+#if 1
+static int count = 0;
+static QGLContext * glContext = NULL;
+static GLuint pixmapTexture = 0;
+qDebug() << "count:" << count << "glContext: " << (void*) 
QGLContext::currentContext();
+if(count++ >10) {
+    if (!glContext) { // I'm not sure when GLContext could setup.
+        glContext = const_cast<QGLContext *>(QGLContext::currentContext());
+    }
+    // qDebug() <<"bounding rect:" << boundingRect();
+
+    painter->beginNativePainting();
+    glEnable(GL_TEXTURE_2D);
+    glLoadIdentity();
+    if(!glIsTexture(pixmapTexture)) {
+        // pixmapTexture = 
glContext->bindTexture(QImage(QString("/home/halley/qt/player-qt-mobility/test.png")),
 GL_TEXTURE_2D);
+        pixmapTexture = 
glContext->bindTexture(QPixmap(QString("/home/halley/qt/player-qt-mobility/test.png")),
 GL_TEXTURE_2D);
+    }
+        glBindTexture(GL_TEXTURE_2D, pixmapTexture);
+    glBegin(GL_TRIANGLES);
+        glColor3f( 0.8, 0.8, 1.0);
+        glVertex3f(0+5, glContext->device()->width()/4, 0.0);
+            glTexCoord2f(0.0f, 0.0f);
+        glVertex3f(0+5, glContext->device()->height()*3/4, 0.0);
+            glTexCoord2f(1.0f, 0.0f);
+        glVertex3f(glContext->device()->width()/2, 
glContext->device()->height()*3/4, 0.0);
+            glTexCoord2f(1.0f, 1.0f);
+    glEnd();
+        glColor3f( 1.0, 1.0, 1.0);
+    painter->endNativePainting();
+}
+#endif
     if (d->surface && d->surface->isActive()) {
         d->surface->paint(painter, d->boundingRect, d->sourceRect);
         d->surface->setReady(true);
_______________________________________________
Qt-mobility-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-mobility-feedback

Reply via email to