source: trunk/src/gui/painting/qpaintengine_s60.cpp@ 564

Last change on this file since 564 was 561, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.6.1 sources.

  • Property svn:eol-style set to native
File size: 3.8 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the QtGui module of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41#include <private/qpaintengine_s60_p.h>
42#include <private/qpixmap_s60_p.h>
43#include <private/qt_s60_p.h>
44
45QT_BEGIN_NAMESPACE
46
47class QS60PaintEnginePrivate : public QRasterPaintEnginePrivate
48{
49public:
50 QS60PaintEnginePrivate() {}
51};
52
53QS60PaintEngine::QS60PaintEngine(QPaintDevice *device, QS60PixmapData *data)
54 : QRasterPaintEngine(*(new QS60PaintEnginePrivate), device), pixmapData(data)
55{
56}
57
58bool QS60PaintEngine::begin(QPaintDevice *device)
59{
60 Q_D(QS60PaintEngine);
61
62 pixmapData->beginDataAccess();
63 bool ret = QRasterPaintEngine::begin(device);
64 // Make sure QPaintEngine::paintDevice() returns the proper device.
65 // QRasterPaintEngine changes pdev to QImage in case of RasterClass QPixmapData
66 // which is incorrect in Symbian.
67 d->pdev = device;
68 return ret;
69}
70
71bool QS60PaintEngine::end()
72{
73 bool ret = QRasterPaintEngine::end();
74 pixmapData->endDataAccess();
75 return ret;
76}
77
78void QS60PaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
79{
80 QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
81 srcData->beginDataAccess();
82 QRasterPaintEngine::drawPixmap(p, pm);
83 srcData->endDataAccess();
84}
85
86void QS60PaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
87{
88 QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
89 srcData->beginDataAccess();
90 QRasterPaintEngine::drawPixmap(r, pm, sr);
91 srcData->endDataAccess();
92}
93
94void QS60PaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr)
95{
96 QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
97 srcData->beginDataAccess();
98 QRasterPaintEngine::drawTiledPixmap(r, pm, sr);
99 srcData->endDataAccess();
100}
101
102void QS60PaintEngine::prepare(QImage *image)
103{
104 QRasterBuffer *buffer = d_func()->rasterBuffer.data();
105 if (buffer)
106 buffer->prepare(image);
107}
108
109QT_END_NAMESPACE
Note: See TracBrowser for help on using the repository browser.