summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
index eaf7537d32..a11064bc3e 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
@@ -54,29 +54,46 @@ QT_MODULE(Gui)
class QDirectFBPaintDevice : public QCustomRasterPaintDevice
{
public:
- QDirectFBPaintDevice(QDirectFBScreen *scr = QDirectFBScreen::instance())
- : QCustomRasterPaintDevice(0),
- dfbSurface(0),
- lockedImage(0),
- screen(scr) {}
~QDirectFBPaintDevice();
- IDirectFBSurface *directFbSurface() const;
+ IDirectFBSurface *directFBSurface() const;
void lockDirectFB();
void unlockDirectFB();
+ inline bool forceRasterPrimitives() const { return forceRaster; }
+
// Reimplemented from QCustomRasterPaintDevice:
void* memory() const;
QImage::Format format() const;
int bytesPerLine() const;
QSize size() const;
int metric(QPaintDevice::PaintDeviceMetric metric) const;
-
protected:
+ // Shouldn't create QDirectFBPaintDevice by itself but only sub-class it:
+ QDirectFBPaintDevice(QDirectFBScreen *scr = QDirectFBScreen::instance())
+ : QCustomRasterPaintDevice(0),
+ dfbSurface(0),
+ lockedImage(0),
+ screen(scr),
+ forceRaster(false) {}
+
+ inline int dotsPerMeterX() const
+ {
+ return (screen->deviceWidth() * 1000) / screen->physicalWidth();
+ }
+ inline int dotsPerMeterY() const
+ {
+ return (screen->deviceHeight() * 1000) / screen->physicalHeight();
+ }
+
IDirectFBSurface *dfbSurface;
QImage *lockedImage;
QDirectFBScreen *screen;
+ int bpl;
+ bool forceRaster;
+private:
+ Q_DISABLE_COPY(QDirectFBPaintDevice)
};
QT_END_HEADER