summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix OpenGL2 paint engine compilation issueRhys Weatherley2010-03-161-1/+1
| | | | Reviewed-by: Daniel Pope
* Implement a special case, simplified vertex shader for complex geometryEskil Abrahamsen Blomfeldt2010-03-161-0/+12
| | | | | | | | | | When drawing text, the vertex count will most likely be so high that using a uniform-based, simpler vertex shader is faster. We implement the ability to inform the shader manager that the geometry is considered complex, so that it can choose the simpler vertex shader in these cases. Task-number: QT-2887 Reviewed-by: tom
* Use an attribute value for the PMV matrix rather than a uniformTom Cooksey2010-01-211-1/+4
| | | | | | | | | | | | | | This has several advantages: First, updating an attribute value seems to be cheaper than updating a uniform. Second, vertex atribute values are independent of shader program, which means they persist across changing of the shader program. This makes code simpler and reduces GL state changes. Note: Credit goes to Samuel for finding this little gem. :-) For the 25920 solid QGraphicsRectItem test case, this gives 10% improvement on desktop and 27% on the SGX. Reviewed-By: Kim
* Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-01-071-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QIODevice: Fix readAll() Temporary hackiesh solution to prevent BOM in the xml data. Fixed qxmlstream autotest when using shadow builds. Attempt at readding the capital P headers for Phonon Remove special Phonon processing from syncqt. Use the lowercase/shortname.h headers for Phonon includes Fixes a crash when setting focus on a widget with a focus proxy. Update copyright year to 2010 doc: Clarified activeSubControls and subControls. Remove warning "statement with no effect" doc: Clarified that .lnk files are System files on Windows.
| * Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | fix a memory leak in QGLEngineSharedShadersjianliang792009-12-301-0/+1
| | | | | | | | | | Merge-request: 412 Reviewed-by: Tom Cooksey <thomas.cooksey@nokia.com>
* | Track which vertex attrib arrays are enabled in QGLContextPrivateTom Cooksey2009-12-301-0/+3
|/ | | | | | | | | | | | | The GL2 engine (and probably Qt/3D) needs to track which vertex attribute arrays are currently enabled and which are disabled. As this is per-context state, the logical place to track this is in the context and not in the paint engine. This patch also makes the GL2 engine's shader manager enable/disable the appropriate attribute arrays for a given shader program when it is used. Reviewed-By: Kim
* Remove pointless const's from functions (internal API)Tom Cooksey2009-12-291-2/+2
| | | | | | | This change is in response to the review for b063135, but was missed from that patch. Reviewed-By: Kim
* Lots of mostly cosmetic cleanups to GL2 paint engineTom Cooksey2009-12-281-2/+2
| | | | | | | | | | | | | | | * Move most of drawPixmaps to private * Move most of stroke to private * Remove dead code: context() * Make optimiseForBrushTransform use xform type * Use GLuint for uniform location * Rename lastTexture -> lastTextureUsed * Move qopengl2paintengine_cleanup_vectorpath to private * Re-ordered declarations in header * Remove dead temporaryTransform * Rename use_system_clip -> useSystemClip Reviewed-By: Kim
* Safeguard isNull() pixmaps in bindTexture and remove a compile warningGunnar Sletta2009-11-021-1/+1
| | | | Reviewed-by: TrustMe
* Implement a simple caching algorithm for shader programs.Tom Cooksey2009-10-301-2/+11
| | | | | | | | | | 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-33/+45
| | | | This patch also adds a "snippetNameStr" helper for debugging.
* Refactor of shader manager to not use partial shadersTom Cooksey2009-10-301-32/+32
| | | | | | | | | 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 support for drawing a pixmap multiple times in one call.Kim Motoyoshi Kalland2009-10-021-2/+12
| | | | | | | | | 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-1/+1
| | | | Reviewed-by: Sarah Smith
* Resubmit support for subpixel antialiasing on text in the GL2 engine.Kim Motoyoshi Kalland2009-09-221-3/+5
| | | | | | | 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-5/+3
| | | | This reverts commit 1b34feacef7a2d3ac005449a7cfbcb08a6bbf947.
* Resubmit support for subpixel antialiasing on text in the GL2 engine.Kim Motoyoshi Kalland2009-09-211-3/+5
| | | | | | | 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-5/+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/+5
| | | | | | 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-2/+0
| | | | | | | | | | 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-0/+2
|
* 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-69/+90
| | | | | | | | | 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
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* Added missing precision specifiers to custom shader effect.Samuel Rødal2009-08-261-1/+1
| | | | | | The precision specifiers need to be there on OpenGL ES 2.0. Reviewed-by: Tom
* Removed warnings / debug output in the GL 2 engine / pixmap filter code.Samuel Rødal2009-08-251-1/+0
| | | | 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
* | Fixed various valgrind-reported issues in GL 2 engine.Samuel Rødal2009-07-291-2/+1
| |
* | Improve GL filter performance by caching custom shader programs.Samuel Rødal2009-07-281-0/+3
| | | | | | | | 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-11/+11
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Added caching of custom shader programs as well in GL 2 shader manager.Samuel Rødal2009-07-011-1/+4
| | | | | | | | | | | | | | | 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-9/+32
| | | | | | | | | | | | | | | This will make it easier to implement pixmap filters, YUV->RGB conversions, etc in other parts of Qt.
* | | Make it easier to change custom shaders.Rhys Weatherley2009-07-241-0/+1
| | |
* | | Initial stab at a custom shader stage APITom Cooksey2009-07-231-5/+25
| |/ |/|
* | Fixed GL2 engine shader manager to work with more than one context.Kim Motoyoshi Kalland2009-07-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+22
|/ | | | | | Simplified caching of uniform locations. Reviewed-by: Samuel
* Reduced number of state changes/uniform location queries in GL2 engine.Samuel Rødal2009-06-241-3/+10
| | | | | | | 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-1/+7
| | | | | | | | | 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
* 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>
* Implemented QGLTextureGlyphCache to avoid wasting glyph cache memory.Samuel Rødal2009-06-031-0/+4
| | | | | | | | | 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
* 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-221-2/+1
| | | | | 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-2/+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-3/+6
|
* Add a "shocking pink" shader for rendering into stencil buffTom Cooksey2009-04-171-0/+1
| | | | | | 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. :-)
* Clean up existing & implement missing GLSL for new shader managerTom Cooksey2009-04-161-1/+2
|