summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qgraphicssystem_pepper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qgraphicssystem_pepper.cpp')
-rw-r--r--src/gui/painting/qgraphicssystem_pepper.cpp45
1 files changed, 28 insertions, 17 deletions
diff --git a/src/gui/painting/qgraphicssystem_pepper.cpp b/src/gui/painting/qgraphicssystem_pepper.cpp
index 2d6b666ebc..9215614e2b 100644
--- a/src/gui/painting/qgraphicssystem_pepper.cpp
+++ b/src/gui/painting/qgraphicssystem_pepper.cpp
@@ -43,7 +43,6 @@
#include "qwindowsurface_pepper.h"
#include <QtGui/private/qpixmap_raster_p.h>
#include <peppermain.h>
-#include <plugin_object.h>
#include <stdio.h>
@@ -55,25 +54,11 @@ QPepperGraphicsSystem::QPepperGraphicsSystem()
{
qDebug() << "QPepperGraphicsSystem::QPepperGraphicsSystem()";
mPrimaryScreen = new QPepperGraphicsSystemScreen();
-
-
- QSize screenSize(plugin_object->width_, plugin_object->height_);
- qDebug() << "QPepperGraphicsSystem screen size" << screenSize;
-
- mPrimaryScreen->mGeometry = QRect(QPoint(0, 0), screenSize);
- mPrimaryScreen->mPhysicalSize = screenSize / 3;
- mPrimaryScreen->device = plugin_object->device2d_;
- mPrimaryScreen->context = plugin_object->context;
- mPrimaryScreen->npp = plugin_object->npp_;
-
+ extern QPepperGraphicsSystemScreen *qt_pepper_screen;
+ qt_pepper_screen = mPrimaryScreen;
mScreens.append(mPrimaryScreen);
}
-QPepperGraphicsSystemScreen::~QPepperGraphicsSystemScreen()
-{
-
-}
-
QPixmapData *QPepperGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const
{
return new QRasterPixmapData(type);
@@ -84,4 +69,30 @@ QWindowSurface *QPepperGraphicsSystem::createWindowSurface(QWidget *widget) cons
return new QPepperWindowSurface(mPrimaryScreen, widget);
}
+QPepperGraphicsSystemScreen::QPepperGraphicsSystemScreen()
+ : mDepth(32), mFormat(QImage::Format_ARGB32_Premultiplied)
+{
+ setupScreen();
+}
+
+void QPepperGraphicsSystemScreen::setupScreen()
+{
+ QSize screenSize(plugin_object->width_, plugin_object->height_);
+ // qDebug() << "QPepperGraphicsSystem screen size" << screenSize;
+
+ mGeometry = QRect(QPoint(0, 0), screenSize);
+ mPhysicalSize = screenSize / 3;
+ device = plugin_object->device2d_;
+ npp = plugin_object->npp_;
+
+ NPDeviceContext2DConfig config;
+ device->initializeContext(npp, &config, &context);
+ device->flushContext(npp, &context, NULL, NULL); // ### should sync here, like QPepperWindowSurface::flush
+}
+
+QPepperGraphicsSystemScreen::~QPepperGraphicsSystemScreen()
+{
+
+}
+
QT_END_NAMESPACE