diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2010-09-06 07:54:59 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2010-09-10 10:44:55 (GMT) |
commit | dc61fc45601000626169409443fdeac6a3cd31af (patch) | |
tree | a62e4919e4637f2152be5483b73098cb4e2fe426 /src/plugins/graphicssystems/meego/qmeegographicssystem.cpp | |
parent | 5d6ceabf3aa9d07f31f0a06d20b76c122973d3b9 (diff) | |
download | Qt-dc61fc45601000626169409443fdeac6a3cd31af.zip Qt-dc61fc45601000626169409443fdeac6a3cd31af.tar.gz Qt-dc61fc45601000626169409443fdeac6a3cd31af.tar.bz2 |
Fixed compilation and API of meego graphics system.
Diffstat (limited to 'src/plugins/graphicssystems/meego/qmeegographicssystem.cpp')
-rw-r--r-- | src/plugins/graphicssystems/meego/qmeegographicssystem.cpp | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp index e4a8210..e575cf3 100644 --- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp +++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp @@ -13,44 +13,44 @@ ****************************************************************************/ #include <QDebug> -#include "../private/qpixmap_raster_p.h" -#include "../private/qwindowsurface_gl_p.h" -#include "../private/qegl_p.h" -#include "../private/qglextensions_p.h" -#include "../private/qgl_p.h" -#include "../private/qimagepixmapcleanuphooks_p.h" -#include "../private/qapplication_p.h" -#include "../private/qgraphicssystem_runtime_p.h" -#include "../private/qimage_p.h" -#include "../private/qeglproperties_p.h" -#include "../private/qeglcontext_p.h" - -#include "mpixmapdata.h" -#include "mgraphicssystem.h" -#include "mextensions.h" - -bool MGraphicsSystem::surfaceWasCreated = false; - -MGraphicsSystem::MGraphicsSystem() +#include <private/qpixmap_raster_p.h> +#include <private/qwindowsurface_gl_p.h> +#include <private/qegl_p.h> +#include <private/qglextensions_p.h> +#include <private/qgl_p.h> +#include <private/qimagepixmapcleanuphooks_p.h> +#include <private/qapplication_p.h> +#include <private/qgraphicssystem_runtime_p.h> +#include <private/qimage_p.h> +#include <private/qeglproperties_p.h> +#include <private/qeglcontext_p.h> + +#include "qmeegopixmapdata.h" +#include "qmeegographicssystem.h" +#include "qmeegoextensions.h" + +bool QMeeGoGraphicsSystem::surfaceWasCreated = false; + +QMeeGoGraphicsSystem::QMeeGoGraphicsSystem() { qDebug("Using the meego graphics system"); } -MGraphicsSystem::~MGraphicsSystem() +QMeeGoGraphicsSystem::~QMeeGoGraphicsSystem() { qDebug("Meego graphics system destroyed"); qt_destroy_gl_share_widget(); } -QWindowSurface* MGraphicsSystem::createWindowSurface(QWidget *widget) const +QWindowSurface* QMeeGoGraphicsSystem::createWindowSurface(QWidget *widget) const { - MGraphicsSystem::surfaceWasCreated = true; + QMeeGoGraphicsSystem::surfaceWasCreated = true; QWindowSurface *surface = new QGLWindowSurface(widget); surface->window()->setAttribute(Qt::WA_NoSystemBackground); return surface; } -QPixmapData *MGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const +QPixmapData *QMeeGoGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const { // Long story short: without this it's possible to hit an // unitialized paintDevice due to a Qt bug too complex to even @@ -61,7 +61,7 @@ QPixmapData *MGraphicsSystem::createPixmapData(QPixmapData::PixelType type) cons return new QRasterPixmapData(type); } -QPixmapData *MGraphicsSystem::createPixmapData(QPixmapData *origin) +QPixmapData *QMeeGoGraphicsSystem::createPixmapData(QPixmapData *origin) { // If the pixmap is a raster type... // and if the pixmap pointer matches our mapping... @@ -71,14 +71,14 @@ QPixmapData *MGraphicsSystem::createPixmapData(QPixmapData *origin) QRasterPixmapData *rasterClass = static_cast <QRasterPixmapData *> (origin); void *rawResource = static_cast <void *> (rasterClass->buffer()->data_ptr()->data); - if (MPixmapData::sharedImagesMap.contains(rawResource)) - return new MPixmapData(); + if (QMeeGoPixmapData::sharedImagesMap.contains(rawResource)) + return new QMeeGoPixmapData(); } return new QRasterPixmapData(origin->pixelType()); } -QPixmapData* MGraphicsSystem::wrapPixmapData(QPixmapData *pmd) +QPixmapData* QMeeGoGraphicsSystem::wrapPixmapData(QPixmapData *pmd) { QString name = QApplicationPrivate::instance()->graphics_system_name; if (name == "runtime") { @@ -92,9 +92,9 @@ QPixmapData* MGraphicsSystem::wrapPixmapData(QPixmapData *pmd) return pmd; } -void MGraphicsSystem::setSurfaceFixedSize(int /*width*/, int /*height*/) +void QMeeGoGraphicsSystem::setSurfaceFixedSize(int /*width*/, int /*height*/) { - if (MGraphicsSystem::surfaceWasCreated) + if (QMeeGoGraphicsSystem::surfaceWasCreated) qWarning("Trying to set surface fixed size but surface already created!"); #ifdef QT_WAS_PATCHED @@ -105,20 +105,20 @@ void MGraphicsSystem::setSurfaceFixedSize(int /*width*/, int /*height*/) #endif } -void MGraphicsSystem::setSurfaceScaling(int x, int y, int width, int height) +void QMeeGoGraphicsSystem::setSurfaceScaling(int x, int y, int width, int height) { - MExtensions::ensureInitialized(); - MExtensions::eglSetSurfaceScalingNOK(QEgl::display(), QEglContext::currentContext(QEgl::OpenGL)->currentSurface, x, y, width, height); + QMeeGoExtensions::ensureInitialized(); + QMeeGoExtensions::eglSetSurfaceScalingNOK(QEgl::display(), QEglContext::currentContext(QEgl::OpenGL)->currentSurface, x, y, width, height); } -void MGraphicsSystem::setTranslucent(bool translucent) +void QMeeGoGraphicsSystem::setTranslucent(bool translucent) { QGLWindowSurface::surfaceFormat.setSampleBuffers(false); QGLWindowSurface::surfaceFormat.setSamples(0); QGLWindowSurface::surfaceFormat.setAlpha(translucent); } -QPixmapData *MGraphicsSystem::pixmapDataFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage) +QPixmapData *QMeeGoGraphicsSystem::pixmapDataFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage) { if (softImage.format() != QImage::Format_ARGB32_Premultiplied && softImage.format() != QImage::Format_ARGB32) { @@ -126,10 +126,10 @@ QPixmapData *MGraphicsSystem::pixmapDataFromEGLSharedImage(Qt::HANDLE handle, co return NULL; } - if (MGraphicsSystem::meegoRunning()) { - MPixmapData *pmd = new MPixmapData; + if (QMeeGoGraphicsSystem::meeGoRunning()) { + QMeeGoPixmapData *pmd = new QMeeGoPixmapData; pmd->fromEGLSharedImage(handle, softImage); - return MGraphicsSystem::wrapPixmapData(pmd); + return QMeeGoGraphicsSystem::wrapPixmapData(pmd); } else { QRasterPixmapData *pmd = new QRasterPixmapData(QPixmapData::PixmapType); pmd->fromImage(softImage, Qt::NoOpaqueDetection); @@ -139,30 +139,30 @@ QPixmapData *MGraphicsSystem::pixmapDataFromEGLSharedImage(Qt::HANDLE handle, co const_cast<QImage &>(softImage).data_ptr()->data) qFatal("Iternal misalignment of raster data detected. Prolly a QImage copy fail."); - MPixmapData::registerSharedImage(handle, softImage); - return MGraphicsSystem::wrapPixmapData(pmd); + QMeeGoPixmapData::registerSharedImage(handle, softImage); + return QMeeGoGraphicsSystem::wrapPixmapData(pmd); } } -void MGraphicsSystem::updateEGLSharedImagePixmap(QPixmap *pixmap) +void QMeeGoGraphicsSystem::updateEGLSharedImagePixmap(QPixmap *pixmap) { - MPixmapData *pmd = (MPixmapData *) pixmap->pixmapData(); + QMeeGoPixmapData *pmd = (QMeeGoPixmapData *) pixmap->pixmapData(); - // Basic sanity check to make sure this is really a MPixmapData... + // Basic sanity check to make sure this is really a QMeeGoPixmapData... if (pmd->classId() != QPixmapData::OpenGLClass) qFatal("Trying to updated EGLSharedImage pixmap but it's not really a shared image pixmap!"); pmd->updateFromSoftImage(); } -QPixmapData *MGraphicsSystem::pixmapDataWithGLTexture(int w, int h) +QPixmapData *QMeeGoGraphicsSystem::pixmapDataWithGLTexture(int w, int h) { QGLPixmapData *pmd = new QGLPixmapData(QPixmapData::PixmapType); pmd->resize(w, h); - return MGraphicsSystem::wrapPixmapData(pmd); + return QMeeGoGraphicsSystem::wrapPixmapData(pmd); } -bool MGraphicsSystem::meegoRunning() +bool QMeeGoGraphicsSystem::meeGoRunning() { if (! QApplicationPrivate::instance()) { qWarning("Application not running just yet... hard to know what system running!"); @@ -180,42 +180,42 @@ bool MGraphicsSystem::meegoRunning() /* C API */ -int m_image_to_egl_shared_image(const QImage &image) +int qt_meego_image_to_egl_shared_image(const QImage &image) { - return MPixmapData::imageToEGLSharedImage(image); + return QMeeGoPixmapData::imageToEGLSharedImage(image); } -QPixmapData* m_pixmapdata_from_egl_shared_image(Qt::HANDLE handle, const QImage &softImage) +QPixmapData* qt_meego_pixmapdata_from_egl_shared_image(Qt::HANDLE handle, const QImage &softImage) { - return MGraphicsSystem::pixmapDataFromEGLSharedImage(handle, softImage); + return QMeeGoGraphicsSystem::pixmapDataFromEGLSharedImage(handle, softImage); } -QPixmapData* m_pixmapdata_with_gl_texture(int w, int h) +QPixmapData* qt_meego_pixmapdata_with_gl_texture(int w, int h) { - return MGraphicsSystem::pixmapDataWithGLTexture(w, h); + return QMeeGoGraphicsSystem::pixmapDataWithGLTexture(w, h); } -bool m_destroy_egl_shared_image(Qt::HANDLE handle) +bool qt_meego_destroy_egl_shared_image(Qt::HANDLE handle) { - return MPixmapData::destroyEGLSharedImage(handle); + return QMeeGoPixmapData::destroyEGLSharedImage(handle); } -void m_set_surface_fixed_size(int width, int height) +void qt_meego_set_surface_fixed_size(int width, int height) { - MGraphicsSystem::setSurfaceFixedSize(width, height); + QMeeGoGraphicsSystem::setSurfaceFixedSize(width, height); } -void m_set_surface_scaling(int x, int y, int width, int height) +void qt_meego_set_surface_scaling(int x, int y, int width, int height) { - MGraphicsSystem::setSurfaceScaling(x, y, width, height); + QMeeGoGraphicsSystem::setSurfaceScaling(x, y, width, height); } -void m_set_translucent(bool translucent) +void qt_meego_set_translucent(bool translucent) { - MGraphicsSystem::setTranslucent(translucent); + QMeeGoGraphicsSystem::setTranslucent(translucent); } -void m_update_egl_shared_image_pixmap(QPixmap *pixmap) +void qt_meego_update_egl_shared_image_pixmap(QPixmap *pixmap) { - MGraphicsSystem::updateEGLSharedImagePixmap(pixmap); + QMeeGoGraphicsSystem::updateEGLSharedImagePixmap(pixmap); } |