author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Thu, 08 Apr 2010 14:19:33 +0300 | |
branch | RCL_3 |
changeset 8 | 3f74d0d4af4c |
parent 5 | d3bac044e0f0 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
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 QtOpenGL 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 QGRAPHICSCONTEXT_OPENGL2_P_H |
|
43 |
#define QGRAPHICSCONTEXT_OPENGL2_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 <QDebug> |
|
57 |
||
58 |
#include <private/qpaintengineex_p.h> |
|
59 |
#include <private/qglengineshadermanager_p.h> |
|
60 |
#include <private/qgl2pexvertexarray_p.h> |
|
61 |
#include <private/qglpaintdevice_p.h> |
|
62 |
#include <private/qglpixmapfilter_p.h> |
|
63 |
#include <private/qfontengine_p.h> |
|
64 |
#include <private/qdatabuffer_p.h> |
|
65 |
#include <private/qtriangulatingstroker_p.h> |
|
66 |
||
67 |
enum EngineMode { |
|
68 |
ImageDrawingMode, |
|
69 |
TextDrawingMode, |
|
70 |
BrushDrawingMode, |
|
71 |
ImageArrayDrawingMode |
|
72 |
}; |
|
73 |
||
74 |
QT_BEGIN_NAMESPACE |
|
75 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
76 |
#define GL_STENCIL_HIGH_BIT GLuint(0x80) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
77 |
#define QT_BRUSH_TEXTURE_UNIT GLuint(0) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
78 |
#define QT_IMAGE_TEXTURE_UNIT GLuint(0) //Can be the same as brush texture unit |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
79 |
#define QT_MASK_TEXTURE_UNIT GLuint(1) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
80 |
#define QT_BACKGROUND_TEXTURE_UNIT GLuint(2) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
81 |
|
0 | 82 |
class QGL2PaintEngineExPrivate; |
83 |
||
84 |
||
85 |
class QOpenGL2PaintEngineState : public QPainterState |
|
86 |
{ |
|
87 |
public: |
|
88 |
QOpenGL2PaintEngineState(QOpenGL2PaintEngineState &other); |
|
89 |
QOpenGL2PaintEngineState(); |
|
90 |
~QOpenGL2PaintEngineState(); |
|
91 |
||
92 |
uint isNew : 1; |
|
93 |
uint needsClipBufferClear : 1; |
|
94 |
uint clipTestEnabled : 1; |
|
95 |
uint canRestoreClip : 1; |
|
96 |
uint matrixChanged : 1; |
|
97 |
uint compositionModeChanged : 1; |
|
98 |
uint opacityChanged : 1; |
|
99 |
uint renderHintsChanged : 1; |
|
100 |
uint clipChanged : 1; |
|
101 |
uint currentClip : 8; |
|
102 |
||
103 |
QRect rectangleClip; |
|
104 |
}; |
|
105 |
||
106 |
class Q_OPENGL_EXPORT QGL2PaintEngineEx : public QPaintEngineEx |
|
107 |
{ |
|
108 |
Q_DECLARE_PRIVATE(QGL2PaintEngineEx) |
|
109 |
public: |
|
110 |
QGL2PaintEngineEx(); |
|
111 |
~QGL2PaintEngineEx(); |
|
112 |
||
113 |
bool begin(QPaintDevice *device); |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
114 |
void ensureActive(); |
0 | 115 |
bool end(); |
116 |
||
117 |
virtual void clipEnabledChanged(); |
|
118 |
virtual void penChanged(); |
|
119 |
virtual void brushChanged(); |
|
120 |
virtual void brushOriginChanged(); |
|
121 |
virtual void opacityChanged(); |
|
122 |
virtual void compositionModeChanged(); |
|
123 |
virtual void renderHintsChanged(); |
|
124 |
virtual void transformChanged(); |
|
125 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
126 |
virtual void drawTexture(const QRectF &r, GLuint textureId, const QSize &size, const QRectF &sr); |
0 | 127 |
virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr); |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
128 |
virtual void drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints); |
0 | 129 |
virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, |
130 |
Qt::ImageConversionFlags flags = Qt::AutoColor); |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
131 |
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
132 |
virtual void fill(const QVectorPath &path, const QBrush &brush); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
133 |
virtual void stroke(const QVectorPath &path, const QPen &pen); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
134 |
virtual void clip(const QVectorPath &path, Qt::ClipOperation op); |
0 | 135 |
|
136 |
||
137 |
Type type() const { return OpenGL2; } |
|
138 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
139 |
virtual void setState(QPainterState *s); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
140 |
virtual QPainterState *createState(QPainterState *orig) const; |
0 | 141 |
inline QOpenGL2PaintEngineState *state() { |
142 |
return static_cast<QOpenGL2PaintEngineState *>(QPaintEngineEx::state()); |
|
143 |
} |
|
144 |
inline const QOpenGL2PaintEngineState *state() const { |
|
145 |
return static_cast<const QOpenGL2PaintEngineState *>(QPaintEngineEx::state()); |
|
146 |
} |
|
147 |
||
148 |
void beginNativePainting(); |
|
149 |
void endNativePainting(); |
|
150 |
||
151 |
QPixmapFilter *pixmapFilter(int type, const QPixmapFilter *prototype); |
|
152 |
||
153 |
void setRenderTextActive(bool); |
|
154 |
||
155 |
private: |
|
156 |
Q_DISABLE_COPY(QGL2PaintEngineEx) |
|
157 |
}; |
|
158 |
||
159 |
||
160 |
class QGL2PaintEngineExPrivate : public QPaintEngineExPrivate |
|
161 |
{ |
|
162 |
Q_DECLARE_PUBLIC(QGL2PaintEngineEx) |
|
163 |
public: |
|
164 |
enum StencilFillMode { |
|
165 |
OddEvenFillMode, |
|
166 |
WindingFillMode, |
|
167 |
TriStripStrokeFillMode |
|
168 |
}; |
|
169 |
||
170 |
QGL2PaintEngineExPrivate(QGL2PaintEngineEx *q_ptr) : |
|
171 |
q(q_ptr), |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
172 |
shaderManager(0), |
0 | 173 |
width(0), height(0), |
174 |
ctx(0), |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
175 |
useSystemClip(true), |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
176 |
snapToPixelGrid(false), |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
177 |
addOffset(false), |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
178 |
inverseScale(1) |
0 | 179 |
{ } |
180 |
||
181 |
~QGL2PaintEngineExPrivate(); |
|
182 |
||
183 |
void updateBrushTexture(); |
|
184 |
void updateBrushUniforms(); |
|
185 |
void updateMatrix(); |
|
186 |
void updateCompositionMode(); |
|
187 |
void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id = -1); |
|
188 |
||
189 |
void resetGLState(); |
|
190 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
191 |
// fill, stroke, drawTexture, drawPixmaps & drawCachedGlyphs are the main rendering entry-points, |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
192 |
// however writeClip can also be thought of as en entry point as it does similar things. |
0 | 193 |
void fill(const QVectorPath &path); |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
194 |
void stroke(const QVectorPath &path, const QPen &pen); |
0 | 195 |
void drawTexture(const QGLRect& dest, const QGLRect& src, const QSize &textureSize, bool opaque, bool pattern = false); |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
196 |
void drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints); |
0 | 197 |
void drawCachedGlyphs(const QPointF &p, QFontEngineGlyphCache::Type glyphType, const QTextItemInt &ti); |
198 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
199 |
// Calls glVertexAttributePointer if the pointer has changed |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
200 |
inline void setVertexAttributePointer(unsigned int arrayIndex, const GLfloat *pointer); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
201 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
202 |
// draws whatever is in the vertex array: |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
203 |
void drawVertexArrays(const float *data, int *stops, int stopCount, GLenum primitive); |
0 | 204 |
void drawVertexArrays(QGL2PEXVertexArray &vertexArray, GLenum primitive) { |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
205 |
drawVertexArrays((const float *) vertexArray.data(), vertexArray.stops(), vertexArray.stopCount(), primitive); |
0 | 206 |
} |
207 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
208 |
// Composites the bounding rect onto dest buffer: |
0 | 209 |
void composite(const QGLRect& boundingRect); |
210 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
211 |
// Calls drawVertexArrays to render into stencil buffer: |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
212 |
void fillStencilWithVertexArray(const float *data, int count, int *stops, int stopCount, const QGLRect &bounds, StencilFillMode mode); |
0 | 213 |
void fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill) { |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
214 |
fillStencilWithVertexArray((const float *) vertexArray.data(), 0, vertexArray.stops(), vertexArray.stopCount(), |
0 | 215 |
vertexArray.boundingRect(), |
216 |
useWindingFill ? WindingFillMode : OddEvenFillMode); |
|
217 |
} |
|
218 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
219 |
void setBrush(const QBrush& brush); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
220 |
void transferMode(EngineMode newMode); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
221 |
bool prepareForDraw(bool srcPixelsAreOpaque); // returns true if the program has changed |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
222 |
inline void useSimpleShader(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
223 |
inline GLuint location(const QGLEngineShaderManager::Uniform uniform) { |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
224 |
return shaderManager->getUniformLocation(uniform); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
225 |
} |
0 | 226 |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
227 |
void clearClip(uint value); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
228 |
void writeClip(const QVectorPath &path, uint value); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
229 |
void resetClipIfNeeded(); |
0 | 230 |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
231 |
void updateClipScissorTest(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
232 |
void setScissor(const QRect &rect); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
233 |
void regenerateClip(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
234 |
void systemStateChanged(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
235 |
|
0 | 236 |
|
237 |
static QGLEngineShaderManager* shaderManagerForEngine(QGL2PaintEngineEx *engine) { return engine->d_func()->shaderManager; } |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
238 |
static QGL2PaintEngineExPrivate *getData(QGL2PaintEngineEx *engine) { return engine->d_func(); } |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
239 |
static void cleanupVectorPath(QPaintEngineEx *engine, void *data); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
240 |
|
0 | 241 |
|
242 |
QGL2PaintEngineEx* q; |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
243 |
QGLEngineShaderManager* shaderManager; |
0 | 244 |
QGLPaintDevice* device; |
245 |
int width, height; |
|
246 |
QGLContext *ctx; |
|
247 |
EngineMode mode; |
|
248 |
QFontEngineGlyphCache::Type glyphCacheType; |
|
249 |
||
250 |
// Dirty flags |
|
251 |
bool matrixDirty; // Implies matrix uniforms are also dirty |
|
252 |
bool compositionModeDirty; |
|
253 |
bool brushTextureDirty; |
|
254 |
bool brushUniformsDirty; |
|
255 |
bool opacityUniformDirty; |
|
256 |
||
257 |
bool stencilClean; // Has the stencil not been used for clipping so far? |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
258 |
bool useSystemClip; |
0 | 259 |
QRegion dirtyStencilRegion; |
260 |
QRect currentScissorBounds; |
|
261 |
uint maxClip; |
|
262 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
263 |
QBrush currentBrush; // May not be the state's brush! |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
264 |
const QBrush noBrush; |
0 | 265 |
|
266 |
QGL2PEXVertexArray vertexCoordinateArray; |
|
267 |
QGL2PEXVertexArray textureCoordinateArray; |
|
268 |
QDataBuffer<GLfloat> opacityArray; |
|
269 |
GLfloat staticVertexCoordinateArray[8]; |
|
270 |
GLfloat staticTextureCoordinateArray[8]; |
|
271 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
272 |
bool snapToPixelGrid; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
273 |
bool addOffset; // When enabled, adds a 0.49,0.49 offset to matrix in updateMatrix |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
274 |
GLfloat pmvMatrix[3][3]; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
275 |
GLfloat inverseScale; |
0 | 276 |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
277 |
GLuint lastTextureUsed; |
0 | 278 |
|
279 |
bool needsSync; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
280 |
bool multisamplingAlwaysEnabled; |
0 | 281 |
|
282 |
GLfloat depthRange[2]; |
|
283 |
||
284 |
float textureInvertedY; |
|
285 |
||
286 |
QTriangulatingStroker stroker; |
|
287 |
QDashedStrokeProcessor dasher; |
|
288 |
||
289 |
QScopedPointer<QPixmapFilter> convolutionFilter; |
|
290 |
QScopedPointer<QPixmapFilter> colorizeFilter; |
|
291 |
QScopedPointer<QPixmapFilter> blurFilter; |
|
292 |
QScopedPointer<QPixmapFilter> dropShadowFilter; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
293 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
294 |
QSet<QVectorPath::CacheEntry *> pathCaches; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
295 |
QVector<GLuint> unusedVBOSToClean; |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
296 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
297 |
const GLfloat *vertexAttribPointers[3]; |
0 | 298 |
}; |
299 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
300 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
301 |
void QGL2PaintEngineExPrivate::setVertexAttributePointer(unsigned int arrayIndex, const GLfloat *pointer) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
302 |
{ |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
303 |
Q_ASSERT(arrayIndex < 3); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
304 |
if (pointer == vertexAttribPointers[arrayIndex]) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
305 |
return; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
306 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
307 |
vertexAttribPointers[arrayIndex] = pointer; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
308 |
if (arrayIndex == QT_OPACITY_ATTR) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
309 |
glVertexAttribPointer(arrayIndex, 1, GL_FLOAT, GL_FALSE, 0, pointer); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
310 |
else |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
311 |
glVertexAttribPointer(arrayIndex, 2, GL_FLOAT, GL_FALSE, 0, pointer); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
312 |
} |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
313 |
|
0 | 314 |
QT_END_NAMESPACE |
315 |
||
316 |
#endif |