directfb: Use the QPlatformWindow in the DirectFB Backingstore

Remove usage of QDirectFbConvenience::dfbDisplayLayer in the
QDirectFbBackingStore code and resolve the IDirectFBWindow through
the QPlatformWindow.

Change-Id: Ia7db8dedc91096648bc9de029d034002ba0d6a03
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
This commit is contained in:
Holger Hans Peter Freyther 2011-11-21 13:50:48 +01:00 committed by Qt by Nokia
parent 426cda9089
commit c420e1f101
3 changed files with 10 additions and 8 deletions

View File

@ -43,6 +43,7 @@
#include "qdirectfbintegration.h"
#include "qdirectfbblitter.h"
#include "qdirectfbconvenience.h"
#include "qdirectfbwindow.h"
#include <private/qpixmap_blitter_p.h>
#include <QtCore/qdebug.h>
@ -52,15 +53,9 @@ QT_BEGIN_NAMESPACE
QDirectFbBackingStore::QDirectFbBackingStore(QWindow *window)
: QPlatformBackingStore(window), m_pixmap(0), m_pmdata(0)
{
IDirectFBWindow *dfbWindow = static_cast<QDirectFbWindow *>(window->handle())->dfbWindow();
dfbWindow->GetSurface(dfbWindow, m_dfbSurface.outPtr());
QDirectFBPointer<IDirectFBDisplayLayer> layer(QDirectFbConvenience::dfbDisplayLayer());
DFBWindowID id(window->winId());
QDirectFBPointer<IDirectFBWindow> dfbWindow;
layer->GetWindow(layer.data(), id, dfbWindow.outPtr());
dfbWindow->GetSurface(dfbWindow.data(), m_dfbSurface.outPtr());
//WRONGSIZE
QDirectFbBlitter *blitter = new QDirectFbBlitter(window->size(), m_dfbSurface.data());
m_pmdata = new QDirectFbBlitterPlatformPixmap;

View File

@ -194,3 +194,8 @@ bool QDirectFbWindow::setMouseGrabEnabled(bool grab)
return res == DFB_OK;
}
IDirectFBWindow *QDirectFbWindow::dfbWindow() const
{
return m_dfbWindow.data();
}

View File

@ -67,6 +67,8 @@ public:
void lower();
WId winId() const;
IDirectFBWindow *dfbWindow() const;
private:
QDirectFBPointer<IDirectFBWindow> m_dfbWindow;
QDirectFbInput *m_inputHandler;