summaryrefslogtreecommitdiffstats
path: root/tests/auto/qstatictext
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Merge branch 'qt-master-from-4.7' of ↵Qt Continuous Integration System2010-09-221-0/+11
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scm.dev.nokia.troll.no:qt/qt-integration into master-integration * 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (231 commits) Fixed compile warning on Windows. Fixed painter path drawing on FBO without stencil buffer. qmake: Make smart library merge architecture-aware Slovenian translation: some updates and fixes Fixed memory leak in Symbian when Options menu was launched. Fixed color of cosmetic pens when printing under Windows. Fixed infinite loop when loading jpeg without EOI from memory. Fixes QPen dash offset for OpenGL paint engines (1.x & 2.x). Added galician translation Support multisampled pbuffers under Windows. tst_qpixmapfilter: Fix compilation in namespace qtextcodec_symbian: Add few aliases Give a warning in QPixmap::handle() if pixmap is not X11 class. Make QStaticText honor QPainter::pen() for rich text on X11 w/raster Fix one hang of QNAM on Symbian. Update QtDeclarative def files Update QtGui def files Update QtCore bwins def file Fix Symbian def file for a9e5329168 Make build on Symbian ...
| * \ Merge remote branch 'origin/4.7' into qt-master-from-4.7Thiago Macieira2010-09-211-0/+11
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qobject.h src/declarative/graphicsitems/qdeclarativeflickable.cpp src/declarative/graphicsitems/qdeclarativeflickable_p_p.h src/declarative/util/qdeclarativelistmodel.cpp
| | * Fix crash when using unprintable chars in QStaticTextEskil Abrahamsen Blomfeldt2010-09-101-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | The assumption that the output glyph array and input glyph array is of equal size is wrong when unprintable characters are used (and discarded in getGlyphPositions()) Task-number: QTBUG-12614 Reviewed-by: Jiang Jiang
* | | Fixed QStaticText auto-test to work with raster graphicssystem.Samuel Rødal2010-09-201-1/+1
|/ / | | | | | | Reviewed-by: Eskil
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-09-101-0/+27
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt demos/declarative/snake/content/snake.js demos/declarative/snake/snake.qml doc/src/development/qmake-manual.qdoc src/corelib/plugin/plugin.pri src/gui/kernel/qapplication_win.cpp src/gui/kernel/qdesktopwidget_win.cpp src/gui/painting/qdrawhelper.cpp tests/auto/qdir/tst_qdir.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf
| * Fix QStaticText copy constructor to also copy text option propertyEskil Abrahamsen Blomfeldt2010-09-031-0/+27
| | | | | | | | | | | | | | | | | | The text option property of QStaticText was not copied in the copy constructor, so when the text was detached, the property would be reset to the default. Task-number: QTBUG-13368 Reviewed-by: Gunnar
* | Disable translatedRotatedAndScaledPainter testcase as it is broken.Gunnar Sletta2010-08-191-1/+20
|/ | | | | | | | | | | | | | The problem is that the order of rounding to fixedpoint is different in the static and normal text case and this leads to some glyphs occationally being 1 pixel off. In the normal case, the glyphs are laid out and positioned in fixed point, then transformed using the full current matrix including the position which is then snapped to integer device space when drawn. In the static text case, the glyphs are laid out and positioned in fixed point related to 0,0. The actual device position is then added to the glyph positions.
* Add text decoration support to QStaticTextJiang Jiang2010-08-101-0/+106
| | | | | | | | | | | | The original code path of QStaticText does not include decoration drawing, this patch generalized the drawTextItemDecoration() function to draw decoration for drawText(), then use that to draw decoration for QStaticText. A helper function called drawDecorationForGlyphs() is made to allow easier extension for direct glyphs drawing support. Task-number: QTBUG-12121 Reviewed-by: Eskil
* Speed up QStaticText with affine transformation on GL2 engineEskil Abrahamsen Blomfeldt2010-06-011-4/+3
| | | | | | | | | | | | | | | | | | | | Since the OpenGL2 paint engine supports transforming the prerendered glyphs rather than rasterizing the glyphs with the transformation applied, we don't need to recalculate the QStaticText layout whenever the transformation changes. This means that we can do fast animated transforms for QStaticText on this paint engine. A quick test yields something like 100x speed-up on Windows. This also give visually better results, as we previously would animate the hinting of the glyphs, thus causing jittering. The autotest has been updated to reflect the fact that drawText() and drawStaticText() now go through identical paths on GL, also when transforms are set on the painter. However, the scale was changed in one test, because it was so great that drawText() would fall back to paths. With QStaticText the idea is speed, so you'll get a poor, but fast result instead, which is better than tricking people. Reviewed-by: Samuel
* Fix QStaticText test on MacEskil Abrahamsen Blomfeldt2010-03-301-5/+5
| | | | | | | | | | Avoid taking fast path in drawText() since this is optimized and does not draw text completely accurate on a floating point font engine. Rather we use the slightly slower but more accurate drawText() which takes a rectangle so that the results are identical to the ones produced by drawStaticText(). Reviewed-by: TrustMe
* Make QStaticText layout lazyEskil Abrahamsen Blomfeldt2010-03-291-1/+1
| | | | | | | | | | | | To avoid the unnecessary overhead of doing the text layout every time a part of the QStaticText object is changed, we mark it as invalid instead and do the layout when we have to. This means an overhead on the first paint event for most users. The overhead can be avoided by using the QStaticText::prepare() function and will probably not be noticable anyway, since it's a one-time thing. Task-number: QTBUG-9030 Reviewed-by: Gunnar
* Change QStaticText::setMaximumSize() to setTextWidth()Eskil Abrahamsen Blomfeldt2010-03-291-19/+32
| | | | | | | | | | | | | | | | | | To avoid having to precalculate the height of the laid out text, we now only supply a maximum text width to QStaticText. The only usage of the maximum height would be to clip the results, and clipping should be set separately from the QStaticText call, since this has no impact on the layout of the glyphs. The tests have been updated to reflect the change in logic. We also need a consistent way of specifying the position of the text. Before, the position meant "baseline position" for unbroken text and "top left position" for text with a specified layout width. We want to be consistent, and since baseline position makes no sense for multiline text, we standardize on top left position. Task-number: QTBUG-9029 Reviewed-by: Gunnar
* Respect QPainter::pen() in QPainter::drawStaticText()Eskil Abrahamsen Blomfeldt2010-03-291-0/+90
| | | | | | | | | | QStaticText needs to support changing the pen on the painter to support rich text, but it should not override the pen unless it has been explicitly set in the rich text. We do this by marking the pen as dirty in updateState() when we record the text items. Task-number: QTBUG-8908 Reviewed-by: Gunnar
* Synchronize rich text and plain text code paths in QStaticTextEskil Abrahamsen Blomfeldt2010-03-261-0/+36
| | | | | | | | | | | Drawing a string as plain text and rich text should have identical results unless special formatting information is added in the html. This means we should not have any implicit margin on the QTextDocument used to paint the text, and we should make up for the fact that the drawStaticText() call currently takes the position of the baseline and QTextDocument::drawContents() takes the top-left corner. Reviewed-by: Gunnar
* Better check in QStaticText testcase if xformed text is supportedGunnar Sletta2010-02-251-5/+12
| | | | Reviewed-by: Eskil
* Fix QStaticText test on QWSEskil Abrahamsen Blomfeldt2010-02-241-1/+29
| | | | | | | | | | Windows has the only font engine which supports transforming the glyphs in the glyph cache currently. All other engines fall back to drawing paths instead when using the raster engine. We disable the transformation tests for platforms which aren't either Windows or running a native graphics system. Reviewed-by: Olivier
* CompilePaul Olav Tvete2010-02-221-1/+1
| | | | | | | This test no longer uses QtOpenGL, therefore it doesn't need to try to link with it. Reviewed-by: Eskil
* Fix fallback for QStaticText when it's unsupported in paint engineEskil Abrahamsen Blomfeldt2010-02-191-2/+16
| | | | | | | | 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
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2Jason McDonald2010-02-161-10/+11
|\
| * Rename QStaticText::setUseBackendOptimizations to setPerformanceHint()Eskil Abrahamsen Blomfeldt2010-02-161-10/+11
| | | | | | | | | | | | | | Make the API more general and more readable by using a PerformanceHint enum instead of an on/off-trigger for the OpenGL-specific caching. Reviewed-by: Samuel
* | Fix license headers.Jason McDonald2010-02-161-16/+16
|/ | | | Reviewed-by: Trust Me
* Remove fluxuating tests for QStaticTextEskil Abrahamsen Blomfeldt2010-02-101-209/+0
| | | | | | | The QGLWidget tests would fail at random. The use case has been confirmed to work through manual tests, but I haven't found any good way to test them automatically. They have been removed until time permits.
* Make QStaticText public API againEskil Abrahamsen Blomfeldt2010-02-101-17/+17
| | | | | 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.
* Add tests for using QStaticText with a QGLWidgetEskil Abrahamsen Blomfeldt2010-02-052-1/+212
| | | | Some tests with and without VBO caching.
* Temporarily remove QPainter::drawStaticText() for Qt 4.6.x integrationEskil Abrahamsen Blomfeldt2010-02-051-14/+15
| | | | | | | | | | | 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
* Fix one test and add tests for backend optimizationsEskil Abrahamsen Blomfeldt2010-02-011-3/+32
| | | | | | The rotatedTranslatedScaled-test would transform the text out of the destination rect, so we'd just confirm two blank images. Also added input to the two basic tests for backend optimizations.
* Make QStaticText private APIEskil Abrahamsen Blomfeldt2010-02-011-1/+1
| | | | | | | | 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.
* Use fallback when drawing projected textEskil Abrahamsen Blomfeldt2010-01-151-0/+29
| | | | | Projected text always has to go via paths, so we use the fall back for this.
* Test current graphics system + initialize memoryEskil Abrahamsen Blomfeldt2010-01-151-23/+44
| | | | | | | Using QImage would only let us test the raster engine. Substitute QPixmap, so we can test different graphics systems. Also initialize the memory in the pixmaps (this was missed because memory is initialized by default in debug builds.)
* Remove translationDoesNotCauseRelayout testEskil Abrahamsen Blomfeldt2010-01-151-45/+0
| | | | | This is more suited to be a benchmark, as it doesn't cover the functionality of the class.
* Add tests for QStaticText::prepare()Eskil Abrahamsen Blomfeldt2010-01-151-0/+51
|
* Remove font property in QStaticText and fix handling translation onEskil Abrahamsen Blomfeldt2010-01-141-4/+15
| | | | | | | | | | | | | 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
* Ignore rounding errors in QStaticText testEskil Abrahamsen Blomfeldt2010-01-141-11/+4
| | | | | | Combining rotations and translations will cause minor differences between drawText() and drawStaticText(). This is not what the function is testing, so it has been massaged to pass.
* Remove debug outputEskil Abrahamsen Blomfeldt2010-01-141-1/+1
| | | | Don't save images by default.
* Ignore rounding error when painting to rotated painterEskil Abrahamsen Blomfeldt2010-01-141-15/+17
| | | | | | | | There are tiny rounding errors in the matrix rotations which cause tiny differences in drawText() and drawStaticText(). I've chosen to ignore these. Instead of having a threshold on the comparison between the two images, I've chosen to take the easy way out and avoid the problem by not passing in any position for the text.
* Add autotests for transformed static textEskil Abrahamsen Blomfeldt2010-01-141-0/+184
| | | | | Most of these tests currently fail revealing som offset bugs in the painting code.
* Add test for QStaticTextEskil Abrahamsen Blomfeldt2010-01-142-0/+162
Tests that QStaticText rendering is identical to the same operations done with regular QPainter::drawText()