summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Modify QGLShader and QGLShaderProgram in response to API reviewRhys Weatherley2009-11-051-13/+13
| | | | Reviewed-by: Sarah Smith
* Fixed some compiler warnings.Samuel Rødal2009-11-031-7/+2
| | | | Reviewed-by: Trond
* Implement a simple caching algorithm for shader programs.Tom Cooksey2009-10-301-29/+42
| | | | | | | | | | When the number of programs held in the cache exceeds a threshold, the least frequantly used programs get deleted. This also covers programs with custom snippets of code. As a conequence, when a QGLCustomShaderStage gets deleted, any programs using that code will (eventually) be freed. Reviewed-By: Samuel Rødal
* Rename qglEngineShaderSourceCode to qShaderSnippetsTom Cooksey2009-10-301-38/+48
| | | | This patch also adds a "snippetNameStr" helper for debugging.
* Refactor of shader manager to not use partial shadersTom Cooksey2009-10-301-180/+160
| | | | | | | | | This is a first step towards supporting binary shaders. Note: This change will introduce a (rare) leak of shader objects, as the shaders will never be kicked out from the cache (because the cache is still a QList) :-) This will be corrected by the next patch. Reviewed-By: Samuel
* Added some optimizations to the blur and drop shadow GL filters.Samuel Rødal2009-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | * Use ExpandToTransparentBorderPadMode since we can use GL_CLAMP_TO_EDGE to clamp to the texture. * Shrink the bounding rects reported by the blur and drop shadow filters (expanding by 2 * radius isn't needed). * Use a single-pass blur for radii <= 3 to avoid the overhead of rendering to an FBO. * Made the fast blur setting generate filters for only a predefined set of radii, and then use the actual blur radius to spread the sample points outwards. * Optimized the generated program to rely less on temporary variables, as those seemed to not be handled very well by certain GLSL compilers. Reviewed-by: Gunnar Sletta
* Consistently use QGLShareContextScope for context switchingRhys Weatherley2009-10-051-5/+1
| | | | | | | | QGLShareContextScope is safer and more reliable than trying to manually detect how and when to temporarily switch contexts. Replace the few remaining instances of context-switching with it. Reviewed-by: trustme
* Added support for drawing a pixmap multiple times in one call.Kim Motoyoshi Kalland2009-10-021-22/+37
| | | | | | | | | This is internal API. It's possible to specify a horizontal and vertical scale, rotation, opacity and source rectangle for each pixmap item. Useful for particle effects. Reviewed-by: Trond
* Use QGLSharedResourceGuard to track contexts in the shader managerRhys Weatherley2009-10-011-4/+4
| | | | Reviewed-by: Sarah Smith
* Resubmit support for subpixel antialiasing on text in the GL2 engine.Kim Motoyoshi Kalland2009-09-221-3/+9
| | | | | | | The antialiasing is currently not gamma corrected and is disabled on OpenGL ES 2.0. Reviewed-by: Samuel
* Revert "Resubmit support for subpixel antialiasing on text in the GL2 engine."Rhys Weatherley2009-09-211-9/+3
| | | | This reverts commit 1b34feacef7a2d3ac005449a7cfbcb08a6bbf947.
* Resubmit support for subpixel antialiasing on text in the GL2 engine.Kim Motoyoshi Kalland2009-09-211-3/+9
| | | | | | | The antialiasing is currently not gamma corrected and is disabled on OpenGL ES 2.0. Reviewed-by: Samuel
* Revert "Added support for subpixel antialiasing on text in the GL2 engine."Rhys Weatherley2009-09-171-9/+3
| | | | | | Breaks the GL2 paint engine on X11 and OpenGL/ES 2.0. This reverts commit b8ff02a67ebd8246253823b53cfed98eef400547.
* Added support for subpixel antialiasing on text in the GL2 engine.Kim Motoyoshi Kalland2009-09-161-3/+9
| | | | | | The antialiasing is currently not gamma corrected. Reviewed-by: Samuel
* Fixed glsl warnings on mac and stop using texturecoords when not neededGunnar Sletta2009-09-161-22/+20
| | | | | | | | | | The setTextureCoordsEnabled was enabled in two places, but never disabled causing it to always be used. When using a varying in a vertex shader and not using it again in the fragment shader this produces a warning, and rightly so. Since the property is 100% detectable based on the fragment shader used, move the logic into the shader selection code and kill the property all together. This should also speed up solid filling a bit...
* Silenced GLSL compiler warning on Mac OS XGunnar Sletta2009-09-151-1/+3
|
* Some small optimizations to gl2 engine.Gunnar Sletta2009-09-141-1/+3
| | | | | | | | | | Use qpen_ and qbrush_ accessors for slightly better performance and avoid calling for the same value again and again. Secondly, the engine doesn't use its pen and brush states so there is no point in maintaining them, so don't reset old brush all the time. Reviewed-by: Samuel
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Split QGLEngineShaderManager into a shared and a per engine part.Kim Motoyoshi Kalland2009-09-021-218/+229
| | | | | | | | | Both the shaders and the engine states were shared between OpenGL contexts, but the states should be only apply to one context, not a group of contexts. This commit separates the shaders and the states. Task-number: 257254 Reviewed-by: Samuel
* Don't seg-fault when printing error message in shader managerTom Cooksey2009-09-011-11/+25
| | | | | | | | It's very likely that some of the shader objects in required program will be null, as not all are manditory. Check to see if they exist before de-referencing them and asking for their log string. Reviewed-by: Trustme
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* Removed warnings / debug output in the GL 2 engine / pixmap filter code.Samuel Rødal2009-08-251-1/+1
| | | | Reviewed-by: Tom
* Merge commit 'qt/master' into kinetic-graphicseffectBjørn Erik Nilsen2009-08-171-1/+1
|\
| * Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Improve GL filter performance by caching custom shader programs.Samuel Rødal2009-07-281-10/+16
| | | | | | | | This brings performance back up to where it was pre-merge.
* | Merge commit 'qt-graphics-team/pixmapfilters-redux' into kinetic-graphicseffectSamuel Rødal2009-07-281-17/+20
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/opengl/gl2paintengineex/qglengineshadermanager.cpp src/opengl/gl2paintengineex/qglengineshadermanager_p.h src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h Merge custom shader / GL blur pixmap filter implementation from graphics team repo with implementation from kinetic graphics-team repo.
| * | Further optimized the GL blur filter by caching the QGLShader.Samuel Rødal2009-07-021-1/+0
| | |
| * | Added caching of custom shader programs as well in GL 2 shader manager.Samuel Rødal2009-07-011-14/+28
| | | | | | | | | | | | | | | Ensures that the programs are evicted from the cache when the shaders are destroyed.
| * | Added custom shader hook to the GL 2 paint engine.Samuel Rødal2009-06-301-8/+57
| | | | | | | | | | | | | | | This will make it easier to implement pixmap filters, YUV->RGB conversions, etc in other parts of Qt.
* | | Reset shader stage variables when the custom shader is explicitly removed.Rhys Weatherley2009-07-241-0/+2
| | |
* | | Make it easier to change custom shaders.Rhys Weatherley2009-07-241-0/+7
| | |
* | | Make ordinary shaders work again after custom shader changes.Rhys Weatherley2009-07-241-7/+7
| | |
* | | Initial stab at a custom shader stage APITom Cooksey2009-07-231-48/+95
| |/ |/|
* | Fixed GL2 engine shader manager to work with more than one context.Kim Motoyoshi Kalland2009-07-211-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I added a QGLContextResource class which can be used internally in Qt for sharing resources between contexts. The QGLContextResource is a hash map where the context is used as 'key', and the resource is the 'value'. All the sharing contexts point to the same resource, and the resource is automatically deleted when it is not referenced any more. Now, the shader manager uses the QGLContextResource class. I also added a pointer to a struct in the QGLContextPrivate class. The struct is shared between all the sharing contexts and is deleted automatically. Currently, the struct only contains the resolved OpenGL function pointers. The shared context register code has been simplified. Reviewed-by: Tom
* | Moved uniform enum to QGLEngineShaderManager.Kim Motoyoshi Kalland2009-07-031-17/+23
|/ | | | | | Simplified caching of uniform locations. Reviewed-by: Samuel
* Reduced number of state changes/uniform location queries in GL2 engine.Samuel Rødal2009-06-241-6/+49
| | | | | | | Keep track of uniform locations for the current shader program in the shader manager. Also don't change texture parameters unless necessary. Reviewed-by: Kim
* Update license headers in files that are new in 4.6.Jason McDonald2009-06-171-2/+2
| | | | Reviewed-by: Trust Me
* Fixed incorrect rendering of bitmap/pattern brushes in GL 2 engine.Samuel Rødal2009-06-121-0/+11
| | | | | | | | | 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
* Improved clipping in GL2 paint engine.Samuel Rødal2009-06-091-1/+2
| | | | | | | | | | | | | 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
* 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-031-0/+29
| | | | | | | | | 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
* Compile fix with namespaces.hjk2009-05-281-1/+3
|
* Fix GLSL for OMAP3 and error checkingTom Cooksey2009-05-201-2/+2
|
* Rename uses of QGLShaderProgram::errors() to log()Rhys Weatherley2009-05-011-2/+2
| | | | Reviewed-by: trustme
* Make useCorrectShaderProg() return a bool againTom Cooksey2009-04-221-8/+8
| | | | | 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-221-1/+1
|
* Kill unused SimpleVertexShader & rename vertex coords arrayTom Cooksey2009-04-201-1/+0
| | | | | | | | 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-201-1/+7
|
* Add a "shocking pink" shader for rendering into stencil buffTom Cooksey2009-04-171-2/+24
| | | | | | 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. :-)
* Don't seg-fault when the shader prog is in the cacheTom Cooksey2009-04-161-1/+2
|