diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-20 13:29:26 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-21 09:04:01 +0200 |
commit | 6ce6b8a378b0d97ba950240ffb048a4b7e485235 (patch) | |
tree | d94ca9d082e61ffe93c2756f69a4d99e5df42d94 /examples/qpa | |
parent | 891a86f0f3b0664162642ee1d6aa3078f16695d1 (diff) |
Rename QWindowSurface -> QBackingStore and split into platform / public.
Also get rid of GL window surface and related classes.
Diffstat (limited to 'examples/qpa')
-rw-r--r-- | examples/qpa/windows/window.cpp | 14 | ||||
-rw-r--r-- | examples/qpa/windows/window.h | 1 |
2 files changed, 8 insertions, 7 deletions
diff --git a/examples/qpa/windows/window.cpp b/examples/qpa/windows/window.cpp index 76bc117793..0a38d8e43d 100644 --- a/examples/qpa/windows/window.cpp +++ b/examples/qpa/windows/window.cpp @@ -1,8 +1,8 @@ #include "window.h" #include <private/qguiapplication_p.h> -#include <private/qwindowsurface_p.h> +#include <QBackingStore> #include <QPainter> static int colorIndexId = 0; @@ -33,7 +33,7 @@ Window::Window(QWindow *parent) } create(); - QGuiApplicationPrivate::platformIntegration()->createWindowSurface(this, winId()); + m_backingStore = new QBackingStore(this); m_image = QImage(geometry().size(), QImage::Format_RGB32); m_image.fill(colorTable[m_backgroundColorIndex % (sizeof(colorTable) / sizeof(colorTable[0]))].rgba()); @@ -110,11 +110,11 @@ void Window::keyPressEvent(QKeyEvent *event) void Window::render() { QRect rect(QPoint(), geometry().size()); - surface()->resize(rect.size()); + m_backingStore->resize(rect.size()); - surface()->beginPaint(rect); + m_backingStore->beginPaint(rect); - QPaintDevice *device = surface()->paintDevice(); + QPaintDevice *device = m_backingStore->paintDevice(); QPainter p(device); p.drawImage(0, 0, m_image); @@ -125,8 +125,8 @@ void Window::render() p.setFont(font); p.drawText(rect, 0, m_text); - surface()->endPaint(rect); - surface()->flush(this, rect, QPoint()); + m_backingStore->endPaint(); + m_backingStore->flush(rect); } diff --git a/examples/qpa/windows/window.h b/examples/qpa/windows/window.h index f0b7d80531..f716145f94 100644 --- a/examples/qpa/windows/window.h +++ b/examples/qpa/windows/window.h @@ -22,4 +22,5 @@ private: QImage m_image; QPoint m_lastPos; int m_backgroundColorIndex; + QBackingStore *m_backingStore; }; |