src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
child 7 f7bc934e204c
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   169 
   169 
   170     QGL2PaintEngineExPrivate(QGL2PaintEngineEx *q_ptr) :
   170     QGL2PaintEngineExPrivate(QGL2PaintEngineEx *q_ptr) :
   171             q(q_ptr),
   171             q(q_ptr),
   172             width(0), height(0),
   172             width(0), height(0),
   173             ctx(0),
   173             ctx(0),
   174             currentBrush(0),
       
   175             inverseScale(1),
   174             inverseScale(1),
   176             shaderManager(0),
   175             shaderManager(0),
   177             inRenderText(false)
   176             inRenderText(false)
   178     { }
   177     { }
   179 
   178 
   183     void updateBrushUniforms();
   182     void updateBrushUniforms();
   184     void updateMatrix();
   183     void updateMatrix();
   185     void updateCompositionMode();
   184     void updateCompositionMode();
   186     void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id = -1);
   185     void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id = -1);
   187 
   186 
   188     void setBrush(const QBrush* brush);
   187     void setBrush(const QBrush& brush);
   189 
   188 
   190     void transferMode(EngineMode newMode);
   189     void transferMode(EngineMode newMode);
   191     void resetGLState();
   190     void resetGLState();
   192 
   191 
   193     // fill, drawOutline, drawTexture & drawCachedGlyphs are the rendering entry points:
   192     // fill, drawOutline, drawTexture & drawCachedGlyphs are the rendering entry points:
   194     void fill(const QVectorPath &path);
   193     void fill(const QVectorPath &path);
   195     void drawTexture(const QGLRect& dest, const QGLRect& src, const QSize &textureSize, bool opaque, bool pattern = false);
   194     void drawTexture(const QGLRect& dest, const QGLRect& src, const QSize &textureSize, bool opaque, bool pattern = false);
   196     void drawCachedGlyphs(const QPointF &p, QFontEngineGlyphCache::Type glyphType, const QTextItemInt &ti);
   195     void drawCachedGlyphs(const QPointF &p, QFontEngineGlyphCache::Type glyphType, const QTextItemInt &ti);
   197 
   196 
   198     void drawVertexArrays(const float *data, const QVector<int> *stops, GLenum primitive);
   197     void drawVertexArrays(const float *data, int *stops, int stopCount, GLenum primitive);
   199     void drawVertexArrays(QGL2PEXVertexArray &vertexArray, GLenum primitive) {
   198     void drawVertexArrays(QGL2PEXVertexArray &vertexArray, GLenum primitive) {
   200         drawVertexArrays((const float *) vertexArray.data(), &vertexArray.stops(), primitive);
   199         drawVertexArrays((const float *) vertexArray.data(), vertexArray.stops(), vertexArray.stopCount(), primitive);
   201     }
   200     }
   202 
   201 
   203         // ^ draws whatever is in the vertex array
   202         // ^ draws whatever is in the vertex array
   204     void composite(const QGLRect& boundingRect);
   203     void composite(const QGLRect& boundingRect);
   205         // ^ Composites the bounding rect onto dest buffer
   204         // ^ Composites the bounding rect onto dest buffer
   206 
   205 
   207     void fillStencilWithVertexArray(const float *data, int count, const QVector<int> *stops, const QGLRect &bounds, StencilFillMode mode);
   206     void fillStencilWithVertexArray(const float *data, int count, int *stops, int stopCount, const QGLRect &bounds, StencilFillMode mode);
   208     void fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill) {
   207     void fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill) {
   209         fillStencilWithVertexArray((const float *) vertexArray.data(), 0, &vertexArray.stops(),
   208         fillStencilWithVertexArray((const float *) vertexArray.data(), 0, vertexArray.stops(), vertexArray.stopCount(),
   210                                    vertexArray.boundingRect(),
   209                                    vertexArray.boundingRect(),
   211                                    useWindingFill ? WindingFillMode : OddEvenFillMode);
   210                                    useWindingFill ? WindingFillMode : OddEvenFillMode);
   212     }
   211     }
   213         // ^ Calls drawVertexArrays to render into stencil buffer
   212         // ^ Calls drawVertexArrays to render into stencil buffer
   214 
   213 
   219 
   218 
   220     void prepareDepthRangeForRenderText();
   219     void prepareDepthRangeForRenderText();
   221     void restoreDepthRangeForRenderText();
   220     void restoreDepthRangeForRenderText();
   222 
   221 
   223     static QGLEngineShaderManager* shaderManagerForEngine(QGL2PaintEngineEx *engine) { return engine->d_func()->shaderManager; }
   222     static QGLEngineShaderManager* shaderManagerForEngine(QGL2PaintEngineEx *engine) { return engine->d_func()->shaderManager; }
       
   223     static QGL2PaintEngineExPrivate *getData(QGL2PaintEngineEx *engine) { return engine->d_func(); }
   224 
   224 
   225     QGL2PaintEngineEx* q;
   225     QGL2PaintEngineEx* q;
   226     QGLPaintDevice* device;
   226     QGLPaintDevice* device;
   227     int width, height;
   227     int width, height;
   228     QGLContext *ctx;
   228     QGLContext *ctx;
   241     bool stencilClean; // Has the stencil not been used for clipping so far?
   241     bool stencilClean; // Has the stencil not been used for clipping so far?
   242     QRegion dirtyStencilRegion;
   242     QRegion dirtyStencilRegion;
   243     QRect currentScissorBounds;
   243     QRect currentScissorBounds;
   244     uint maxClip;
   244     uint maxClip;
   245 
   245 
   246     const QBrush*    currentBrush; // May not be the state's brush!
   246     QBrush currentBrush; // May not be the state's brush!
   247 
   247 
   248     GLfloat     inverseScale;
   248     GLfloat     inverseScale;
   249 
   249 
   250     QGL2PEXVertexArray vertexCoordinateArray;
   250     QGL2PEXVertexArray vertexCoordinateArray;
   251     QGL2PEXVertexArray textureCoordinateArray;
   251     QGL2PEXVertexArray textureCoordinateArray;
   275 
   275 
   276     GLuint lastTexture;
   276     GLuint lastTexture;
   277 
   277 
   278     bool needsSync;
   278     bool needsSync;
   279     bool inRenderText;
   279     bool inRenderText;
       
   280     bool multisamplingAlwaysEnabled;
   280 
   281 
   281     GLfloat depthRange[2];
   282     GLfloat depthRange[2];
   282 
   283 
   283     float textureInvertedY;
   284     float textureInvertedY;
   284 
   285 
   287     QTransform temporaryTransform;
   288     QTransform temporaryTransform;
   288 
   289 
   289     QScopedPointer<QPixmapFilter> convolutionFilter;
   290     QScopedPointer<QPixmapFilter> convolutionFilter;
   290     QScopedPointer<QPixmapFilter> colorizeFilter;
   291     QScopedPointer<QPixmapFilter> colorizeFilter;
   291     QScopedPointer<QPixmapFilter> blurFilter;
   292     QScopedPointer<QPixmapFilter> blurFilter;
   292     QScopedPointer<QPixmapFilter> fastBlurFilter;
       
   293     QScopedPointer<QPixmapFilter> dropShadowFilter;
   293     QScopedPointer<QPixmapFilter> dropShadowFilter;
   294     QScopedPointer<QPixmapFilter> fastDropShadowFilter;
   294 
       
   295     QSet<QVectorPath::CacheEntry *> pathCaches;
       
   296     QVector<GLuint> unusedVBOSToClean;
   295 };
   297 };
   296 
   298 
   297 QT_END_NAMESPACE
   299 QT_END_NAMESPACE
   298 
   300 
   299 #endif
   301 #endif