summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
Commit message (Collapse)AuthorAgeFilesLines
* Suppress some compiler warnings that occur under OpenGL/ES 2.0Rhys Weatherley2009-09-281-0/+4
| | | | Reviewed-by: trustme
* Added #define to GL 2 paint engine to turn off scissor testing.Samuel Rødal2009-09-251-15/+27
| | | | Reviewed-by: Gunnar Sletta
* Made fast blur in GL 2 engine be radius independent.Samuel Rødal2009-09-241-0/+1
| | | | | | | | | | | This is useful when animating the blur radius, as you don't want to suffer the hit of compiling / linking a new shader program for each radius the first time the animation is played. Also use the fast blur when the radius is 5 or below, as the quality difference is insignificant. Reviewed-by: Rhys Weatherley
* Added a comment to clarify the purpose of a piece of code.Trond Kjernåsen2009-09-231-1/+1
| | | | Reviewed-by: Trust Me
* Fixed a warning.Trond Kjernåsen2009-09-221-0/+2
| | | | Reviewed-by: Kim
* Fixed text drawing in the GL2 engine after sub-pixel hinting was added.Trond Kjernåsen2009-09-222-19/+29
| | | | | | | | | | 1. The mono format was not handled at all. 2. We really, really wanted to use sub-pixel hinted glyphs even when they were not available. 3. The glyphFormat type in the FT font engine wasn't updated to reflect the correct system glyph type. Reviewed-by: Kim
* Resubmit support for subpixel antialiasing on text in the GL2 engine.Kim Motoyoshi Kalland2009-09-225-23/+174
| | | | | | | 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-215-174/+23
| | | | This reverts commit 1b34feacef7a2d3ac005449a7cfbcb08a6bbf947.
* Optimized GL2 engine to use scissor clipping more aggressively.Samuel Rødal2009-09-212-95/+72
| | | | | | | | | | | | | | | | There's no reason to stop using a scissor clip when a more complex clip is set. Instead, we can use a combination of scissoring and depth clipping to represent the final clip. When intersecting with a new clip path, if the clip path is a rectangle we simply intersect it against the scissor clip, and otherwise we intersect its bounding rect against the scissor clip and write the actual path to the depth buffer. The patch simplifies the logic in clip() quite a bit, except in the UniteClip case in which we don't care about performance anyways. It also fixes a bug which could cause rendering errors if the stencil buffer contains junk before painting. Reviewed-by: Gunnar Sletta
* Resubmit support for subpixel antialiasing on text in the GL2 engine.Kim Motoyoshi Kalland2009-09-215-23/+174
| | | | | | | The antialiasing is currently not gamma corrected and is disabled on OpenGL ES 2.0. Reviewed-by: Samuel
* Performance: reduce overhead of updateMatrix() in GL2 paint engineRhys Weatherley2009-09-211-32/+45
| | | | | | | | | | | The original code was performing 40 floating-point multiplications, 40 additions, and 2 divisions every time the matrix was changed. Because most of the components in the orthographic projection matrix are trivial, we can implement the same transformation with only 6 multiplications, 6 additions, and 2 divisions. Reviewed-by: Sarah Smith
* Revert "Added support for subpixel antialiasing on text in the GL2 engine."Rhys Weatherley2009-09-175-169/+22
| | | | | | 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-165-22/+169
| | | | | | The antialiasing is currently not gamma corrected. Reviewed-by: Samuel
* Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-09-162-9/+6
|\
| * Reduce overhead of paint engine-specific pixmap filtersRhys Weatherley2009-09-162-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Engine-specific pixmap filters were being created, used, and destroyed every time draw() was called on QPixmapColorizeFilter, QPixmapBlurFilter, and so on. This had a heavy performance penalty and made it difficult for the GL paint engine to cache shaders from one request to the next. A generic filter can request an engine-specific filter that matches its parameters. The engine can either create a new one or return a previously allocated filter object. Ownership of engine-specific pixmap filter objects is moved to the paint engine itself. Reviewed-by: Andrew den Exter Reviewed-by: Michael Brasser Reviewed-by: Michael Goddard Reviewed-by: Sarah Smith
* | Fixed glsl warnings on mac and stop using texturecoords when not neededGunnar Sletta2009-09-163-26/+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-152-1/+5
|/
* Fixed rendering errors in blurpicker with -graphicssystem openglSamuel Rødal2009-09-151-0/+1
| | | | | | | | | | | | | | | | 1) Need to transfer to brush drawing mode when switching active engine, to make sure we reset the vertex / texture coordinate pointers for image drawing. 2) QGLPixmapGLPaintDevice::beginPaint() was changed to use QGLContext::drawTexture() for blitting the old texture contents to the render FBO, which means that we also need to set up viewport, modelview, and projection matrices, and ensure that clipping / stencil testing is disabled. 3) Make sure stencil testing is disabled when clearing the FBO. Reviewed-by: Tom
* Really fixed clipping bug in portedcanvas with -graphicssystem opengl.Samuel Rødal2009-09-141-1/+1
| | | | | | | | Change c72eaee91136bbe1a9fa99cdb0a7593bec60264b was wrong, we should call ensureActive(), not syncState(). Task-number: 261113 Reviewed-by: Trond
* Fixed clipping bug in GL 2 engine.Samuel Rødal2009-09-141-0/+1
| | | | | | | | | | | When dumping the rectangle clip to the depth buffer due to needing to intersect with a more complex clip, we didn't take into consideration that writeClip will transform the path by the current matrix, whereas the rectangle clip is in device coordinates. Thus, we need to map the path by the inverse matrix. Task-number: 260701 Reviewed-by: Trond
* Fixed clipping bug in portedcanvas with -graphicssystem openglSamuel Rødal2009-09-141-0/+3
| | | | | | | | | We need to call ensureActive() when save() is called, to make sure systemStateChanged() gets called and updates the scissorTestEnabled flag, so that we don't lose it on the next restore(). Task-number: 261113 Reviewed-by: Trond
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-09-141-0/+12
|\
| * Fix drawTiledPixmap for NPOT pixmaps on OpenGL ES 2.0Tom Cooksey2009-09-141-0/+12
| | | | | | | | | | | | | | | | | | OpenGL ES does not support GL_REPEAT wrap modes for NPOT textures. So instead, we emulate GL_REPEAT by only taking the fractional part of the texture coords in the fragment shader. Task-number: 260982 Reviewed-by: Samuel
* | Some small optimizations to gl2 engine.Gunnar Sletta2009-09-142-30/+11
| | | | | | | | | | | | | | | | | | | | 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
* | Fixed crash in gl when stroking with a Qt::NoBrush penGunnar Sletta2009-09-141-1/+3
|/ | | | Reviewed-by: Samuel
* Fixed clipping bugs in GL2 graphics system with oxygen style.Samuel Rødal2009-09-111-1/+3
| | | | | | | | | | QGL2PaintEngineEx::clip() needs to call ensureActive() to make sure the engine is active and synced before doing any clipping operations. We also need to set needsSync to false before entering setState() since otherwise we end up in an infinite loop in the case where replayClipOperations() again calls QGL2PaintEngineEx::clip(). Reviewed-by: Tom
* Re-order begin() so everything needing a current context has oneTom Cooksey2009-09-101-12/+12
| | | | | | | | | | | | It should be up to QGLPaintDevice::beginPaint() to make the correct context current, so everything needing a current context needs to be moved after that call. This patch also modifies QGLPixmapData to use QGLContext::drawTexture rather than the GL2 PE's drawTexture, which shouldn't be called inside beginPaint as the paint engine hasn't been fully initialised yet. Reviewed-by: Eskil
* Fixed rendering of text with gradient pen in GL 2 engine.Samuel Rødal2009-09-101-5/+4
| | | | | | | | | We should bind the text mask texture after calling prepareForDraw(), since prepareForDraw() might need to initialize the gradient texture, which means the text mask will no longer be bound. Task-number: 261058 Reviewed-by: Kim
* Fix crash in gl2 paint engine on WindowsEskil Abrahamsen Blomfeldt2009-09-101-1/+3
| | | | | | | | | | | wglGetProcAddress() on Windows requires a current context. Since there was none, the resolution of GL extensions would silently fail, the function pointers would be null and when we tried to use them later we would get a crash (e.g. in startup of PadNavigator.) I've added an assert to make the cause of the crash clearer, and a makeCurrent() to fix the crash. Reviewed-by: Tom
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-09-0911-107/+65
|\ | | | | | | | | | | | | Conflicts: src/opengl/qgl.cpp src/opengl/qgl_p.h src/opengl/qpaintengine_opengl.cpp
| * Update license headers again.Jason McDonald2009-09-0911-44/+44
| | | | | | | | Reviewed-by: Trust Me
| * Make QGLPixmapData work with the new QGLPaintDevice APITom Cooksey2009-09-081-20/+4
| | | | | | | | | | | | | | | | | | | | This patch changes the ordering of QGL2PaintEngine::begin a bit because QGLPixmapData needs to use the paint engine's drawTexture method within beginPaint(). Also, this initialises needsSync to true and removes the setState call. So now all the state initialisation is done in ensureActive rather than begin.
| * Move buffer clear out of the paint engine and into the QGLPaintDevicesTom Cooksey2009-09-081-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously, the paint engine cleared the surface's buffers in begin. This logic really belongs in QGLPaintDevice::beginPaint as not all paint devices will want this behaviour (in fact most don't). This also makes QGLPaintDevice API much simpler as the virtual getters for the clear color, etc. can be removed. It's much cleaner this way. The only possible problem is with the GL1 engine, which also cleared the accumulation & depth buffers in begin. However, the engine will also clear the depth buffer later as part of it's clipping logic. It also doesn't use the accumulation buffer, so clearing it seems unnessisary.
| * Make QGLFramebufferObject work again using new QGLPaintDevice APITom Cooksey2009-09-081-26/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch also refactors QGL2PaintEngineEx::ensureActive() and the logic which handles multiple paint engines rendering to the same QGLContext. In a nut-shell: * QGLPaintDevice::beginPaint() stores the currently bound FBO * QGLPaintDevice::ensureActiveTarget() makes sure that GL rendering will end up in the paint device (I.e. the right context is current and the right FBO is bound). If a different context or FBO was bound, it is _not_ remembered. * QGLPaintDevice::endPaint() restores whatever FBO was bound when beginPaint() was called. This logic allows interleaved painter rendering to multiple FBOs and contexts to work as expected. It also allows a stacked begin/end to work properly when it's mixed with native GL rendering (as far as current render target is concerened. GL state clobbering is obviously a different topic). QGLPaintDevice::context() also had to be made virtual as there's no good place to call setContext. This might be possible to change in the future though. Finally, to make this work, QGLFramebufferObjectPrivate had to be moved into it's own private header.
| * Replace QGLDrawable with a new QGLPaintDeviceTom Cooksey2009-09-082-30/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new abstract base class which inherits from QPaintDevice called QGLPaintDevice. This base class will contain everything the GL paint engines need to know about the surface they are drawing onto. As such, new surfaces can be targeted by the GL paint engines without having to modify QtOpenGL. This is very useful for plugins, specifically QGraphicsSystem plugins. To unify things a little, the GL paint engines will use the same QGLPaintDevice API to render into existing target surfaces (QGLWidget, QGLPixelBuffer & QGLFrameBufferObject). Ideally we'd make QGLPaintDevice a common ancestor for these surfaces, but obviously that wil break B/C. This patch only implements QGLWidget using the new interface. Rendering to other surfaces will be fixed in following patches.
* | Fixed y-inversion of pixmap drawing on gl graphics systemGunnar Sletta2009-09-092-2/+5
|/ | | | Reviewed-by: Trond
* Fixed crash in tst_qgl.Samuel Rødal2009-09-031-3/+4
| | | | | | | The shader manager needs to be recreated since the context it was created with might not be valid any more. Reviewed-by: Kim
* Fixed a system clip issue in the GL 2 engine.Trond Kjernåsen2009-09-021-3/+9
| | | | | | | | QGraphicsView can set the system clip in order to handle clipping of QGraphicsView children, and we have to take that into account in the GL 2 engine, as we did in the GL 1 engine. Reviewed-by: Samuel
* Split QGLEngineShaderManager into a shared and a per engine part.Kim Motoyoshi Kalland2009-09-025-295/+331
| | | | | | | | | 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
* Fixed poor utilization of depth buffer range in GL 2 paint engine.Samuel Rødal2009-09-012-29/+41
| | | | | | | | | | | | | | | | | Before this patch we were only able to do 20 or so IntersectClips before failing, this patch instead adapts to the fixed point nature of typical depth buffer implementations and lets us do ~2^15 IntersectClip operations before failing, which should be a reasonable limit for any real-world application. Using the following mapping of old floating point depths to integer depths: -1.0 -> 0, -0.5 -> 1, 0.0 -> 2, 0.25 -> 3, 0.5 -> 4, 0.625 -> 5, etc.. Reviewed-by: Tom
* Fixed a problem with corrupted text in the GL 2 engine.Trond Kjernåsen2009-08-311-0/+1
| | | | | | | Blending should not be enabled when copying the font cache texture into the fbo. It *may* cause artifacts with some drivers. Reviewed-by: Samuel
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-315-65/+65
| | | | Reviewed-by: Trust Me
* Fixed inverted pixmaps when using OpenGL graphics effects.Samuel Rødal2009-08-311-1/+3
| | | | | | | QGL2PaintEngineExPrivate::drawTexture() texture coordinates have been inverted, so they need to be inverted here too. Reviewed-by: Kim
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-316-78/+78
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
| * Update tech preview license header.Jason McDonald2009-08-3111-143/+143
| | | | | | | | Reviewed-by: Trust Me
| * Update license headers.Jason McDonald2009-08-1111-11/+11
| | | | | | | | Reviewed-by: Trust Me
* | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-08-282-18/+75
|\ \
| * | Fixed QGLWidget::renderText() when using the GL 2 paint engine.Trond Kjernåsen2009-08-282-18/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | QGLWidget::renderText() needs to respect the current depth and scissor tests that the user has set. Therefore we needs some special casing in the GL 2 paint engine to handle the custom depth testing. The private setRenderTextActive() has been added for this purpose. Reviewed-by: Samuel
* | | Attempting to make EGL compile again and fix some potentialGunnar Sletta2009-08-281-1/+3
|/ / | | | | | | issues with flipped pixmaps on X11