diff options
author | Michael Dominic K <mdk@codethink.co.uk> | 2010-10-18 14:49:30 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2010-10-18 14:49:30 (GMT) |
commit | b67105aad0295b41112dc504e37daf5e388b0da8 (patch) | |
tree | db1d9794edf9632bf61b5eab35812f2999610962 /src/plugins | |
parent | 0d3c17fc672a762085f74d0e436ef842370729ec (diff) | |
download | Qt-b67105aad0295b41112dc504e37daf5e388b0da8.zip Qt-b67105aad0295b41112dc504e37daf5e388b0da8.tar.gz Qt-b67105aad0295b41112dc504e37daf5e388b0da8.tar.bz2 |
::copy on the QMeeGoPixmapData creates a raster-backed pixmap.
Was required to implement a new subclass to make this happen.
Merge-request: 863
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins')
5 files changed, 124 insertions, 2 deletions
diff --git a/src/plugins/graphicssystems/meego/meego.pro b/src/plugins/graphicssystems/meego/meego.pro index d750d34..eaccd4a 100644 --- a/src/plugins/graphicssystems/meego/meego.pro +++ b/src/plugins/graphicssystems/meego/meego.pro @@ -5,8 +5,8 @@ QT += gui opengl QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/graphicssystems -HEADERS = qmeegographicssystem.h qmeegopixmapdata.h qmeegoextensions.h -SOURCES = qmeegographicssystem.cpp qmeegographicssystem.h qmeegographicssystemplugin.h qmeegographicssystemplugin.cpp qmeegopixmapdata.h qmeegopixmapdata.cpp qmeegoextensions.h qmeegoextensions.cpp +HEADERS = qmeegographicssystem.h qmeegopixmapdata.h qmeegoextensions.h qmeegorasterpixmapdata.h +SOURCES = qmeegographicssystem.cpp qmeegographicssystem.h qmeegographicssystemplugin.h qmeegographicssystemplugin.cpp qmeegopixmapdata.h qmeegopixmapdata.cpp qmeegoextensions.h qmeegoextensions.cpp qmeegorasterpixmapdata.h qmeegorasterpixmapdata.cpp target.path += $$[QT_INSTALL_PLUGINS]/graphicssystems INSTALLS += target diff --git a/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp index 5473d09..1d051cf 100644 --- a/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp +++ b/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp @@ -41,6 +41,7 @@ #include "qmeegopixmapdata.h" #include "qmeegoextensions.h" +#include "qmeegorasterpixmapdata.h" #include <private/qimage_p.h> #include <private/qwindowsurface_gl_p.h> #include <private/qeglcontext_p.h> @@ -266,3 +267,8 @@ void QMeeGoPixmapData::registerSharedImage(Qt::HANDLE handle, const QImage &si) qWarning("Inconsistency detected: overwriting entry in sharedImagesMap but handle/format different"); } } + +QPixmapData *QMeeGoPixmapData::createCompatiblePixmapData() const +{ + return new QMeeGoRasterPixmapData(pixelType()); +} diff --git a/src/plugins/graphicssystems/meego/qmeegopixmapdata.h b/src/plugins/graphicssystems/meego/qmeegopixmapdata.h index 8b1ae14..649556d 100644 --- a/src/plugins/graphicssystems/meego/qmeegopixmapdata.h +++ b/src/plugins/graphicssystems/meego/qmeegopixmapdata.h @@ -55,6 +55,7 @@ class QMeeGoPixmapData : public QGLPixmapData public: QMeeGoPixmapData(); void fromTexture(GLuint textureId, int w, int h, bool alpha); + QPixmapData *createCompatiblePixmapData() const; virtual void fromEGLImage(Qt::HANDLE handle); virtual void fromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage); diff --git a/src/plugins/graphicssystems/meego/qmeegorasterpixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegorasterpixmapdata.cpp new file mode 100644 index 0000000..b6a3727 --- /dev/null +++ b/src/plugins/graphicssystems/meego/qmeegorasterpixmapdata.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmeegorasterpixmapdata.h" + +/* Public */ + +QMeeGoRasterPixmapData::QMeeGoRasterPixmapData() : QRasterPixmapData(QPixmapData::PixmapType) +{ +} + +QMeeGoRasterPixmapData::QMeeGoRasterPixmapData(QPixmapData::PixelType t) : QRasterPixmapData(t) +{ +} + +void QMeeGoRasterPixmapData::copy(const QPixmapData *data, const QRect &rect) +{ + if (data->classId() == QPixmapData::OpenGLClass) + fromImage(data->toImage(rect).copy(), Qt::NoOpaqueDetection); + else + QRasterPixmapData::copy(data, rect); +} diff --git a/src/plugins/graphicssystems/meego/qmeegorasterpixmapdata.h b/src/plugins/graphicssystems/meego/qmeegorasterpixmapdata.h new file mode 100644 index 0000000..636b0e6 --- /dev/null +++ b/src/plugins/graphicssystems/meego/qmeegorasterpixmapdata.h @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef MRASTERPIXMAPDATA_H +#define MRASTERPIXMAPDATA_H + +#include <private/qpixmap_raster_p.h> + +class QMeeGoRasterPixmapData : public QRasterPixmapData +{ +public: + QMeeGoRasterPixmapData(); + QMeeGoRasterPixmapData(QPixmapData::PixelType t); + void copy(const QPixmapData *data, const QRect &rect); +}; + +#endif |