author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 01:19:32 +0300 | |
changeset 37 | 758a864f9613 |
parent 33 | 3e2da88830cd |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtOpenVG module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
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 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#ifndef QPAINTENGINE_VG_P_H |
|
43 |
#define QPAINTENGINE_VG_P_H |
|
44 |
||
45 |
// |
|
46 |
// W A R N I N G |
|
47 |
// ------------- |
|
48 |
// |
|
49 |
// This file is not part of the Qt API. It exists purely as an |
|
50 |
// implementation detail. This header file may change from version to |
|
51 |
// version without notice, or even be removed. |
|
52 |
// |
|
53 |
// We mean it. |
|
54 |
// |
|
55 |
||
56 |
#include <QtGui/private/qpaintengineex_p.h> |
|
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
57 |
#include <QtGui/private/qtextureglyphcache_p.h> |
0 | 58 |
|
59 |
QT_BEGIN_NAMESPACE |
|
60 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
61 |
class QFixedPoint; |
0 | 62 |
class QVGPaintEnginePrivate; |
63 |
class QPixmapData; |
|
64 |
class QVGEGLWindowSurfacePrivate; |
|
65 |
||
66 |
class Q_OPENVG_EXPORT QVGPainterState : public QPainterState |
|
67 |
{ |
|
68 |
public: |
|
69 |
QVGPainterState(QVGPainterState& other); |
|
70 |
QVGPainterState(); |
|
71 |
~QVGPainterState(); |
|
72 |
||
73 |
bool isNew; |
|
74 |
QRegion clipRegion; |
|
75 |
QPaintEngine::DirtyFlags savedDirty; |
|
76 |
}; |
|
77 |
||
78 |
class Q_OPENVG_EXPORT QVGPaintEngine : public QPaintEngineEx |
|
79 |
{ |
|
80 |
Q_DECLARE_PRIVATE(QVGPaintEngine) |
|
81 |
public: |
|
82 |
QVGPaintEngine(); |
|
83 |
~QVGPaintEngine(); |
|
84 |
||
85 |
Type type() const { return OpenVG; } |
|
86 |
||
87 |
QPainterState *createState(QPainterState *orig) const; |
|
88 |
||
89 |
bool begin(QPaintDevice *pdev); |
|
90 |
bool end(); |
|
91 |
||
92 |
void draw(const QVectorPath &path); |
|
93 |
void fill(const QVectorPath &path, const QBrush &brush); |
|
94 |
void stroke(const QVectorPath &path, const QPen &pen); |
|
95 |
||
96 |
void clip(const QVectorPath &path, Qt::ClipOperation op); |
|
97 |
void clip(const QRect &rect, Qt::ClipOperation op); |
|
98 |
void clip(const QRegion ®ion, Qt::ClipOperation op); |
|
99 |
void clip(const QPainterPath &path, Qt::ClipOperation op); |
|
100 |
||
101 |
void clipEnabledChanged(); |
|
102 |
void penChanged(); |
|
103 |
void brushChanged(); |
|
104 |
void brushOriginChanged(); |
|
105 |
void opacityChanged(); |
|
106 |
void compositionModeChanged(); |
|
107 |
void renderHintsChanged(); |
|
108 |
void transformChanged(); |
|
109 |
||
110 |
void fillRect(const QRectF &rect, const QBrush &brush); |
|
111 |
void fillRect(const QRectF &rect, const QColor &color); |
|
112 |
||
113 |
void drawRoundedRect(const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode); |
|
114 |
||
115 |
void drawRects(const QRect *rects, int rectCount); |
|
116 |
void drawRects(const QRectF *rects, int rectCount); |
|
117 |
||
118 |
void drawLines(const QLine *lines, int lineCount); |
|
119 |
void drawLines(const QLineF *lines, int lineCount); |
|
120 |
||
121 |
void drawEllipse(const QRectF &r); |
|
122 |
void drawEllipse(const QRect &r); |
|
123 |
||
124 |
void drawPath(const QPainterPath &path); |
|
125 |
||
126 |
void drawPoints(const QPointF *points, int pointCount); |
|
127 |
void drawPoints(const QPoint *points, int pointCount); |
|
128 |
||
129 |
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode); |
|
130 |
void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode); |
|
131 |
||
132 |
void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr); |
|
133 |
void drawPixmap(const QPointF &pos, const QPixmap &pm); |
|
134 |
||
135 |
void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, |
|
136 |
Qt::ImageConversionFlags flags = Qt::AutoColor); |
|
137 |
void drawImage(const QPointF &pos, const QImage &image); |
|
138 |
||
139 |
void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s); |
|
140 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
141 |
void drawPixmapFragments(const QPainter::PixmapFragment *drawingData, int dataCount, const QPixmap &pixmap, |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
142 |
QFlags<QPainter::PixmapFragmentHint> hints); |
0 | 143 |
|
144 |
void drawTextItem(const QPointF &p, const QTextItem &textItem); |
|
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
145 |
void drawStaticTextItem(QStaticTextItem *staticTextItem); |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
146 |
bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFont &font, |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
147 |
QFontEngine *fontEngine, const QPointF &p, |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
148 |
const QFixedPoint *positions); |
0 | 149 |
|
150 |
void setState(QPainterState *s); |
|
151 |
QVGPainterState *state() { return static_cast<QVGPainterState *>(QPaintEngineEx::state()); } |
|
152 |
const QVGPainterState *state() const { return static_cast<const QVGPainterState *>(QPaintEngineEx::state()); } |
|
153 |
||
154 |
void beginNativePainting(); |
|
155 |
void endNativePainting(); |
|
156 |
||
157 |
QPixmapFilter *pixmapFilter(int type, const QPixmapFilter *prototype); |
|
158 |
||
159 |
QVGPaintEnginePrivate *vgPrivate() { Q_D(QVGPaintEngine); return d; } |
|
160 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
161 |
void fillRegion(const QRegion& region, const QColor& color, const QSize& surfaceSize); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
162 |
|
0 | 163 |
protected: |
164 |
QVGPaintEngine(QVGPaintEnginePrivate &data); |
|
165 |
||
166 |
private: |
|
167 |
void restoreState(QPaintEngine::DirtyFlags dirty); |
|
168 |
void updateScissor(); |
|
169 |
QRegion defaultClipRegion(); |
|
170 |
bool isDefaultClipRegion(const QRegion& region); |
|
171 |
bool isDefaultClipRect(const QRect& rect); |
|
172 |
bool clearRect(const QRectF &rect, const QColor &color); |
|
173 |
}; |
|
174 |
||
175 |
QT_END_NAMESPACE |
|
176 |
||
177 |
#endif |