summaryrefslogtreecommitdiffstats
path: root/src/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Port QX11GLPixmapData & QX11GLWindowSurface to new QEgl APITom Cooksey2010-03-055-196/+74
| | | | | | | It's still just as buggy, but at least it allows us to remove a lot of crud from qgl_x11egl.cpp. Reviewed-By: TrustMe
* Fix build when egl.h includes X11 headers & pollutes namespaceTom Cooksey2010-03-041-7/+1
| | | | | | | At some point we should fix the include order in all the .cpp files, however #udef'ing the defines we use elsewhere seems to work for now. Reviewed-By: TrustMe
* Fix build on EGL implementations where EGLConfig is a pointerTom Cooksey2010-03-041-3/+2
| | | | | | | EGLConfig is an opaque type which we really shouldn't cast to an int. Instead, we get the config id for the EGLConfig. Reviewed-By: TrustMe
* Add and use QGLContextPrivate::eglSurfaceForDevice()Tom Cooksey2010-03-024-4/+33
| | | | | | | | | The QGLContext only stores the EGLSurface for QWidgets & QGLWidgets, other device types like QPixmap & QGLPixelBuffer store the surface themsselves. With this patch it is possible to create a QGLContext on a QPixmap, make it current and render GL to that QPixmap on X11. Reviewed-By: TrustMe
* Make bindTextureFromNativePixmap use new QEgl APIsTom Cooksey2010-03-021-2/+7
| | | | | | | The old qt_chooseEGLConfigForPixmap & qt_createEGLSurfaceForPixmap code will remain until QX11GLPixmapData can be re-written properly. Reviewed-By: TrustMe
* Move QGLWidget::setContext logic into QEgl & QGLContextTom Cooksey2010-03-022-130/+55
| | | | | | | | | | | | | | | | QEgl::createSurface() on X11 will now check to see if the device's X11 Visual is compatible with the EGLConfig passed in. If it is not compatible, the function will re-create the QPaintDevice's native drawable with a different Visual (one which is compatable with the EGLConfig). This represented the bulk of the QGLWidget::setContext method which is now much simpler. As a consequense of this change, QWidgets with graphicssystem opengl will behave much more like QGLWidget as most of the code is re-used. So things like WA_TranslucentBackground should now work with opengl graphicssystem too. Reviewed-By: TrustMe
* Move EGL surface type setting to new QEglProperties::setDeviceTypeTom Cooksey2010-03-026-39/+40
| | | | | | Also renamed qt_egl_set_format->qt_eglproperties_set_glformat Reviewed-By: TrustMe
* Replace qt_egl_add_platform_config with existing QEglProperties APITom Cooksey2010-03-024-35/+3
| | | | | | | QEglProperties::setPaintDeviceFormat() seems to be a copy & paste of qt_egl_add_platform_config for every platform anyway. Reviewed-By: TrustMe
* Use QEgl::display in QGLTemporaryContext so EGL is init'd only onceTom Cooksey2010-03-021-6/+1
| | | | Reviewed-By: Trond Kjernåsen
* Remove qt_egl_setup_x11_visualTom Cooksey2010-03-021-149/+1
| | | | | | | This method has been re-written as QEgl::getCompatibleVisualId() which is much cleaner code. Reviewed-By: TrustMe
* Make QGLWidget use new QEgl::getCompatibleVisualId APITom Cooksey2010-03-021-3/+15
| | | | Reviewed-By: TrustMe
* Move static methods from QEglContext to QEgl namespaceTom Cooksey2010-03-024-24/+22
| | | | Reviewed-By: Aleksandar Sasha Babic
* Move qegl_p.h -> qeglcontext_p.h and add a new qegl_p.hTom Cooksey2010-03-024-3/+6
| | | | | | | | This puts the QEgl namespace in a single file which can be used by both qeglcontext and qeglproperties. Files which need QEglContext should now include qeglcontext_p.h. Reviewed-By: Aleksandar Sasha Babic
* Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into master-s60axis2010-02-261-1/+1
|\ | | | | | | | | | | Conflicts: qmake/generators/symbian/initprojectdeploy_symbian.cpp qmake/generators/symbian/symmake_abld.h
| * Fix off-by-one error in mipmap count when loading PVRTC filesRhys Weatherley2010-02-241-1/+1
| | | | | | | | | | Task-number: QT-2988 Reviewed-by: Julian de Bhal
* | Remove comment in drawStaticTextItem() in GL engineEskil Abrahamsen Blomfeldt2010-02-241-1/+0
| | | | | | | | | | | | | | | | | | | | Removing this comment, as a decision was made. QStaticText is an optimization class. Forcing a fallback for all fonts over a certain size would be to intrusive. People should get to decide for themselves whether to cache the text or not when using QStaticText. They can always fall back to drawText() themselves. Reviewed-by: TrustMe
* | Made the qDrawPixmaps() API public (with modifications).Trond Kjernåsen2010-02-232-25/+29
| | | | | | | | | | | | | | | | | | QPainter has now gotten a drawPixmapFragments() function together with a Fragment class that describes how each pixmap fragment is supposed to be drawn. Reviewed-by: Gunnar Reviewed-by: Samuel
* | Merge remote branch 'origin/master' into qt-master-from-4.6Thiago Macieira2010-02-2010-84/+333
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: configure.exe src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/qgl.cpp
| * \ Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml into ↵Qt Continuous Integration System2010-02-191-1/+3
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-qml: (81 commits) Revert "Speed up QmlGraphicsItem::setParentItem." Fix dynamic example More strict type checking of ListElement properties. Fix tst_QmlGraphicsLoader::networkRequestUrl autotest. Fix tst_qmlgraphicstextedit::delegateLoading autotest Delete the QmlImageRequestHandler in the correct thread. Fix "AnimatedImage ignores Anchors setting" Remove unused function that breaks build on AIX. doc Add support for startDragDistance in qmlviewer. Add pixmap benchmarks and make cached rounded rect the same as Rectangle. Make QmlDom API internal Compile fix with namepaces Doc: reformulate why we build a button Removed incorrect Q_UNUSED() macro from QmlPropertyAnimation::transition Doc: onExited, onEntered only work when button pressed or hoverEnabled Ensure visibleIndex and currentIndex are updated on itemsMoved(). QmlView API review. See QmlChanges.txt for details. Fix example after introduction of RotationAnimation. Animation doc fix. ...
| | * \ Merge branch 'master' of scm.dev.nokia.troll.no:qt/qtMartin Jones2010-02-184-10/+9
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/linux-g++-x11egl/qplatformdefs.h src/declarative/qml/qmldom.h src/declarative/util/qmlview.cpp src/declarative/util/qmlview.h tools/qdoc3/cppcodemarker.cpp tools/qmldebugger/standalone/canvasframerate.cpp tools/qmldebugger/standalone/engine.cpp tools/qmldebugger/standalone/expressionquerywidget.cpp tools/qmldebugger/standalone/expressionquerywidget.h tools/qmldebugger/standalone/objectpropertiesview.cpp tools/qmldebugger/standalone/objectpropertiesview.h tools/qmldebugger/standalone/objecttree.cpp tools/qmldebugger/standalone/qmldebugger.cpp tools/qmldebugger/standalone/watchtable.cpp tools/qmldebugger/standalone/watchtable.h
| | * | | MOBILITY-404 QS Windows.Wolfgang Beck2010-02-161-1/+3
| | | | |
| * | | | Merge remote branch 'qt/master' into staging-2-masterQt Continuous Integration System2010-02-184-10/+9
| |\ \ \ \ | | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | Conflicts: tools/assistant/tools/assistant/helpviewer_qtb.h tools/assistant/tools/assistant/helpviewer_qwv.cpp tools/assistant/tools/assistant/helpviewer_qwv.h
| * | | | Fix warnings on gccEskil Abrahamsen Blomfeldt2010-02-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gcc warns if declaration and initialization order are different. Reviewed-by: Samuel
| * | | | Add experimental VBO support for drawCachedGlyphs()'s index arrayEskil Abrahamsen Blomfeldt2010-02-182-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code is disabled by default, but included for testing on different platforms. Intuition implies that caching the index array in a VBO should be a performance improvement, but so far our tests do not confirm this. Reviewed-by: Gunnar
| * | | | Optimization for text drawing on OpenGLEskil Abrahamsen Blomfeldt2010-02-182-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only call glBindTexture() if the glyph cache texture is not already bound. This can potentially give performance improvement of around 30%. Reviewed-by: Gunnar
| * | | | Some threading improvements to the GL moduleGunnar Sletta2010-02-173-18/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make bindTexture threadsafe - Document which areas of QGLWidget needs locking in order to do out-of-gui thread rendering - Testcases to prove that these cases work Reviewed-by: Trond
| * | | | Fix alpha check for OpenGL/ES in GL2 paint engineRhys Weatherley2010-02-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GL_RGB5 and GL_RGB8 don't exist on OpenGL/ES systems. Reviewed-by: Julian de Bhal
| * | | | Merge remote branch 'qt/master' into staging-2-masterQt Continuous Integration System2010-02-152-2/+13
| |\ \ \ \ | | | |/ / | | |/| | | | | | | | | | | | Conflicts: tests/auto/qlineedit/tst_qlineedit.cpp
| * | | | Merge branch 'master' of scm.dev.troll.no:qt/oslo-staging-2 into qstatictext-4.7Eskil Abrahamsen Blomfeldt2010-02-1525-448/+4823
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp tests/auto/qlineedit/tst_qlineedit.cpp Merge branch 'master' of scm.dev.troll.no:qt/oslo-staging-2 into qstatictext-4.7 Conflicts: src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp tests/auto/qlineedit/tst_qlineedit.cpp Merge branch 'master' of scm.dev.troll.no:qt/oslo-staging-2 into qstatictext-4.7 Conflicts: src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp tests/auto/qlineedit/tst_qlineedit.cpp
| * | | | | Make QStaticText public API againEskil Abrahamsen Blomfeldt2010-02-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QStaticText was previously made private API to support inclusion in Qt 4.6.x. This change turns it back into public API for Qt 4.7.0.
| * | | | | Revert 004b09ffd423cd3100e346825dd7d730fc86d366Eskil Abrahamsen Blomfeldt2010-02-101-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing the height here will make the coords out of sync with the ' buffer, causing broken drawing. I revert this change to prepare QStaticText for integration, and will revisit it later on.
| * | | | | Merge branch 'qstatictext-4.6' of ↵Eskil Abrahamsen Blomfeldt2010-02-101-1/+5
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | git@scm.dev.nokia.troll.no:qt/qt-graphics-team into qstatictext-4.6
| | * | | | | Make the GL glyph cache a POT textureEskil Abrahamsen Blomfeldt2010-02-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a significant speed-up on some architectures and drivers.
| * | | | | | Merge branch '4.6' into qstatictext-4.6Eskil Abrahamsen Blomfeldt2010-02-103-3/+4
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| * | | | | | Use glDrawElements and triangle strips to draw glyphs in GL engineEskil Abrahamsen Blomfeldt2010-02-093-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We keep around a engine-global index array which we only grow when we need to. This should hopefully speed up text drawing on some devices.
| * | | | | | Remove VBO caching and glDrawElements path in QStaticTextEskil Abrahamsen Blomfeldt2010-02-081-124/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | glDrawElements needs to be handled properly, using triangle strips rather than triangle lists, so the code has been removed for now. The VBO caching did not gain us any particular performance. We rather cache the client-side buffers for the same speed-up but with less clean-up complexity.
| * | | | | | Clean up VBOs cached in QStaticText when context is deletedEskil Abrahamsen Blomfeldt2010-02-051-18/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow pattern from qpaintengine_opengl.cpp and listen for the destroyed signal of the GL context. If the context that owns the VBOs is deleted, then we delete the VBOs as well.
| * | | | | | Add explanatory comment to QGL2PaintEngineExPrivate::drawCachedGlyphsEskil Abrahamsen Blomfeldt2010-02-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A small hack to turn off the current matrix when drawing QStaticText, since its coordinates are already transformed.
| * | | | | | Recreate cached vertex arrays for QStaticText when drawn to new contextEskil Abrahamsen Blomfeldt2010-02-051-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you draw the QStaticText object to a new QGLWidget, then we need to recreate the VBOs (if the vertex arrays are cached.) It would be possible to share this across contexts, which can be implemented later as an extra optimization for switching between different target devices.
| * | | | | | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Eskil Abrahamsen Blomfeldt2010-02-043-1/+7
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | qstatictext-4.6
| * | | | | | | Small optimization for QStaticText when used with index arraysEskil Abrahamsen Blomfeldt2010-02-041-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't recalculate the index array when the glyphs are simply moved.
| * | | | | | | Fix broken text drawing in OpenGL engine when text items are too longEskil Abrahamsen Blomfeldt2010-02-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing text through drawElements introduced a bug when text items exceeded the range of GLubyte (seen in textedit demo.)
| * | | | | | | Add experimental support for using drawElements to draw cached textEskil Abrahamsen Blomfeldt2010-02-021-3/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to some design documents, drawElements() is likely to be quicker on some devices, as the driver then does not have to create the index array. To test the impact of this, we cache use drawElements and cache the index array in QStaticText
| * | | | | | | Merge branch '4.6' into qstatictext-4.6Eskil Abrahamsen Blomfeldt2010-02-0114-394/+522
| |\ \ \ \ \ \ \
| * | | | | | | | Fix transformed painting of QStaticText in GL2 paint engineEskil Abrahamsen Blomfeldt2010-02-012-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GL2 paint engine was rewritten to use GL to transform glyphs when copying them from the glyph cache instead of keeping a separate cache for different transformations. Since the glyph positions in QStaticText already include the transformation, we need to run the gl calls with an identity matrix, otherwise the position of the glyphs will be transformed twice. The output from drawText() and drawStaticText() will for the same reason look different for the two different engines. The option here is to detect the problem when drawing to the opengl2 engine, and then recalculating the glyph positions for the QStaticText. This will of course create a big overhead when regularly switching between different paint devices, but it might make sense to optimize for one QStaticText per paint device. For the time being I haven't done that, though, since that change would require a bigger hack, so it warrants deeper consideration.
| * | | | | | | | Make QStaticText private APIEskil Abrahamsen Blomfeldt2010-02-012-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns QStaticText into private API in preparation for Qt 4.6.x. The related functions in QPainter are marked as internal in the docs. There are already internal functions in QPainter, so this seemed like a reasonable solution. Since the functions require QStaticText they will not be accessible to anyone who does not include private API.
| * | | | | | | | Compile on WindowsEskil Abrahamsen Blomfeldt2010-02-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default GL header on Windows is GL 1.1, so the 1.5 extensions are not defined. To work around this, we define the macros when needed. The macros are required for QStaticText's OpenGL backend.
| * | | | | | | | Remove reference to _ARB macrosEskil Abrahamsen Blomfeldt2010-02-011-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These belong to an OpenGL extension which is not in use.
| * | | | | | | | Improve performance of QStaticText on OpenGL by caching data on GPUEskil Abrahamsen Blomfeldt2010-01-291-10/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a big improvement to be seen in the OpenGL engine by caching the vertex data for the QStaticText in VBOs. In order to have the buffers properly disposed, I've implemented a userdata concept for QStaticTextItem. By default, the optimizations will be turned off, and can be turned on by using the useBackendOptimizations flag.
| * | | | | | | | Inline QGL2PEXVertexArray::addRect()Eskil Abrahamsen Blomfeldt2010-01-192-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimization for drawStaticText()