diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-27 07:56:23 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-27 07:56:23 (GMT) |
commit | c7fbfa24ede337a7e38d4436a927368d8d461621 (patch) | |
tree | d508a7be754df89d6428bde7c9816f2280364724 /src | |
parent | 36a464681a349a0915f821786b4617695c1d02d4 (diff) | |
parent | 1fec80d000885cfe77bc68915e5c11dd4ee77d3d (diff) | |
download | Qt-c7fbfa24ede337a7e38d4436a927368d8d461621.zip Qt-c7fbfa24ede337a7e38d4436a927368d8d461621.tar.gz Qt-c7fbfa24ede337a7e38d4436a927368d8d461621.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging:
Fix broken rpath on wayland
Make sure to call damage on the buffer when we damage it
Update the wayland plugin
Diffstat (limited to 'src')
9 files changed, 58 insertions, 25 deletions
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp index 72de02a..999a411 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp @@ -91,7 +91,7 @@ void QWaylandXCompositeEGLContext::swapBuffers() QSize size = mWindow->geometry().size(); eglSwapBuffers(mEglIntegration->eglDisplay(),mEglWindowSurface); - mWindow->damage(QRegion(QRect(QPoint(0,0),size))); + mWindow->damage(QRect(QPoint(0,0),size)); mWindow->waitForFrameSync(); } diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp index dff6ffa..3d49790 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp @@ -81,7 +81,7 @@ void QWaylandXCompositeGLXContext::swapBuffers() QSize size = mWindow->geometry().size(); glXSwapBuffers(mGlxIntegration->xDisplay(),mXWindow); - mWindow->damage(QRegion(QRect(QPoint(0,0),size))); + mWindow->damage(QRect(QPoint(0,0),size)); mWindow->waitForFrameSync(); } diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index 83516e9..c8dc2f9 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -232,17 +232,36 @@ int QWaylandDisplay::sourceUpdate(uint32_t mask, void *data) } void QWaylandDisplay::outputHandleGeometry(void *data, - struct wl_output *output, + wl_output *output, int32_t x, int32_t y, - int32_t width, int32_t height) + int32_t physicalWidth, + int32_t physicalHeight, + int subpixel, + const char *make, const char *model) { QWaylandDisplay *waylandDisplay = static_cast<QWaylandDisplay *>(data); - QRect outputRect = QRect(x, y, width, height); + QRect outputRect = QRect(x, y, physicalWidth, physicalHeight); waylandDisplay->createNewScreen(output,outputRect); } +void QWaylandDisplay::mode(void *data, + struct wl_output *wl_output, + uint32_t flags, + int width, + int height, + int refresh) +{ + Q_UNUSED(data); + Q_UNUSED(wl_output); + Q_UNUSED(flags); + Q_UNUSED(width); + Q_UNUSED(height); + Q_UNUSED(refresh); +} + const struct wl_output_listener QWaylandDisplay::outputListener = { - QWaylandDisplay::outputHandleGeometry + QWaylandDisplay::outputHandleGeometry, + QWaylandDisplay::mode }; const struct wl_compositor_listener QWaylandDisplay::compositorListener = { diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.h b/src/plugins/platforms/wayland/qwaylanddisplay.h index 765be62..4dff24d 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.h +++ b/src/plugins/platforms/wayland/qwaylanddisplay.h @@ -128,7 +128,16 @@ private: static void outputHandleGeometry(void *data, struct wl_output *output, int32_t x, int32_t y, - int32_t width, int32_t height); + int32_t width, int32_t height, + int subpixel, + const char *make, + const char *model); + static void mode(void *data, + struct wl_output *wl_output, + uint32_t flags, + int width, + int height, + int refresh); static void handleVisual(void *data, struct wl_compositor *compositor, diff --git a/src/plugins/platforms/wayland/qwaylandshmsurface.cpp b/src/plugins/platforms/wayland/qwaylandshmsurface.cpp index efc56bb..b24c419 100644 --- a/src/plugins/platforms/wayland/qwaylandshmsurface.cpp +++ b/src/plugins/platforms/wayland/qwaylandshmsurface.cpp @@ -120,7 +120,12 @@ void QWaylandShmWindowSurface::flush(QWidget *widget, const QRegion ®ion, con Q_UNUSED(offset); QWaylandShmWindow *waylandWindow = static_cast<QWaylandShmWindow *>(window()->platformWindow()); Q_ASSERT(waylandWindow->windowType() == QWaylandWindow::Shm); - waylandWindow->damage(region); + QVector<QRect> rects = region.rects(); + for (int i = 0; i < rects.size(); i++) { + const QRect rect = rects.at(i); + wl_buffer_damage(mBuffer->buffer(),rect.x(),rect.y(),rect.width(),rect.height()); + waylandWindow->damage(rect); + } } void QWaylandShmWindowSurface::resize(const QSize &size) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 333a953..e79a712 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -58,6 +58,7 @@ QWaylandWindow::QWaylandWindow(QWidget *window) : QPlatformWindow(window) + , mSurface(0) , mDisplay(QWaylandScreen::waylandScreenFromWidget(window)->display()) , mBuffer(0) , mWaitingForFrameSync(false) @@ -69,8 +70,6 @@ QWaylandWindow::QWaylandWindow(QWidget *window) mDisplay->windowManagerIntegration()->mapClientToProcess(qApp->applicationPid()); mDisplay->windowManagerIntegration()->authenticateWithToken(); #endif - - mSurface = mDisplay->createSurface(this); } QWaylandWindow::~QWaylandWindow() @@ -101,9 +100,7 @@ void QWaylandWindow::setVisible(bool visible) newSurfaceCreated(); } - if (visible) { - wl_surface_map_toplevel(mSurface); - } else { + if (!visible) { wl_surface_destroy(mSurface); mSurface = NULL; } @@ -130,25 +127,25 @@ void QWaylandWindow::attach(QWaylandBuffer *buffer) } } -void QWaylandWindow::damage(const QRegion ®ion) +void QWaylandWindow::damage(const QRect &rect) { //We have to do sync stuff before calling damage, or we might //get a frame callback before we get the timestamp - mDisplay->frameCallback(QWaylandWindow::frameCallback, mSurface, this); - mWaitingForFrameSync = true; - - QVector<QRect> rects = region.rects(); - for (int i = 0; i < rects.size(); i++) { - const QRect rect = rects.at(i); - wl_surface_damage(mSurface, - rect.x(), rect.y(), rect.width(), rect.height()); + if (!mWaitingForFrameSync) { + mDisplay->frameCallback(QWaylandWindow::frameCallback, mSurface, this); + mWaitingForFrameSync = true; } + + wl_surface_damage(mSurface, + rect.x(), rect.y(), rect.width(), rect.height()); } void QWaylandWindow::newSurfaceCreated() { if (mBuffer) { wl_surface_attach(mSurface,mBuffer->buffer(),0,0); + wl_surface_damage(mSurface, + 0,0,mBuffer->size().width(),mBuffer->size().height()); } } diff --git a/src/plugins/platforms/wayland/qwaylandwindow.h b/src/plugins/platforms/wayland/qwaylandwindow.h index b8eae96..b91f6b6 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.h +++ b/src/plugins/platforms/wayland/qwaylandwindow.h @@ -71,7 +71,7 @@ public: int32_t x, int32_t y, int32_t width, int32_t height); void attach(QWaylandBuffer *buffer); - void damage(const QRegion ®ion); + void damage(const QRect &rect); void waitForFrameSync(); diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland/wayland.pro index dca72fd..5b20a87 100644 --- a/src/plugins/platforms/wayland/wayland.pro +++ b/src/plugins/platforms/wayland/wayland.pro @@ -34,7 +34,10 @@ LIBS += $$QMAKE_LIBS_WAYLAND QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND !isEmpty(QMAKE_LFLAGS_RPATH) { - !isEmpty(QMAKE_LIBDIR_WAYLAND):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBDIR_WAYLAND} + WAYLAND_NEEDS_RPATH = $$system(pkg-config --libs-only-L wayland-client) + !isEmpty(WAYLAND_NEEDS_RPATH) { + !isEmpty(QMAKE_LIBDIR_WAYLAND):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBDIR_WAYLAND} + } } INCLUDEPATH += $$PWD diff --git a/src/plugins/platforms/wayland/wayland_sha1.txt b/src/plugins/platforms/wayland/wayland_sha1.txt index d262437..a696e76 100644 --- a/src/plugins/platforms/wayland/wayland_sha1.txt +++ b/src/plugins/platforms/wayland/wayland_sha1.txt @@ -1,3 +1,3 @@ This version of the Qt Wayland plugin is checked against the following sha1 from the Wayland repository: -eff7fc0d99be2e51eaa351785030c8d374ac71de +bfea3d6befdb688d5354e6f15a9400ea637febf9 |