summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
Commit message (Collapse)AuthorAgeFilesLines
* Enabled switching multisampling on/off in GL2 engine on desktop.Samuel Rødal2009-06-151-0/+14
| | | | | | | Switching multisampling is not supported in GLES 2.0, but it's supported in GL 2.0 so we should do it on desktop at least. Reviewed-by: Trond
* Fixed bitmap drawing in GL 2 engine when not using GL pixmap backend.Samuel Rødal2009-06-121-2/+4
| | | | | | | | | QPixmap shouldn't return true in hasAlphaChannel() for bitmaps, instead the paint engine should check whether the pixmap is a bitmap or not. In addition, QBrush::isOpaque() returned true for bitmap brushes, which is wrong according to the documentation. Reviewed-by: Trond
* Fixed off-by-one color bug in GL 2 paint engine.Samuel Rødal2009-06-121-5/+5
| | | | | Calling premultiplyColor() with a red channel of 255, alpha channel of 255, and opacity 1 would result in a color with red channel of 254.
* Fixed incorrect rendering of bitmap/pattern brushes in GL 2 engine.Samuel Rødal2009-06-125-8/+56
| | | | | | | | | The pen color should be used when drawPixmap is called with a bitmap, and the brush color should be used for texture patterns that are bitmaps. Task-number: 245802 Reviewed-by: Trond
* Optimized stencil buffer clearing in GL 2 paint engine.Samuel Rødal2009-06-092-42/+9
| | | | | | | | Based on Zack's patch, 17e1bca1ce366395f8331e16aa96b7176ca1abac. Instead of manually clearing the stencil buffer after drawing we simply do the clearing and drawing in one go. Reviewed-by: Trond
* Improved clipping in GL2 paint engine.Samuel Rødal2009-06-094-170/+246
| | | | | | | | | | | | | Use the stencil method to draw clip paths and regions to the Z-buffer instead of using glClear / glScissor. Using different depth values for the various clip parts also makes restore() very cheap when only IntersectClip is used. As an additional bonus this patch gives antialiased clip in the GL 2 paint engine. Task-number: 254658 Reviewed-by: Trond
* Compile with Sun CC 5.5.jasplin2009-06-051-1/+1
| | | | | | | | An alternative solution is to swap the order of -I../../include and -I../../include/QtOpenGL when compiling the opengl module. Reviewed-by: TrustMe
* All of Qt's own code compiles with -pedantic now (but pcre and webkit don't ↵David Faure2009-06-041-2/+2
| | | | | | | seem fixable easily) Merge-request: 594 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improvements to shader API in response to API reviewRhys Weatherley2009-06-041-2/+1
| | | | | Task-number: QT-80 Reviewed-by: Ian Walters
* Implemented QGLTextureGlyphCache to avoid wasting glyph cache memory.Samuel Rødal2009-06-034-29/+211
| | | | | | | | | Now there's only a copy of the texture glyph cache in graphics memory, avoiding the system memory copy that we used earlier. In addition the texture will use the GL_ALPHA texture format when possible, making it consume less graphics memory as well. Reviewed-by: Tom
* Made GL2 engine default for QGLWidget, and added GL2 sync() functionSamuel Rødal2009-05-292-0/+38
| | | | | | | | | | | | To allow mixing QPainter and raw OpenGL commands we need to have some way for the user to say that's he's about to use raw OpenGL so that we are free to do buffering optimizations in the paint engines and use either GL1 or GL2 paint engine. As there's already a syncState() function in QPaintEngine we've reused this and added QPaintEngineEx::sync() which takes care of syncing/flushing the paint engine. Reviewed-by: Trond
* Fixed bug in GL graphics system when painting to pixmaps.Samuel Rødal2009-05-281-0/+3
| | | | | Make sure the correct texture unit is active when copying from the pixmap to the FBO in begin().
* Fixed incorrect handling of composition modes in GL2 paint engine.Samuel Rødal2009-05-282-22/+11
| | | | | | | | Even if the source pixels are opaque we have to enable blending for the non-trivial composition modes. Some of the composition modes are independent of source alpha and depend on destination alpha for example. Reviewed-by: Tom
* Compile fix with namespaces.hjk2009-05-287-3/+28
|
* Moved QGL2PaintEngineExPrivate into GL2 paint engine header file.Samuel Rødal2009-05-283-91/+95
| | | | Reviewed-by: Tom
* Make QGLWidgets have the same background colour as QWidgetsTom Cooksey2009-05-271-15/+8
| | | | | | | | QWidgets are filled with Qt::transparent when WA_TranslucentBackground is set, reguardless of what their background colour has been set to. This patch makes QGLWidgets behave the same way. Reviewed-By: Samuel Rødal
* Make WA_TranslucentBackground work on QGLWidget for X11Tom Cooksey2009-05-271-0/+10
| | | | | | | This patch enables QGLWidget's to have an ARGB visual on X11, alowing GL rendering on semi-transparent windows. Reviewed-By: Trond
* Avoided expensive image upload for GL pixmap backend for QPixmap::fill.Samuel Rødal2009-05-271-1/+7
| | | | | | | In the fill case we can simply set a flag saying the pixmap needs to be filled, and then when painting on the pixmap we start by filling the background using glClear via the existing QGLDrawable::autoFillBackground interface.
* Fixed bugs in GL2 paint engine when several engines are active.Samuel Rødal2009-05-271-29/+17
| | | | | | | Make sure makeCurrent() on a window surface unbinds any active FBO, and simplify ensureActive() code in GL2 paint engine a bit. We don't need the last_engine pointer as ensureActive() will take care of ensuring the correct engine is active anway.
* Fixed broken system clip handling in GL2 paint engine.Samuel Rødal2009-05-252-2/+11
| | | | | | Override systemStateChanged() to get the system clip updates. Reviewed-by: Trond
* Fix GLSL for OMAP3 and error checkingTom Cooksey2009-05-202-3/+3
|
* Fix GL2 paint engine builds on Big-endian machinesTom Cooksey2009-05-151-11/+8
| | | | Reviewed-by: Trond
* Make QtOpenGL compile on OpenGL ES 1.1 againTom Cooksey2009-05-141-2/+2
|
* Enabled compilation of both GL and GL2 paint engine.Samuel Rødal2009-05-134-25/+25
| | | | | | | Compile both GL and GL2 paint engine on desktop, and choose between them at run-time based on GL version flags. Reviewed-by: Tom
* Merge branch 'gl2engine-new-shaders' into graphics-masterTom Cooksey2009-05-062-4/+5
|\ | | | | | | | | Conflicts: src/gui/painting/qpaintengine_raster.cpp
| * Big GL Extension CleanupTom Cooksey2009-05-061-2/+3
| | | | | | | | | | | | | | | | | | Clean up the extension naming and make things build on OpenGL ES 2.0 again. All the extensions which made it into OpenGL 2.0 spec have have the EXT postfix removed. This also eliminates defines on ES 2.0 as the code now refers to the in-spec names. Reviewed-by: sroedal
| * Rename uses of QGLShaderProgram::errors() to log()Rhys Weatherley2009-05-011-2/+2
| | | | | | | | Reviewed-by: trustme
* | Remove old qglshader files from gl2paintengineex.Samuel Rødal2009-04-232-878/+0
|/
* Allow release builds againTom Cooksey2009-04-221-2/+0
| | | | The list of shaders shouldn't change too much now.
* Make useCorrectShaderProg() return a bool againTom Cooksey2009-04-223-13/+10
| | | | | Returns true if it had to change the shader program so the engine knows it needs to clean the uniforms.
* Make optimiseForBrushTransform take a QTransform referenceTom Cooksey2009-04-222-2/+2
|
* Change fragment shaders to apply the mask as the final stepTom Cooksey2009-04-221-2/+2
| | | | I.e. After composition, not before.
* Merge branch 'master' into gl2engine-new-shadersSamuel Rødal2009-04-222-45/+137
|\ | | | | | | | | | | Conflicts: src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/opengl.pro
| * Prevent copy back from FBO when initializing render FBO from texture.Samuel Rødal2009-04-201-1/+1
| |
| * Smudgy text in GL2 paint engine when drawing on non-integer offsets.Samuel Rødal2009-04-171-21/+39
| | | | | | | | | | | | | | | | | | Special-case TextDrawingMode in updateMatrix() as we know that we'll have a pure translating transform, and round the transform's dx and dy to avoid drawing on non-integer offsets. Task-number: 245806 Reviewed-by: Tom
| * Correctly handle using GL pixmaps that still have an active engine.Samuel Rødal2009-04-172-3/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case where a GL pixmap is used when there it still has an active engine we need to ensure that the pixmap has been flushed from the render FBO first. The newly added QGLPixmapData::copyBackFromRenderFbo() handles this. In addition, because several GL 2 paint engines can be active on the same context at the same time, we can't make any assumptions and need to call the newly added QGL2PaintEngineEx::ensureCreated() in the beginning of any state-dependent paint engine function. QGL2PaintEngineEx::ensureCreated() correctly transfers control to the current engine if a different engine is active. Running lance with -pixmap and -graphicssystem opengl works correctly with the GL pixmap backend now.
| * Use FBOs as pixmap backend in GL graphics system.Samuel Rødal2009-04-161-1/+37
| | | | | | | | | | | | | | | | We now use FBOs to implement render-to-pixmap for the GL pixmap backend. A multisample FBO is used for rendering, and is then blitted onto a non-multisample FBO dynamically bound to the relevant texture. Reviewed-by: Tom
| * GL2: Avoid expensive updateDepthClip() every time setState() is calledSamuel Rødal2009-04-162-17/+14
| | | | | | | | Only call updateDepthClip() if the clip has actually changed.
* | Make text rendering work again on the GL2 engineTom Cooksey2009-04-212-46/+48
| | | | | | | | | | - But now it can handle non-solid-color pens, the whole reason for the refactor in the first place.
* | Kill unused SimpleVertexShader & rename vertex coords arrayTom Cooksey2009-04-203-23/+12
| | | | | | | | | | | | | | | | Rename inputVertex -> vertexCoordsArray to be more consistent with other vertex attribute array naming conventions. SimpleVertexShader has also been replaced with a combination of MainVertexShader & PositionOnlyVertexShader, so can be killed.
* | Refactor opacity handling & make drawImage/drawPixmap work againTom Cooksey2009-04-204-88/+96
| |
* | Fix various issues with conical grad GLSL codeTom Cooksey2009-04-171-4/+6
| | | | | | | | | | | | - atan2 is just called atan in GLSL (which supports overloads) - varyings can't be modified in fragment shaders - #defines need to be on their own line
* | Add a "shocking pink" shader for rendering into stencil buffTom Cooksey2009-04-173-2/+30
| | | | | | | | | | | | If you see shocking pink in the rendering output, it's probably because the "simple" shader is in use but color writes have somehow been enabled. :-)
* | Fix GLSL warning & possible artifacts with radial gradientsTom Cooksey2009-04-171-1/+1
| | | | | | | | Reviewed-by: Samuel Rødal
* | Make fillRect() with a QBrush(Qt::NoBrush) a noopTom Cooksey2009-04-161-0/+3
| |
* | Don't seg-fault when the shader prog is in the cacheTom Cooksey2009-04-161-1/+2
| |
* | Clean up existing & implement missing GLSL for new shader managerTom Cooksey2009-04-163-153/+319
| |
* | Adapt GL2 Paint Engine to new math3d, shader & shader manager APIsTom Cooksey2009-04-161-43/+43
| |
* | Re-write the shader manager & completely break everything ;-)Tom Cooksey2009-04-166-745/+754
| |
* | Add (big) comment explaining shader pipeline in GL2 engineTom Cooksey2009-04-031-0/+138
| | | | | | | | Reviewed-by: TrustMe