summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland/qwaylandshmsurface.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-02-09 14:16:14 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2011-02-09 14:44:06 (GMT)
commitc902dcc8943a2bfcb6432d46303ace46def6fe86 (patch)
tree3c982e3c663f238fe55eb7688a498c69e91769a8 /src/plugins/platforms/wayland/qwaylandshmsurface.cpp
parentf45102d9e53dc1ac8bde83fc27d83834c79cae93 (diff)
downloadQt-c902dcc8943a2bfcb6432d46303ace46def6fe86.zip
Qt-c902dcc8943a2bfcb6432d46303ace46def6fe86.tar.gz
Qt-c902dcc8943a2bfcb6432d46303ace46def6fe86.tar.bz2
Lighthouse: Wayland: Use EGLSurface
Diffstat (limited to 'src/plugins/platforms/wayland/qwaylandshmsurface.cpp')
-rw-r--r--src/plugins/platforms/wayland/qwaylandshmsurface.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandshmsurface.cpp b/src/plugins/platforms/wayland/qwaylandshmsurface.cpp
index 83bb993..9bcae26 100644
--- a/src/plugins/platforms/wayland/qwaylandshmsurface.cpp
+++ b/src/plugins/platforms/wayland/qwaylandshmsurface.cpp
@@ -44,7 +44,7 @@
#include <QtGui/private/qapplication_p.h>
#include "qwaylanddisplay.h"
-#include "qwaylandwindow.h"
+#include "qwaylandshmwindow.h"
#include "qwaylandscreen.h"
#include <wayland-client.h>
@@ -111,23 +111,22 @@ void QWaylandShmWindowSurface::flush(QWidget *widget, const QRegion &region, con
{
Q_UNUSED(widget);
Q_UNUSED(offset);
- QWaylandWindow *ww = (QWaylandWindow *) window()->platformWindow();
- QVector<QRect> rects = region.rects();
- const QRect *r;
- int i;
+ QWaylandShmWindow *waylandWindow = static_cast<QWaylandShmWindow *>(window()->platformWindow());
+ Q_ASSERT(waylandWindow->windowType() == QWaylandWindow::Shm);
- for (i = 0; i < rects.size(); i++) {
- r = &rects.at(i);
- wl_surface_damage(ww->surface(),
- r->x(), r->y(), r->width(), r->height());
+ QVector<QRect> rects = region.rects();
+ for (int i = 0; i < rects.size(); i++) {
+ waylandWindow->damage(rects.at(i));
}
}
void QWaylandShmWindowSurface::resize(const QSize &size)
{
- QWaylandWindow *ww = (QWaylandWindow *) window()->platformWindow();
+ QWaylandShmWindow *waylandWindow = static_cast<QWaylandShmWindow *>(window()->platformWindow());
+ Q_ASSERT(waylandWindow->windowType() == QWaylandWindow::Shm);
+
QWindowSurface::resize(size);
- QImage::Format format = QApplicationPrivate::platformIntegration()->screens().first()->format();
+ QImage::Format format = QPlatformScreen::platformScreenForWidget(window())->format();
if (mBuffer != NULL && mBuffer->size() == size)
return;
@@ -137,7 +136,7 @@ void QWaylandShmWindowSurface::resize(const QSize &size)
mBuffer = new QWaylandShmBuffer(mDisplay, size, format);
- ww->attach(mBuffer);
+ waylandWindow->attach(mBuffer);
}
QT_END_NAMESPACE