summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-07-21 13:50:28 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2011-07-25 13:52:09 +0200
commitc3da77798b876716ce038a30e9aa8517ec158c47 (patch)
tree99ac6cf5ce37fcb626a12857bb18cf9b444b27f2 /src/gui/image
parente80b6619524a3720efb5fbe4c2307bec25a12ab8 (diff)
Added workable QScreen API on top of QPlatformScreen.
QPlatformIntegration::screens() no longer has to be implemented, implementations should call QPlatformIntegration::screenAdded() for each screen instead. This is for being able to support adding screens at run-time later on, by connecting it to a signal in QGuiApplication. The QGuiGLContext API has changed a bit, by not sending in all the parameters in the constructor but instead having a create() function. The createPlatformGLContext() factory in QPlatformIntegration takes a QGuiGLContext * instead of a QSurfaceFormat and a share context, similar to how the window and backing store factory functions work. The XCB plugin has experimental support for connecting to multiple X displays simultaneously, creating one or more QScreen for each. Change-Id: I248a22a4fd3481280710110272c04a30a8021e8f Reviewed-on: http://codereview.qt.nokia.com/2103 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qbitmap.cpp1
-rw-r--r--src/gui/image/qnativeimage.cpp3
-rw-r--r--src/gui/image/qpixmap_blitter.cpp3
-rw-r--r--src/gui/image/qpixmap_qpa.cpp3
4 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp
index c614ba1b0a..f32c517f17 100644
--- a/src/gui/image/qbitmap.cpp
+++ b/src/gui/image/qbitmap.cpp
@@ -42,6 +42,7 @@
#include "qbitmap.h"
#include "qplatformpixmap_qpa.h"
#include "qimage.h"
+#include "qscreen.h"
#include "qvariant.h"
#include <qpainter.h>
#include <private/qguiapplication_p.h>
diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp
index 64104a658e..d0f6c4c7d6 100644
--- a/src/gui/image/qnativeimage.cpp
+++ b/src/gui/image/qnativeimage.cpp
@@ -42,6 +42,7 @@
#include <qdebug.h>
#include "qnativeimage_p.h"
#include "qcolormap.h"
+#include "qscreen.h"
#include "private/qpaintengine_raster_p.h"
@@ -207,7 +208,7 @@ QNativeImage::~QNativeImage()
QImage::Format QNativeImage::systemFormat()
{
- return QGuiApplicationPrivate::platformIntegration()->screens().at(0)->format();
+ return QGuiApplication::primaryScreen()->handle()->format();
}
#endif // platforms
diff --git a/src/gui/image/qpixmap_blitter.cpp b/src/gui/image/qpixmap_blitter.cpp
index 43876419d4..dc0f03abdc 100644
--- a/src/gui/image/qpixmap_blitter.cpp
+++ b/src/gui/image/qpixmap_blitter.cpp
@@ -43,6 +43,7 @@
#include <qpainter.h>
#include <qimage.h>
+#include <qscreen.h>
#include <private/qguiapplication_p.h>
#include <private/qblittable_p.h>
@@ -98,7 +99,7 @@ void QBlittablePlatformPixmap::resize(int width, int height)
delete m_engine;
m_engine = 0;
#ifdef Q_WS_QPA
- d = QGuiApplicationPrivate::platformIntegration()->screens().at(0)->depth();
+ d = QGuiApplication::primaryScreen()->depth();
#endif
w = width;
h = height;
diff --git a/src/gui/image/qpixmap_qpa.cpp b/src/gui/image/qpixmap_qpa.cpp
index 724647f89d..9c69ddef7e 100644
--- a/src/gui/image/qpixmap_qpa.cpp
+++ b/src/gui/image/qpixmap_qpa.cpp
@@ -40,9 +40,10 @@
****************************************************************************/
#include <qpixmap.h>
+#include <qscreen.h>
#include <private/qguiapplication_p.h>
QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h)
{
- return QGuiApplicationPrivate::platformIntegration()->grabWindow(window, x, y, w, h);
+ return QGuiApplication::primaryScreen()->handle()->grabWindow(window, x, y, w, h);
}