[directfb] Remove some duplication in the QDirectFbBlitter c'tor.

Introduce dfb_blitter_capabilities that returns the QBlittable::Capabilities
of the DirectFB blitter.

Change-Id: Ifb803ff4f07376d5333ad2d05ff72d9a63d17fff
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
This commit is contained in:
Holger Hans Peter Freyther 2011-09-26 19:30:37 +02:00 committed by Qt by Nokia
parent 91e99d1420
commit 577d51ee22

View File

@ -48,21 +48,24 @@
#include <directfb.h>
static QBlittable::Capabilities dfb_blitter_capabilities()
{
return QBlittable::Capabilities(QBlittable::SolidRectCapability
|QBlittable::SourcePixmapCapability
|QBlittable::SourceOverPixmapCapability
|QBlittable::SourceOverScaledPixmapCapability);
}
QDirectFbBlitter::QDirectFbBlitter(const QSize &rect, IDirectFBSurface *surface)
: QBlittable(rect, QBlittable::Capabilities(QBlittable::SolidRectCapability
|QBlittable::SourcePixmapCapability
|QBlittable::SourceOverPixmapCapability
|QBlittable::SourceOverScaledPixmapCapability))
: QBlittable(rect, dfb_blitter_capabilities())
, m_surface(surface)
{
m_surface->AddRef(m_surface.data());
}
QDirectFbBlitter::QDirectFbBlitter(const QSize &rect, bool alpha)
: QBlittable(rect, QBlittable::Capabilities(QBlittable::SolidRectCapability
|QBlittable::SourcePixmapCapability
|QBlittable::SourceOverPixmapCapability
|QBlittable::SourceOverScaledPixmapCapability))
: QBlittable(rect, dfb_blitter_capabilities())
{
DFBSurfaceDescription surfaceDesc;
memset(&surfaceDesc,0,sizeof(DFBSurfaceDescription));