summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
Commit message (Collapse)AuthorAgeFilesLines
* Use 3x3 PMV matrices rather than 4x4 in the GL2 engineTom Cooksey2009-12-223-64/+62
| | | | | | | | | | | | | QGraphicsView based applications will set a new transform for every item before it's painted. This leads to lots of updates to the PMV matrix. So switching to a 3x3 rather than a 4x4 gives us less data to pass to GL for each QGraphicsItem which gets rendered. It also means the vertex shader is more efficient. However, this patch only gives a maximum 2.5% speed improvement on the SGX, which seems to be only due to the faster vertex shader rather than the reduced amount of data we pass to GL. Reviewed-By: Kim
* Handle broken shaders better in the GL2 engine's shader managerTom Cooksey2009-12-221-77/+114
| | | | | | | The shader manager will now a) not seg-fault and b) actually tell you which shader has the error. Reviewed-By: Kim
* Prevent access to non-existent memory in triagulating strokerRhys Weatherley2009-12-181-2/+8
| | | | | | | | | | | | | In the triangulating stroker, the last point was being duplicated in dashed paths. But because QDataBuffer::add() takes a ref to a float rather than a float, it would resize the data buffer and then try to fetch the values out of a pointer to the original buffer memory. This change copies the values into temporary variables before resizing the array. Task-number: QTBUG-6045 Reviewed-by: Sarah Smith
* GL2Engine: Don't mark brush as dirty if it hasn't changedTom Cooksey2009-12-173-34/+41
| | | | | | | | If the same brush is used over and over again, this gives a huge performance boost (measured to be 25% faster on desktop and 73% faster on SGX). Reviewed-By: Samuel Rødal
* Optimized blur / drop shadow effects for the GL 2 paint engine.Samuel Rødal2009-12-142-4/+1
| | | | | | | | | Do the blur in half the resolution in software and then upload the result as a texture and smooth-scale it on the GPU. This leads to stable and decent performance regardless of the blur radius, and simplifies the implementation quite a bit. Reviewed-by: Bjørn Erik Nilsen
* Clean up the QFontEngine glyphcaching code to not crash and be more tidyGunnar Sletta2009-12-101-3/+2
| | | | Reviewed-by: Eskil
* Fix crash when rotating cleartype text under gl engine.Gunnar Sletta2009-12-091-2/+2
| | | | Reviewed-by: Eskil
* Speed up rotated/transformed text on OpenGL2 paint engineGunnar Sletta2009-12-081-61/+34
| | | | | Reviewed-by: Trond Reviewed-by: Tom
* Added caching of vectorpaths to the GL paint engine.Gunnar Sletta2009-12-013-5/+116
| | | | | | | | | | | | | | | The first time a path is drawn we call makeCachable on the path, which means that if it is drawn again, we start caching it. This is a bit of a trick to avoid caching paths that are drawn once and discared while at the same time cache paths that are reused automatically. The GL engine owns the vertex information and is responsible for cleaning it up. If the vectorpath is destroyed first, it will call the cleanup function. if the engine dies first, we still require some hooks to clean up the cache in the path. More to come. When VBO's are used, these will be a leaked if the path is destroyed after the engine. Reviewed-by: Samuel
* Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6Gunnar Sletta2009-12-013-160/+215
|\
| * Fixed square root of negative number in drawTextItem().Kim Motoyoshi Kalland2009-11-301-1/+2
| | | | | | | | | | | | | | | | | | Fixed potential bug where you could end up taking the square root of a negative number in drawTextItem() in the raster and OpenGL paint engines. Task-number: QTBUG-6327 Reviewed-by: Trond
| * Fixed the GL2 engine stroker to handle Qt::SvgMiterJoin.Kim Motoyoshi Kalland2009-11-301-0/+1
| | | | | | | | Reviewed-by: Trond
| * Moved functions from .h to .cpp in the GL2 engine stroker.Kim Motoyoshi Kalland2009-11-262-219/+208
| | | | | | | | | | | | | | Some of the functions had become too long to be inlined in my opinion. Reviewed-by: Trond
| * Fixed miter joins generated by the GL2 engine stroker.Kim Motoyoshi Kalland2009-11-261-17/+36
| | | | | | | | | | | | | | | | | | | | The stroker generated two points for each miter join, one on the convex side of the join, and one on the concave side. For sharp joins between curved segments, the point on the concave side could end up poking out of the stroke. This was fixed by generating one point on the convex side only. Reviewed-by: Trond
| * Fixed round joins generated by the GL2 engine stroker.Kim Motoyoshi Kalland2009-11-251-49/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | Complete circles were generated at every round join, so if the join were close to a flat cap, the circle would extend beyond the flat cap. This was fixed by generating arcs rather than complete circles. Likewise, round caps are now semi-circles instead of full circles. I also removed some unnecessary calculations when generating square caps. Reviewed-by: Trond
| * Fixed subpixel text antialiasing with the GL2 engine on ATI.Kim Motoyoshi Kalland2009-11-251-4/+1
| | | | | | | | | | | | Use subpixel antialiasing even if the there is an alpha channel. Reviewed-by: Trond
| * Ran the script utils/normalizeOlivier Goffart2009-11-181-2/+2
| | | | | | | | Over src/ tools/ examples/ and demos/
* | Don't spend time on adding center point for convex paths, saves a few cycles.Gunnar Sletta2009-11-251-2/+2
| | | | | | | | Reviewed-by: Samuel
* | Replaced QVector in GL2 vertex array with QDataBuffer to reduce mallocsGunnar Sletta2009-11-254-17/+19
| | | | | | | | Reviewed-by: Tom Cooksey
* | Optimized the bezier flattening a bitGunnar Sletta2009-11-252-40/+17
|/ | | | | | Testcase with rounded rects went from 55 -> 62 FPS for 1000 random rects Reviewed-By: Tom Cooksey
* Fixed stroking of cosmetic dashed pens with the GL2 paint engine.Kim Motoyoshi Kalland2009-11-131-6/+3
| | | | | | | | Also fixed square caps which in some cases were extruded in the wrong direction. Task-number: QTBUG-5736 Reviewed-by: Trond
* Fixed stroking of discontinuous paths with the GL2 engine.Kim Motoyoshi Kalland2009-11-132-4/+3
| | | | | | | | | | Since the stroke is rendered as a triangle strip, zero area triangles must be inserted in order to have gaps in the stroke. This is achieved by duplicating vertices before and after each gap. It was already done for open subpaths. This commit fixes gaps between closed subpaths. Task-number: QTBUG-5736 Reviewed-by: Gunnar
* API review: Rename numRects() -> rectCount()Marius Storm-Olsen2009-11-091-1/+1
| | | | | | | QRegion::numRects() is marked obsolete. Removed all usage of the old function inside Qt and test-cases. Reviewed-by: Andreas Aardal Hanssen
* Fix fuzzy aliased rendering on GLES2Tom Cooksey2009-11-062-2/+13
| | | | | | | | | | The GL2 paint engine adds a (0.49,0.49) pixel offset when doing aliased rendering. But this assumed if it was doing aliased rendering then multisampling was disabled. On GLES, multisampling is always enabled if the surface has it enabled. So on GLES, we never add the offset if the surface is multisampled. Reviewed-By: Gunnar
* Fixed bad joins in the new stroker... Normal generation was broken.gunnar2009-11-051-4/+2
| | | | Reviewed-by: Trustme
* Use fallback stroker for cosmetic strokes with asymetric transformsGunnar Sletta2009-11-051-0/+8
| | | | Reviewed-by: Samuel
* Modify QGLShader and QGLShaderProgram in response to API reviewRhys Weatherley2009-11-052-15/+15
| | | | Reviewed-by: Sarah Smith
* Fixed some compiler warnings.Samuel Rødal2009-11-031-7/+2
| | | | Reviewed-by: Trond
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-graphics-team into 4.6Gunnar Sletta2009-11-021-0/+1
|\
| * Optimized animated blur radii in the GL 2 paint engine.Samuel Rødal2009-11-021-0/+1
| | | | | | | | | | | | | | | | | | We add an internal cache which keeps four half-scaled versions of the source pixmap at different blur radii, then we simply interpolate between the two pixmaps around the desired blur radius, or between the base source pixmap and the first blurred version. Reviewed-by: Gunnar Sletta
* | Better cosmetic pen scaling for beziers in tristroker.Gunnar Sletta2009-11-021-1/+1
| | | | | | | | Reviewed-By: Samuel
* | 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-302-31/+53
| | | | | | | | | | 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-302-71/+93
| | | | This patch also adds a "snippetNameStr" helper for debugging.
* Refactor of shader manager to not use partial shadersTom Cooksey2009-10-304-217/+211
| | | | | | | | | 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
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-10-302-0/+6
|\
| * Fix namespace buildRichard Moe Gustavsen2009-10-282-0/+6
| | | | | | | | | | | | Looks like a couple of files missed the namespace macro... Rev-By: gunnar
* | Added some optimizations to the blur and drop shadow GL filters.Samuel Rødal2009-10-293-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Make use of QVectorPath::isConvex() to speed up rounded rect fillingGunnar Sletta2009-10-271-3/+1
| | | | | | | | Reviewed-by: Samuel
* | Kill a tiny few sin/cos/sqrt calls in the new strokerGunnar Sletta2009-10-262-3/+12
|/ | | | Reviewed-by: Eskil
* Suppress warnings in QtOpenGL codeRhys Weatherley2009-10-261-0/+1
|
* Added license headers to new filesGunnar Sletta2009-10-222-0/+82
|
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-10-221-1/+1
|\ | | | | | | | | Conflicts: src/gui/painting/qtextureglyphcache.cpp
| * Fix dangling shader manager pointersJulian de Bhal2009-10-201-1/+1
| | | | | | | | | | | | | | | | | | The QGLEngineShaderManager pointers in QGLCustomShaderStagePrivate have been changed to QPointers to prevent the QGLPixmapFilters in QGL2PaintEngineEx from dereferencing the QGLEngineShaderManager after it is destroyed. Reviewed-by: Rhys Weatherley
* | Integrated new triangulating stroker into QtGunnar Sletta2009-10-194-52/+726
|/
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-10-192-13/+15
|\
| * Fix save() and restore() for the OpenGL2 paint engine.Rhys Weatherley2009-10-122-13/+15
| | | | | | | | | | | | Task-number: QTBUG-4822, QTBUG-4824 Reviewed-by: Sarah Smith Reviewed-by: Samuel
* | Fixed upside down brush patterns in the OpenGL paint engines.Kim Motoyoshi Kalland2009-10-141-1/+0
| | | | | | | | | | Task-number: QTBUG-2222 Reviewed-by: Gunnar
* | Fixed handling of brush origin in the OpenGL paint engines.Kim Motoyoshi Kalland2009-10-131-5/+5
|/ | | | | | | | Fixed the OpenGL paint engines so that the brush origin is applied correctly and for all brushes just like in the raster paint engine. Task-number: QTBUG-2676 Reviewed-by: Trond
* Optimized rasterizing of paths using stencil method in GL 2 engine.Samuel Rødal2009-10-073-5/+43
| | | | | | | | | | | | Making the triangle fan of each sub path start at the sub path's centroid will on average improve performance for complex paths, because less pixels that are outside the path need to be touched. The centroid is a more balanced choice than just picking the first element of the sub path as triangle fan origin. A performance improvement of 20 % was measured for star formed paths. Reviewed-by: Trond