From 6ce6b8a378b0d97ba950240ffb048a4b7e485235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 20 Jun 2011 13:29:26 +0200 Subject: Rename QWindowSurface -> QBackingStore and split into platform / public. Also get rid of GL window surface and related classes. --- examples/qpa/windows/window.cpp | 14 +++++++------- examples/qpa/windows/window.h | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'examples') 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 -#include +#include #include 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; }; -- cgit v1.2.3