summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-03-29 07:37:55 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2010-03-29 07:39:28 (GMT)
commit9e12625b31e1d95f023fe67deb50e8bf97903994 (patch)
tree28b834323e17aa1e8359593a5bd9bea6b869bf48 /src/plugins
parent2c38550ddb064215f827f856110128f2bb4fd631 (diff)
downloadQt-9e12625b31e1d95f023fe67deb50e8bf97903994.zip
Qt-9e12625b31e1d95f023fe67deb50e8bf97903994.tar.gz
Qt-9e12625b31e1d95f023fe67deb50e8bf97903994.tar.bz2
Compile fix the openkode graphicssystem
Does not work well yet though :(
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/graphicssystems/openkode/openkode.pro2
-rw-r--r--src/plugins/graphicssystems/openkode/qgraphicssystem_openkode.cpp13
-rw-r--r--src/plugins/graphicssystems/openkode/qgraphicssystem_openkode.h2
-rw-r--r--src/plugins/graphicssystems/openkode/qwindowsurface_openkode.cpp51
-rw-r--r--src/plugins/graphicssystems/openkode/qwindowsurface_openkode.h3
5 files changed, 40 insertions, 31 deletions
diff --git a/src/plugins/graphicssystems/openkode/openkode.pro b/src/plugins/graphicssystems/openkode/openkode.pro
index f8f0bcb..055048d 100644
--- a/src/plugins/graphicssystems/openkode/openkode.pro
+++ b/src/plugins/graphicssystems/openkode/openkode.pro
@@ -11,4 +11,4 @@ INSTALLS += target
# openkode specific stuff
INCLUDEPATH += $(OPENKODE_DIR)/include
-LIBS += $${QMAKE_RPATH}/$(OPENKODE_DIR)/lib-target -L$(OPENKODE_DIR)/lib-target -lKD -lEGL -lGLESv2_CM
+LIBS += $${QMAKE_RPATH}/$(OPENKODE_DIR)/lib-target -L$(OPENKODE_DIR)/lib-target -lKD -lEGL -lGLESv2
diff --git a/src/plugins/graphicssystems/openkode/qgraphicssystem_openkode.cpp b/src/plugins/graphicssystems/openkode/qgraphicssystem_openkode.cpp
index 51364e4..7a07776 100644
--- a/src/plugins/graphicssystems/openkode/qgraphicssystem_openkode.cpp
+++ b/src/plugins/graphicssystems/openkode/qgraphicssystem_openkode.cpp
@@ -92,7 +92,7 @@ QOpenKODEGraphicsSystemScreen::QOpenKODEGraphicsSystemScreen()
}
// Once we've set up the desktop and display we don't need them anymore
-// kdReleaseDisplayNV(kdDisplay); TODO!!!
+ kdReleaseDisplayNV(kdDisplay);
kdReleaseDesktopNV(kdDesktop);
const int defaultDpi = 72;
@@ -102,12 +102,6 @@ QOpenKODEGraphicsSystemScreen::QOpenKODEGraphicsSystemScreen()
mDepth = 24;
mFormat = QImage::Format_RGB888;
- if (!mContext.openDisplay(0)) {
- qWarning("qEglContext: Unable to open display!");
- return;
- }
-
- qDebug() << " - QEglContext::openDisplay OK";
QEglProperties properties;
properties.setPixelFormat(QImage::Format_RGB888);
@@ -119,6 +113,11 @@ QOpenKODEGraphicsSystemScreen::QOpenKODEGraphicsSystemScreen()
return;
}
+ if (!mContext.display()) {
+ qWarning("qEglContext: Unable to open display!");
+ return;
+ }
+
qDebug() << " - QEglContext::openDisplay OK";
}
diff --git a/src/plugins/graphicssystems/openkode/qgraphicssystem_openkode.h b/src/plugins/graphicssystems/openkode/qgraphicssystem_openkode.h
index 972c42e..7d73ae0 100644
--- a/src/plugins/graphicssystems/openkode/qgraphicssystem_openkode.h
+++ b/src/plugins/graphicssystems/openkode/qgraphicssystem_openkode.h
@@ -45,7 +45,7 @@
#include <QtCore/qsemaphore.h>
#include <QtGui/private/qgraphicssystem_p.h>
-#include <QtGui/private/qegl_p.h>
+#include <QtGui/private/qeglcontext_p.h>
# include <GLES2/gl2.h>
diff --git a/src/plugins/graphicssystems/openkode/qwindowsurface_openkode.cpp b/src/plugins/graphicssystems/openkode/qwindowsurface_openkode.cpp
index 33c76e4..b3f3965 100644
--- a/src/plugins/graphicssystems/openkode/qwindowsurface_openkode.cpp
+++ b/src/plugins/graphicssystems/openkode/qwindowsurface_openkode.cpp
@@ -51,12 +51,13 @@ QT_BEGIN_NAMESPACE
QOpenKODEWindowSurface::QOpenKODEWindowSurface
(QOpenKODEGraphicsSystemScreen *screen, QWidget *window)
: QWindowSurface(window),
- mScreen(screen)
+ mScreen(screen),
+ mSurface(0)
{
qDebug() << "QOpenKODEWindowSurface::QOpenKODEWindowSurface:" << window << window->width() << "x" << window->height()
<< "pos" << window->x() << "x" << window->y();
- if (!mContext.openDisplay(0)) {
+ if (!mContext.display()) {
qWarning("qEglContext: Unable to open display!");
return;
}
@@ -76,6 +77,7 @@ QOpenKODEWindowSurface::QOpenKODEWindowSurface
void QOpenKODEWindowSurface::createWindow(QWidget *window)
{
+ qDebug() << "createWindow";
kdWindow = kdCreateWindow(mContext.display(), mContext.config(), KD_NULL);
if (!kdWindow) {
@@ -89,17 +91,17 @@ void QOpenKODEWindowSurface::createWindow(QWidget *window)
return;
}
- const KDboolean windowExclusive[] = { false };
- if (kdSetWindowPropertybv(kdWindow, KD_WINDOWPROPERTY_DESKTOP_EXCLUSIVE_NV, windowExclusive)) {
- qErrnoWarning(kdGetError(), "Could not set exclusive bit");
- return;
- }
+ //const KDboolean windowExclusive[] = { false };
+ //if (kdSetWindowPropertybv(kdWindow, KD_WINDOWPROPERTY_DESKTOP_EXCLUSIVE_NV, windowExclusive)) {
+ // qErrnoWarning(kdGetError(), "Could not set exclusive bit");
+ // //return;
+ //}
- const KDint windowPos[2] = { window->x(), window->y() };
- if (kdSetWindowPropertyiv(kdWindow, KD_WINDOWPROPERTY_DESKTOP_OFFSET_NV, windowPos)) {
- qErrnoWarning(kdGetError(), "Could not set native window position");
- return;
- }
+ //const KDint windowPos[2] = { window->x(), window->y() };
+ //if (kdSetWindowPropertyiv(kdWindow, KD_WINDOWPROPERTY_DESKTOP_OFFSET_NV, windowPos)) {
+ // qErrnoWarning(kdGetError(), "Could not set native window position");
+ // //return;
+ //}
EGLNativeWindowType nativeWindow;
@@ -107,24 +109,29 @@ void QOpenKODEWindowSurface::createWindow(QWidget *window)
qErrnoWarning(kdGetError(), "Could not realize native window");
return;
}
+ qDebug() << "kdRealizeWindow" << nativeWindow;
// Create an EGL window surface for the native window
EGLint windowAttrs[3] = { EGL_NONE };
- EGLSurface eglSurface = eglCreateWindowSurface(mContext.display(),
+ qDebug() << "doing createwindowsurface";
+ *mSurface = eglCreateWindowSurface(mContext.display(),
mContext.config(),
nativeWindow,
windowAttrs);
- if (!eglSurface) {
+ qDebug() << "create windowsurface";
+ if (!mSurface) {
qWarning("EGL couldn't create window surface: 0x%x", eglGetError());
return;
}
- mContext.setSurface(eglSurface);
-
+ qDebug() << "making context";
if (!mContext.createContext()) {
qDebug() << "Unable to create context!";
return;
}
+
+ qDebug() << "about to make current";
+ mContext.makeCurrent(mSurface);
}
QOpenKODEWindowSurface::~QOpenKODEWindowSurface()
@@ -133,19 +140,20 @@ QOpenKODEWindowSurface::~QOpenKODEWindowSurface()
QPaintDevice *QOpenKODEWindowSurface::paintDevice()
{
- //qDebug() << "QOpenKODEWindowSurface::paintDevice";
+ qDebug() << "QOpenKODEWindowSurface::paintDevice";
return &mImage;
}
// ### TODO - this updates the entire toplevel, should only update the region
-void QOpenKODEWindowSurface::flush(QWidget *widget, const QRegion &region, const QPoint &offset)
+void QOpenKODEWindowSurface::flush(QWidget *, const QRegion &region, const QPoint &offset)
{
+ qDebug() << "in flush";
if (!offset.isNull()) {
qWarning("Offset flushing not supported yet");
return;
}
- if (!mContext.makeCurrent()) {
+ if (!mContext.makeCurrent(mSurface)) {
qWarning("EGL couldn't make context/surface current: 0x%x", eglGetError());
return;
}
@@ -222,8 +230,8 @@ void QOpenKODEWindowSurface::flush(QWidget *widget, const QRegion &region, const
if (texId)
glDeleteTextures(1, &texId);
- mContext.swapBuffers();
mContext.doneCurrent();
+ mContext.swapBuffers(mSurface);
}
void QOpenKODEWindowSurface::setGeometry(const QRect &rect)
@@ -233,9 +241,10 @@ void QOpenKODEWindowSurface::setGeometry(const QRect &rect)
if (mImage.size() != rect.size())
mImage = QImage(rect.size(), mScreen->format());
- mContext.destroySurface();
+ mContext.destroySurface(mSurface);
kdDestroyWindow(kdWindow);
createWindow(window());
+ qDebug() << "set geometry workded";
}
bool QOpenKODEWindowSurface::scroll(const QRegion &area, int dx, int dy)
diff --git a/src/plugins/graphicssystems/openkode/qwindowsurface_openkode.h b/src/plugins/graphicssystems/openkode/qwindowsurface_openkode.h
index 1c70f55..bee94a5 100644
--- a/src/plugins/graphicssystems/openkode/qwindowsurface_openkode.h
+++ b/src/plugins/graphicssystems/openkode/qwindowsurface_openkode.h
@@ -43,7 +43,7 @@
#define QWINDOWSURFACE_OPENKODE_H
#include <QtGui/private/qwindowsurface_p.h>
-#include <QtGui/private/qegl_p.h>
+#include <QtGui/private/qeglcontext_p.h>
QT_BEGIN_NAMESPACE
@@ -68,6 +68,7 @@ private:
QOpenKODEGraphicsSystemScreen *mScreen;
QImage mImage;
struct KDWindow *kdWindow;
+ EGLSurface *mSurface;
QEglContext mContext;
void createWindow(QWidget *window);