From: Samuel Rødal Date: Mon, 20 Jun 2011 11:29:26 +0000 (+0200) Subject: Rename QWindowSurface -> QBackingStore and split into platform / public. X-Git-Tag: qt-v5.0.0-alpha1~222^2^2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c966959baeb7f49b962be6f8fda00e4c2c82537e;p=profile%2Fivi%2Fqtwayland.git Rename QWindowSurface -> QBackingStore and split into platform / public. Also get rid of GL window surface and related classes. --- diff --git a/src/plugins/platforms/wayland/qwaylandcursor.cpp b/src/plugins/platforms/wayland/qwaylandcursor.cpp index d69d618..6612d67 100644 --- a/src/plugins/platforms/wayland/qwaylandcursor.cpp +++ b/src/plugins/platforms/wayland/qwaylandcursor.cpp @@ -43,8 +43,8 @@ #include "qwaylanddisplay.h" #include "qwaylandinputdevice.h" -#include "qwaylandshmsurface.h" #include "qwaylandscreen.h" +#include "qwaylandshmbackingstore.h" #include diff --git a/src/plugins/platforms/wayland/qwaylandintegration.cpp b/src/plugins/platforms/wayland/qwaylandintegration.cpp index 090edfe..9cd79e2 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.cpp +++ b/src/plugins/platforms/wayland/qwaylandintegration.cpp @@ -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 diff --git a/src/plugins/platforms/wayland/qwaylandintegration.h b/src/plugins/platforms/wayland/qwaylandintegration.h index e55dec3..1e22191 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.h +++ b/src/plugins/platforms/wayland/qwaylandintegration.h @@ -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 screens() const; diff --git a/src/plugins/platforms/wayland/qwaylandshmsurface.cpp b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp similarity index 89% rename from src/plugins/platforms/wayland/qwaylandshmsurface.cpp rename to src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp index 5206338..ccb50a7 100644 --- a/src/plugins/platforms/wayland/qwaylandshmsurface.cpp +++ b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "qwaylandshmsurface.h" +#include "qwaylandshmbackingstore.h" #include @@ -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(window()->handle()); Q_ASSERT(waylandWindow->windowType() == QWaylandWindow::Shm); waylandWindow->waitForFrameSync(); } -void QWaylandShmWindowSurface::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) +void QWaylandShmBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) { Q_UNUSED(window); Q_UNUSED(offset); @@ -122,12 +122,11 @@ void QWaylandShmWindowSurface::flush(QWindow *window, const QRegion ®ion, con waylandWindow->damage(region); } -void QWaylandShmWindowSurface::resize(const QSize &size) +void QWaylandShmBackingStore::resize(const QSize &size, const QRegion &) { QWaylandShmWindow *waylandWindow = static_cast(window()->handle()); Q_ASSERT(waylandWindow->windowType() == QWaylandWindow::Shm); - QWindowSurface::resize(size); QImage::Format format = QPlatformScreen::platformScreenForWindow(window())->format(); if (mBuffer != NULL && mBuffer->size() == size) diff --git a/src/plugins/platforms/wayland/qwaylandshmsurface.h b/src/plugins/platforms/wayland/qwaylandshmbackingstore.h similarity index 88% rename from src/plugins/platforms/wayland/qwaylandshmsurface.h rename to src/plugins/platforms/wayland/qwaylandshmbackingstore.h index 1045709..5e6959d 100644 --- a/src/plugins/platforms/wayland/qwaylandshmsurface.h +++ b/src/plugins/platforms/wayland/qwaylandshmbackingstore.h @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#ifndef QWINDOWSURFACE_WAYLAND_H -#define QWINDOWSURFACE_WAYLAND_H +#ifndef QWAYLANDSHMBACKINGSTORE_H +#define QWAYLANDSHMBACKINGSTORE_H #include "qwaylandbuffer.h" -#include +#include #include #include @@ -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 ®ion, const QPoint &offset); - void resize(const QSize &size); + void resize(const QSize &size, const QRegion &staticContents); void beginPaint(const QRegion &); private: diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland/wayland.pro index 0a2084d..9010439 100644 --- a/src/plugins/platforms/wayland/wayland.pro +++ b/src/plugins/platforms/wayland/wayland.pro @@ -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