Qt 4.8
Public Functions | Properties | List of all members
QCustomRasterPaintDevice Class Reference

The QCustomRasterPaintDevice class is provided to activate hardware accelerated paint engines in Qt for Embedded Linux. More...

#include <qpaintengine_raster_p.h>

Inheritance diagram for QCustomRasterPaintDevice:
QPaintDevice QDirectFBPaintDevice QDirectFBPixmapData QDirectFBWindowSurface

Public Functions

virtual int bytesPerLine () const
 Returns the number of bytes per line in the framebuffer. More...
 
int devType () const
 
virtual QImage::Format format () const
 Returns the format of the device's memory buffet. More...
 
virtual void * memory () const
 Returns a pointer to the paint device's memory buffer, or 0 if no such buffer exists. More...
 
virtual int metric (PaintDeviceMetric m) const
 Reimplemented Function More...
 
 QCustomRasterPaintDevice (QWidget *w)
 Constructs a custom raster based paint device for the given top-level widget. More...
 
virtual QSize size () const
 
- Public Functions inherited from QPaintDevice
int colorCount () const
 
int depth () const
 
virtual HDC getDC () const
 
int height () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
QT_DEPRECATED int numColors () const
 
virtual QPaintEnginepaintEngine () const =0
 
bool paintingActive () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
virtual void releaseDC (HDC hdc) const
 
int width () const
 
int widthMM () const
 
virtual ~QPaintDevice ()
 

Properties

QWidgetwidget
 

Additional Inherited Members

- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric {
  PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM,
  PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY,
  PdmPhysicalDpiX, PdmPhysicalDpiY
}
 
- Static Public Functions inherited from QPaintDevice
static QWSDisplayqwsDisplay ()
 
- Protected Functions inherited from QPaintDevice
 QPaintDevice ()
 
- Protected Variables inherited from QPaintDevice
ushort painters
 

Detailed Description

The QCustomRasterPaintDevice class is provided to activate hardware accelerated paint engines in Qt for Embedded Linux.

This function is under development and subject to change.

Since
4.2

Note that this class is only available in Qt for Embedded Linux.

In Qt for Embedded Linux, painting is a pure software implementation. But starting with Qt 4.2, it is possible to add an accelerated graphics driver to take advantage of available hardware resources.

Hardware acceleration is accomplished by creating a custom screen driver, accelerating the copying from memory to the screen, and implementing a custom paint engine accelerating the various painting operations. Then a custom paint device (derived from the QCustomRasterPaintDevice class) and a custom window surface (derived from QWSWindowSurface) must be implemented to make Qt for Embedded Linux aware of the accelerated driver.

See the Adding an Accelerated Graphics Driver to Qt for Embedded Linux documentation for details.

See also
QRasterPaintEngine, QPaintDevice

Definition at line 468 of file qpaintengine_raster_p.h.

Constructors and Destructors

◆ QCustomRasterPaintDevice()

QCustomRasterPaintDevice::QCustomRasterPaintDevice ( QWidget w)
inline

Constructs a custom raster based paint device for the given top-level widget.

Definition at line 471 of file qpaintengine_raster_p.h.

Functions

◆ bytesPerLine()

int QCustomRasterPaintDevice::bytesPerLine ( ) const
virtual

Returns the number of bytes per line in the framebuffer.

Note that this number might be larger than the framebuffer width.

Reimplemented in QDirectFBPaintDevice.

Definition at line 3983 of file qpaintengine_raster.cpp.

Referenced by QRasterBuffer::prepare().

3984 {
3985  return (width() * depth() + 7) / 8;
3986 }
int width() const
Definition: qpaintdevice.h:91
int depth() const
Definition: qpaintdevice.h:103

◆ devType()

int QCustomRasterPaintDevice::devType ( ) const
inlinevirtual
Warning
This function is not part of the public interface.

Reimplemented from QPaintDevice.

Definition at line 473 of file qpaintengine_raster_p.h.

◆ format()

QImage::Format QCustomRasterPaintDevice::format ( ) const
inlinevirtual

Returns the format of the device's memory buffet.

The default format is QImage::Format_ARGB32_Premultiplied. The only other valid format is QImage::Format_RGB16.

Reimplemented in QDirectFBPaintDevice.

Definition at line 479 of file qpaintengine_raster_p.h.

Referenced by QRasterBuffer::prepare().

◆ memory()

void * QCustomRasterPaintDevice::memory ( ) const
inlinevirtual

Returns a pointer to the paint device's memory buffer, or 0 if no such buffer exists.

Reimplemented in QDirectFBPaintDevice.

Definition at line 477 of file qpaintengine_raster_p.h.

Referenced by QRasterBuffer::prepare().

477 { return 0; }

◆ metric()

int QCustomRasterPaintDevice::metric ( PaintDeviceMetric  m) const
virtual

Reimplemented Function

Reimplemented from QPaintDevice.

Reimplemented in QDirectFBPixmapData, and QDirectFBPaintDevice.

Definition at line 3969 of file qpaintengine_raster.cpp.

3970 {
3971  switch (m) {
3972  case PdmWidth:
3973  return widget->frameGeometry().width();
3974  case PdmHeight:
3975  return widget->frameGeometry().height();
3976  default:
3977  break;
3978  }
3979 
3980  return qt_paint_device_metric(widget, m);
3981 }
QRect frameGeometry
geometry of the widget relative to its parent including any window frame
Definition: qwidget.h:159
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
friend Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, PaintDeviceMetric metric)

◆ size()

QSize QCustomRasterPaintDevice::size ( ) const
inlinevirtual
Warning
This function is not part of the public interface.

Reimplemented in QDirectFBPaintDevice.

Definition at line 485 of file qpaintengine_raster_p.h.

485  {
486  return static_cast<QRasterPaintEngine*>(paintEngine())->size();
487  }
virtual QPaintEngine * paintEngine() const =0
The QRasterPaintEngine class enables hardware acceleration of painting operations in Qt for Embedded ...
virtual QSize size() const

Properties

◆ widget

QWidget* QCustomRasterPaintDevice::widget
private

Definition at line 490 of file qpaintengine_raster_p.h.


The documentation for this class was generated from the following files: