summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
Commit message (Collapse)AuthorAgeFilesLines
* Fix fallback for QStaticText when it's unsupported in paint engineEskil Abrahamsen Blomfeldt2010-02-191-1/+1
| | | | | | | | When the paint engine does not support QStaticText, we fall back to regular drawText() calls. This fallback would previously paint all text to (0, 0). This fixes the qstatictext autotest on Linux. Reviewed-by: Olivier
* Fix warnings on gccEskil Abrahamsen Blomfeldt2010-02-181-2/+3
| | | | | | Gcc warns if declaration and initialization order are different. Reviewed-by: Samuel
* Fixed old trace files no longer working.Samuel Rødal2010-02-181-1/+3
| | | | | | | Move new static text draw command to the end to avoid invalidating existing traces. Reviewed-by: Eskil
* Reduced the memory footprint of qttrace files.Samuel Rødal2010-02-182-8/+107
| | | | | | | | | | | | A couple of improvements have been made: * Use single precision floats for the traces. * Reduce the number of variant wrapped transforms by introducing a new translate command. * Reduce the number of bytes streamed per image / pixmap draw command. * Add versioning info to qttrace files to be more future proof. Reviewed-by: Gunnar Sletta
* Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2Eskil Abrahamsen Blomfeldt2010-02-172-2/+10
|\
| * Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-02-1724-68/+641
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (105 commits) Fixed compile on Mac. Changelog update for 4.7. Fix license headers. Rename QStaticText::setUseBackendOptimizations to setPerformanceHint() doc: Update documentation for QStaticText Fixed a compile error on Mac/Leopard. Fix alpha check for OpenGL/ES in GL2 paint engine Compile fix for QStaticText - include declaration of QColor Support Qt::AutoTest in QStaticText::setTextFormat() Improved performance of path vs path intersection where one is a rect. Separate out textFormat property from setText() function and remove Update license doc and .pri file for libpng 1.4.0 Our modifications to libpng Add libpng 1.4.0 Delete libpng 1.2.40 Fixes a behaviour for QDockWidget used without QMainWindow Replaced the numCopies()/setNumCopies() and actualNumCopies() API. Add API for rich text and getting actual size of QStaticText Remove fluxuating tests for QStaticText Make QStaticText public API again ...
| | * Fixed compile on Mac.Kim Motoyoshi Kalland2010-02-161-1/+1
| | | | | | | | | | | | Reviewed-by: Prasanth
| * | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into master-s60axis2010-02-166-53/+78
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/symbian/symmake.cpp tests/auto/qlineedit/tst_qlineedit.cpp tests/benchmarks/benchmarks.pro
| | * | Fixed missing repaints on S60 3.1.axis2010-02-151-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug happened when a paint event came in from Symbian, but the painted area was bigger than the exposed rect being passed in by Symbian. In these cases we would lose updates to the area outside. Fixed by calling Draw() once more if we detect that we painted a larger area to the backing store. It is still a mystery why this worked on 5.0 though... :-P AutoTest: QWidget passed RevBy: Jason Barron Task: QTBUG-8200
* | | | Make sure height of glyph cache is a power of twoEskil Abrahamsen Blomfeldt2010-02-171-8/+18
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | Making the size of the glyph cache a power of two can potentially have performance benefits on hardware accelerated graphics systems. Since it will also decrease the number of times the cache has to be copied, and therefore implies a speed-up for all paint engines, it has been implemented for all of them in general. Reviewed-by: Gunnar
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2Eskil Abrahamsen Blomfeldt2010-02-161-1/+1
|\ \ \
| * | | Fixed a compile error on Mac/Leopard.Trond Kjernåsen2010-02-161-1/+1
| | | | | | | | | | | | | | | | Reviewed-by: Carlos Duclos
* | | | doc: Update documentation for QStaticTextEskil Abrahamsen Blomfeldt2010-02-161-0/+23
|/ / / | | | | | | | | | | | | | | | | | | | | | Make some smaller modifications, fixes and additions. Remove \internal because the API is public now, and add documentation for QPainter::drawStaticText() since this was missing. Reviewed-by: TrustMe
* | | Merge remote branch 'qt/master' into staging-2-masterQt Continuous Integration System2010-02-151-0/+3
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: tests/auto/qlineedit/tst_qlineedit.cpp
| * \ \ Merge remote branch 'origin/4.6' into qt-master-from-4.6Thiago Macieira2010-02-126-52/+69
| |\ \ \ | | |/ / | |/| / | | |/
| | * Fixed drawing pixmaps onto bitmaps on X11 w/o Xrender support.Trond Kjernåsen2010-02-101-0/+3
| | | | | | | | | | | | | | | Task-number: QTBUG-8032 Reviewed-by: Kim
* | | Merge branch 'qt-graphics-team-qstatictext-4.7'Eskil Abrahamsen Blomfeldt2010-02-1515-80/+278
|\ \ \
| * \ \ Merge branch 'qstatictext-4.7' of ↵Eskil Abrahamsen Blomfeldt2010-02-154-18/+57
| |\ \ \ | | | | | | | | | | | | | | | git@scm.dev.nokia.troll.no:qt/qt-graphics-team into qstatictext-4.7
| | * \ \ Merge branch 'master' of scm.dev.troll.no:qt/oslo-staging-2 into qstatictext-4.7Eskil Abrahamsen Blomfeldt2010-02-154-18/+57
| | |\ \ \ | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | Separate out textFormat property from setText() function and removeEskil Abrahamsen Blomfeldt2010-02-151-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | isEmpty() function in QStaticText To make the return value of text() more intuitively clearer, and to make the API more readable, I've separated out the text format into a separate property. The isEmpty() function seemed out-of-place in the API, as suggested by reviews, so it has been removed.
| * | | Add API for rich text and getting actual size of QStaticTextEskil Abrahamsen Blomfeldt2010-02-141-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | Required for several use cases, support for some html tags to change font, color and do advanced text layouts, as well as getting the bounds of the text when drawn.
| * | | Make QStaticText public API againEskil Abrahamsen Blomfeldt2010-02-105-51/+61
| | | | | | | | | | | | | | | | | | | | 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.
| * | | Merge branch '4.6' into qstatictext-4.6Eskil Abrahamsen Blomfeldt2010-02-106-52/+76
| |\ \ \ | | | |/ | | |/|
| | * | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-02-101-5/+18
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (ODBC) Use wchar_t instead of assuming 2 bytes. Fixed some global QIcon/QPixmap instances that leaked handles on X11. Speed up QListView test QListView: fix crash when hiding many of the lasts item in a QListView Fixed warnings and crash when painting graphics effects outside scene. Stabilize QLineEdit test on X11 (sqlite) Allow shared cache mode Make generate uid3 (symbian) work on 64 bit host platform. Updated the docs for QPainter::begin/endNativePainting() Compile fix for network benchmarks. Add a pixmap modification hook to blur pixmap filter cache Delete benchmark examples (qtestlib-simple and qtwidgets). Restructure tests/benchmarks directory. Fixed QImagReader::setAutoDetectImageFormat() to work with plugins. QLineEdit: regression: read-only line edits would eat shortcuts. QGraphicsItem: Do not crash at exit if there is static QGraphicsItem. Make QTextCodec reentrant. Fixed bug where GL widget was not fully updated on Vista.
| | | * | Updated the docs for QPainter::begin/endNativePainting()Trond Kjernåsen2010-02-081-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-7661 Reviewed-by: Kim
| | * | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into ↵Qt Continuous Integration System2010-02-101-4/+7
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public: Add the download URI for smart installer package to documentation Catch up symbianutils to creator 3efdb87682a5785bac7b90f9f9a8bb819a1cb053 rename trk -> symbianutils Catch up TRK library to creator f2b3e9f2dfbc580389b9b683a3e46e5a8422f55b Fixed defect in handling of expose events for Symbian Added qwidget test case which displays a native child widget Fix tst_QAbstractItemView::task250754_fontChange and tst_QAbstractItemView::QTBUG6407_extendedSelection for Symbian & 5800
| | | * | | Fixed defect in handling of expose events for SymbianGareth Stockwell2010-02-091-4/+7
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit bc82db did not correctly handle native child widgets. Consider the case when we have a top-level widget A with a native child widget B. When QSymbianControl::Draw() is called on the control corresponding to B, the following occurs: 1. The inExpose flag is set in B's QWExtra structure. 2. The call to syncBackingStore() results in a call to QWidgetBackingStore::flush(), passing default parameters. 3. Because no target widget was passed to flush(), this function selects the top-level widget (A) as the target for the flush operation, passing A as the first argument of QS60WindowSurface::flush(). 4. QS60WindowSurface::flush() checks the inExpose flag from A's QWExtra structure, finds it to be false, and proceeds to call DrawNow() on A's control. Because QSymbianControl::Draw() uses the default graphics context, this context is shared between controls. This means that the DrawNow() call in step 4 causes a WSERV-10 panic (Activate() called on an already-active) graphics context. This patch moves the inExpose flag from B's QWExtra into A's QTLWExtra, with the result that the call to DrawNow() in step 4 is suppressed. Task-number: QTBUG-7960 Reviewed-by: axis
| | * | | Skip the transparent pixels when doing the sourceOverBenjamin Poulain2010-02-091-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blending fully transparent pixels take a non-negligible time when webkit use transparent layer. We can avoid that be skipping those pixels since they have no impact on the final result. Reviewed-by: Samuel Rødal
| | * | | Refactor comp_func_solid_Clear() and comp_func_solid_Source()Benjamin Poulain2010-02-093-42/+35
| | |/ / | | | | | | | | | | | | | | | | | | | | Put the common code together with a #define. Remove the check for the length from comp_func_Clear_impl and move it to qt_memfill()
| * | | Merge branch '4.6' into qstatictext-4.6Eskil Abrahamsen Blomfeldt2010-02-081-3/+1
| |\ \ \
| * | | | Remove redundant friend declaration for QPainterPrivate in QPainterEskil Abrahamsen Blomfeldt2010-02-051-1/+0
| | | | | | | | | | | | | | | | | | | | This is already included in the Q_DECLARE_PRIVATE macro.
| * | | | Temporarily remove QPainter::drawStaticText() for Qt 4.6.x integrationEskil Abrahamsen Blomfeldt2010-02-054-66/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't add new symbols to QPainter for Qt 4.6.x, as we would not be able to remove them again if we regretted the API. Hence, I've made removable symbols instead, a private global function and a drawStaticText() in QPainterPrivate. In order to tie things together, I needed a static private-getter in QPainterPrivate, and hence it had to be a friend of QPainter. Reviewed-by: Trond
| * | | | Use state in QPaintBuffer rather than search for the transform cmdEskil Abrahamsen Blomfeldt2010-02-051-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No reason to look through all the commands, since we have the transform saved in the state. Reviewed-by: Trond
| * | | | Clean up diff for QStaticTextEskil Abrahamsen Blomfeldt2010-02-042-3/+2
| | | | | | | | | | | | | | | | | | | | Revert some unnecessary changes from the QStaticText diff.
| * | | | Remove unused codeEskil Abrahamsen Blomfeldt2010-02-041-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Removed an commented-out, empty functions which was previously there for testing purposes.
| * | | | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Eskil Abrahamsen Blomfeldt2010-02-043-5/+12
| |\ \ \ \ | | | | | | | | | | | | | | | | | | qstatictext-4.6
| * | | | | Make QRasterPaintEngine::drawStaticText public.Anders Bakken2010-02-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary so subclasses can chain to it. Reviewed-by: Donald Carr <donald.carr@nokia.com>
| * | | | | Merge branch '4.6' into qstatictext-4.6Eskil Abrahamsen Blomfeldt2010-02-016-39/+84
| |\ \ \ \ \
| * | | | | | Clarify comment in QPainterEskil Abrahamsen Blomfeldt2010-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We support affine transformations in the drawStaticTextItem() backends, but for non-affine transformation, the fallback will be taken.
| * | | | | | Make QStaticText private APIEskil Abrahamsen Blomfeldt2010-02-015-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | Improve performance of QStaticText on OpenGL by caching data on GPUEskil Abrahamsen Blomfeldt2010-01-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | CompileEskil Abrahamsen Blomfeldt2010-01-201-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compile QStaticText and also use font object in QPaintBuffer since it's now available
| * | | | | | Implement QPaintBufferEngine::drawStaticTextItem()Eskil Abrahamsen Blomfeldt2010-01-183-1/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make QPaintEngineEx::drawStaticTextItem() pure virtual to make sure it's implemented in all engines, and implement the paint buffer version to make gui compile.
| * | | | | | Use fallback when drawing projected textEskil Abrahamsen Blomfeldt2010-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Projected text always has to go via paths, so we use the fall back for this.
| * | | | | | Optimize drawStaticText() with rectangle destinationEskil Abrahamsen Blomfeldt2010-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to be feature consistent with drawText(), we have to clip the text whenever the text expands beyond its borders. This is a performance hit, but luckily we can detect the cases where it's necessary before-hand.
| * | | | | | CompileEskil Abrahamsen Blomfeldt2010-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the code to compile with merged changes.
| * | | | | | Implement drawStaticTextItem() in OpenGL paint enginesEskil Abrahamsen Blomfeldt2010-01-147-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OpenGL and OpenGL2 engines now have support for static text, as well as the QEmulationPaintEngine. Also contains an optimization: Instead of passing both the position and glyph positions to drawStaticTextItem() we add the position into the glyph position and update it only when it changes. Otherwise we would have to do this work in all engines for every call. This means we have to cache the position in QStaticTextPrivate as well, but it seems like a small price to pay, since it's a per-text overhead and only 16 bytes.
| * | | | | | Remove font property in QStaticText and fix handling translation onEskil Abrahamsen Blomfeldt2010-01-141-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | painter 1. The font property in QStaticText has been removed. Rather than set a font on the text explicitly, it picks up the font from the painter. If you change the font on the painter, the text layout will have to be updated, like with a matrix. 2. The translation might not be the only transformation on the painter, so rather than translate back to origo, we explicitly set dx and dy on the transform to 0.0 for the duration of the function. 3. Update test to reflect changes
| * | | | | | Apply painter matrix to position in QPainter::drawStaticText()Eskil Abrahamsen Blomfeldt2010-01-141-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to transform the position of the text in accordance with the painter's matrix. Also, use state->matrix directly instead of calling a function to get it.
| * | | | | | Support transformations in drawStaticText() and optimize for spaceEskil Abrahamsen Blomfeldt2010-01-146-34/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Support transformations on the painter in drawStaticText(). Transforming the painter will cause the text layout to be recalculated, except for translations, which are handled by shifting the position of the text items. 2. Make const length arrays of the internal data in QStaticTextItem in order to minimize the memory consumption.