Rename QWindowSurface -> QBackingStore and split into platform / public.
authorSamuel Rødal <samuel.rodal@nokia.com>
Mon, 20 Jun 2011 11:29:26 +0000 (13:29 +0200)
committerSamuel Rødal <samuel.rodal@nokia.com>
Tue, 21 Jun 2011 07:04:01 +0000 (09:04 +0200)
Also get rid of GL window surface and related classes.

src/plugins/platforms/wayland/qwaylandcursor.cpp
src/plugins/platforms/wayland/qwaylandintegration.cpp
src/plugins/platforms/wayland/qwaylandintegration.h
src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp [moved from src/plugins/platforms/wayland/qwaylandshmsurface.cpp with 89% similarity]
src/plugins/platforms/wayland/qwaylandshmbackingstore.h [moved from src/plugins/platforms/wayland/qwaylandshmsurface.h with 88% similarity]
src/plugins/platforms/wayland/wayland.pro

index d69d618..6612d67 100644 (file)
@@ -43,8 +43,8 @@
 
 #include "qwaylanddisplay.h"
 #include "qwaylandinputdevice.h"
-#include "qwaylandshmsurface.h"
 #include "qwaylandscreen.h"
+#include "qwaylandshmbackingstore.h"
 
 #include <QtGui/QImageReader>
 
index 090edfe..9cd79e2 100644 (file)
@@ -42,7 +42,7 @@
 #include "qwaylandintegration.h"
 
 #include "qwaylanddisplay.h"
-#include "qwaylandshmsurface.h"
+#include "qwaylandshmbackingstore.h"
 #include "qwaylandshmwindow.h"
 #include "qwaylandnativeinterface.h"
 #include "qwaylandclipboard.h"
@@ -116,10 +116,9 @@ QPlatformGLContext *QWaylandIntegration::createPlatformGLContext(const QGuiGLFor
 #endif
 }
 
-QWindowSurface *QWaylandIntegration::createWindowSurface(QWindow *window, WId winId) const
+QPlatformBackingStore *QWaylandIntegration::createPlatformBackingStore(QWindow *window) const
 {
-    Q_UNUSED(winId);
-    return new QWaylandShmWindowSurface(window);
+    return new QWaylandShmBackingStore(window);
 }
 
 QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const
index e55dec3..1e22191 100644 (file)
@@ -58,7 +58,7 @@ public:
     QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
     QPlatformWindow *createPlatformWindow(QWindow *window) const;
     QPlatformGLContext *createPlatformGLContext(const QGuiGLFormat &glFormat, QPlatformGLContext *share) const;
-    QWindowSurface *createWindowSurface(QWindow *window, WId winId) const;
+    QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
 
     QList<QPlatformScreen *> screens() const;
 
@@ -38,7 +38,7 @@
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
-#include "qwaylandshmsurface.h"
+#include "qwaylandshmbackingstore.h"
 
 #include <QtCore/qdebug.h>
 
@@ -90,30 +90,30 @@ QWaylandShmBuffer::~QWaylandShmBuffer(void)
     wl_buffer_destroy(mBuffer);
 }
 
-QWaylandShmWindowSurface::QWaylandShmWindowSurface(QWindow *window)
-    : QWindowSurface(window)
+QWaylandShmBackingStore::QWaylandShmBackingStore(QWindow *window)
+    : QPlatformBackingStore(window)
     , mBuffer(0)
     , mDisplay(QWaylandScreen::waylandScreenFromWindow(window)->display())
 {
 }
 
-QWaylandShmWindowSurface::~QWaylandShmWindowSurface()
+QWaylandShmBackingStore::~QWaylandShmBackingStore()
 {
 }
 
-QPaintDevice *QWaylandShmWindowSurface::paintDevice()
+QPaintDevice *QWaylandShmBackingStore::paintDevice()
 {
     return mBuffer->image();
 }
 
-void QWaylandShmWindowSurface::beginPaint(const QRegion &)
+void QWaylandShmBackingStore::beginPaint(const QRegion &)
 {
     QWaylandShmWindow *waylandWindow = static_cast<QWaylandShmWindow *>(window()->handle());
     Q_ASSERT(waylandWindow->windowType() == QWaylandWindow::Shm);
     waylandWindow->waitForFrameSync();
 }
 
-void QWaylandShmWindowSurface::flush(QWindow *window, const QRegion &region, const QPoint &offset)
+void QWaylandShmBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
 {
     Q_UNUSED(window);
     Q_UNUSED(offset);
@@ -122,12 +122,11 @@ void QWaylandShmWindowSurface::flush(QWindow *window, const QRegion &region, con
     waylandWindow->damage(region);
 }
 
-void QWaylandShmWindowSurface::resize(const QSize &size)
+void QWaylandShmBackingStore::resize(const QSize &size, const QRegion &)
 {
     QWaylandShmWindow *waylandWindow = static_cast<QWaylandShmWindow *>(window()->handle());
     Q_ASSERT(waylandWindow->windowType() == QWaylandWindow::Shm);
 
-    QWindowSurface::resize(size);
     QImage::Format format = QPlatformScreen::platformScreenForWindow(window())->format();
 
     if (mBuffer != NULL && mBuffer->size() == size)
 **
 ****************************************************************************/
 
-#ifndef QWINDOWSURFACE_WAYLAND_H
-#define QWINDOWSURFACE_WAYLAND_H
+#ifndef QWAYLANDSHMBACKINGSTORE_H
+#define QWAYLANDSHMBACKINGSTORE_H
 
 #include "qwaylandbuffer.h"
-#include <QtGui/private/qwindowsurface_p.h>
+#include <QtGui/QPlatformBackingStore>
 #include <QtGui/QImage>
 #include <QtGui/QPlatformWindow>
 
@@ -62,15 +62,15 @@ private:
     QImage mImage;
 };
 
-class QWaylandShmWindowSurface : public QWindowSurface
+class QWaylandShmBackingStore : public QPlatformBackingStore
 {
 public:
-    QWaylandShmWindowSurface(QWindow *window);
-    ~QWaylandShmWindowSurface();
+    QWaylandShmBackingStore(QWindow *window);
+    ~QWaylandShmBackingStore();
 
     QPaintDevice *paintDevice();
     void flush(QWindow *window, const QRegion &region, const QPoint &offset);
-    void resize(const QSize &size);
+    void resize(const QSize &size, const QRegion &staticContents);
     void beginPaint(const QRegion &);
 
 private:
index 0a2084d..9010439 100644 (file)
@@ -13,7 +13,7 @@ QT += core-private gui-private opengl-private platformsupport-private
 SOURCES =   main.cpp \
             qwaylandintegration.cpp \
             qwaylandnativeinterface.cpp \
-            qwaylandshmsurface.cpp \
+            qwaylandshmbackingstore.cpp \
             qwaylandinputdevice.cpp \
             qwaylandcursor.cpp \
             qwaylanddisplay.cpp \
@@ -28,7 +28,7 @@ HEADERS =   qwaylandintegration.h \
             qwaylanddisplay.h \
             qwaylandwindow.h \
             qwaylandscreen.h \
-            qwaylandshmsurface.h \
+            qwaylandshmbackingstore.h \
             qwaylandbuffer.h \
             qwaylandshmwindow.h \
             qwaylandclipboard.h