summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Speed up QStaticText initializationEskil Abrahamsen Blomfeldt2010-01-141-10/+5
| | | | | | Instead of translating each position manually afterwards, just have the matrix do it when calculating the positions inside getGlyphPositions().
* 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.
* 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.
* Allow access to QStaticTextPrivate from autotestsEskil Abrahamsen Blomfeldt2010-01-141-4/+3
| | | | | Remove a private include which was unresolvable in autotests (because it indirectly included a 3rdparty header) and add Q_AUTOTEST_EXPORT.
* Some documentation fixesEskil Abrahamsen Blomfeldt2010-01-141-4/+7
| | | | Clarify the use of transformations combined with static texts.
* Support transformations in drawStaticText() and optimize for spaceEskil Abrahamsen Blomfeldt2010-01-149-61/+130
| | | | | | | | | | 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.
* Optimize QStaticText for spaceEskil Abrahamsen Blomfeldt2010-01-1410-110/+137
| | | | | | | | | | | By caching the results of getGlyphPositions() we can make a code path in the critical paint engines which is optimal both in space and speed. The engines where speed is of less importance (pdf engine etc.) which may need more information, we choose the slower code path of drawText() which lays out the text again. We should have optimal paths in raster, vg and GL2 paint engines. The others are less important. Memory consumption of static text is now 14 bytes per glyph, 8 bytes per item and a static overhead of 40 bytes per QStaticText object.
* Remove const-specifier to make QTextItemInt::operator=() more beautifulEskil Abrahamsen Blomfeldt2010-01-142-2/+2
| | | | | | | The const-specifier on the char format was unecessary, and made the operator= implementation ugly, so it has been removed. Reviewed-by: Simon Hausmann
* Respect font settings of QStaticText and clip to maximum sizeEskil Abrahamsen Blomfeldt2010-01-142-1/+22
| | | | | | | drawText() that renders into a QRect will clip the text (unless otherwise set by the text flags passed to the function.) In drawStaticText() we should do the same for identical behavior. We also need to respect the font set on the QStaticText object.
* 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()
* Support maximumSize for the layout of the text in a QStaticTextEskil Abrahamsen Blomfeldt2010-01-146-59/+279
| | | | | | | Put back maximumSize property in QStaticText to allow matching calls to drawText with a target rectangle. Implementation is done by having a dummy paint engine which records the calls to drawTextItem() and storing these, then replaying them later.
* Speed optimization for QStaticTextEskil Abrahamsen Blomfeldt2010-01-146-23/+40
| | | | | | | Don't use QVector to store the text items, but put them in a regular array for quick access. drawStaticText() is now about 2.7 times the speed of drawText().
* Fix drawing in QStaticTextEskil Abrahamsen Blomfeldt2010-01-141-0/+1
| | | | Also clone the offsets structure into the new QGlyphLayout.
* Space optimization in QStaticTextEskil Abrahamsen Blomfeldt2010-01-142-14/+9
| | | | | | | The engine.layoutData's glyph count is the number allocated, which may be larger than the actual number of glyphs. To minimize the space needed we base allocation on "used" which contains the number of glyphs actually used to represent the text.
* Optimize QStaticText for one line stringsEskil Abrahamsen Blomfeldt2010-01-146-85/+98
| | | | | | | QTextLayout takes a lot of memory. We can get a bigger speed-up and a more reasonable memory consumption by only supporting the single line static texts and caching the text items. We need to copy some structs from the text engine, since this is on the stack.
* Fix memory leakEskil Abrahamsen Blomfeldt2010-01-141-1/+3
|
* Compile on S60Eskil Abrahamsen Blomfeldt2010-01-141-0/+1
|
* CompileEskil Abrahamsen Blomfeldt2010-01-141-2/+2
| | | | Q_DECLARE_PRIVATE requires d_ptr to be a QFooPointer<>-object.
* Add operators and implicit sharing to QStaticTextEskil Abrahamsen Blomfeldt2010-01-143-26/+91
| | | | | Adds copy constructor, operator==, operator= and operator!= to QStaticText. Implemented using an implicitly shared private object.
* Remove ambiguous overload for QStaticText() constructorEskil Abrahamsen Blomfeldt2010-01-141-1/+0
| | | | | The QStaticText(QString) constructor has been replaced by a constructor with defaults for the additional arguments
* Add lazy initialization to QStaticTextEskil Abrahamsen Blomfeldt2010-01-143-12/+114
| | | | | | People should be able to initialize the QStaticText lazily, or change its data after instantiation. Each of the setters will recalculate the layout to make sure it's always in sync.
* doc: Add documentation for QStaticText and QPainter::drawStaticText()Eskil Abrahamsen Blomfeldt2010-01-142-3/+86
|
* Add convenience overloads to QPainter::drawStaticText()Eskil Abrahamsen Blomfeldt2010-01-141-0/+12
| | | | | Adds the integer based overloads as inline functions, same as for QPainter::drawText().
* Fix formatting/clipping rectangle in QPainter::drawStaticText()Eskil Abrahamsen Blomfeldt2010-01-144-9/+95
| | | | | The rectangle should clip the text vertically and break lines horizontally, to mirror behavior of QPainter::drawText().
* Start support for formatting text within a bounding rectEskil Abrahamsen Blomfeldt2010-01-143-7/+7
| | | | | Support to mirror drawText(QRectF, QString). Instead of a rect you give the text a static size and then paint it to an arbitrary point later on.
* WhitespaceEskil Abrahamsen Blomfeldt2010-01-141-3/+2
| | | | Trailing spaces and an extra line of whitespace.
* Fix position of QStaticText textEskil Abrahamsen Blomfeldt2010-01-141-1/+1
| | | | | To mirror the behavior of drawText() the y-position origin should be the baseline of the text.
* Simplify QStaticTextEskil Abrahamsen Blomfeldt2010-01-143-52/+21
| | | | | Not much to gain by going directly to the QTextEngine, and the code is a lot simpler if we just use the QTextLayout instead.
* Introduce QStaticText APIEskil Abrahamsen Blomfeldt2010-01-146-2/+222
| | | | | | | | | Much of the time in drawText() is used on text layouting, which is wasted time when the text is not updated every frame. QStaticText is meant to cache the relevant parts of this work. It currently uses a copy-paste of the layout code in QPainter::drawText() and 99% of the time in QPainter::drawStaticText() is spent in drawTextItem(). We can use QTextLayout here instead without losing much.
* Better fix for build!=src Makefile generationThomas Zander2010-01-141-5/+3
| | | | | | | Make sure we always use the absolute path to the pro file so it will just work from either source or build dir. This fixes the usecase where qmake generated a relative path starting with '..'
* Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6Alan Alpert2010-01-148977-11607/+14009
|\
| * Fix QGLWidget::renderPixmap() on Windows.Trond Kjernaasen2010-01-141-6/+6
| | | | | | | | | | | | | | | | Using renderPixmap() with scenes that contained textures might not work due to the wrong texture format being used under certain circumstances. Task-number: QTBUG-7213 Reviewed-by: Gunnar
| * Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-01-1427-472/+617
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix rules for recreating the Makefile in a subdir Disable some tests that require high floating point precision. Replace the truncate function with fuzzierCompare(). Rework how Qt handles GL extensions. More changelog additions for QtWebKit Make compile on symbian/Linux Removed pointless image comparison in raster colorize filter. Improved performance of translating device coordinate graphics effects.
| | * Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6Simon Hausmann2010-01-1487-956/+674
| | |\ | | | | | | | | | | | | | | | | Conflicts: dist/changes-4.6.1
| | * | Fix rules for recreating the Makefile in a subdirThomas Zander2010-01-131-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The code generated would always create the Makefile in the sourcedir, even if you had src!=build Reviewed-By: Thiago
| | * | Disable some tests that require high floating point precision.Jan-Arve Sæther2010-01-132-3/+18
| | | | | | | | | | | | | | | | Disable them if sizeof(qreal)==4
| | * | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6Jan-Arve Sæther2010-01-1325-449/+579
| | |\ \
| | | * | Rework how Qt handles GL extensions.Trond Kjernåsen2010-01-1315-428/+469
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt used to store the GL extensions a particular implementation supported in a global cache, which was initialized once and never updated. This could cause problems because different types of context might support different kinds of extensions (e.g. the difference between sw and hw contexts). With this patch, the GL extensions are cached and updated within each QGLContext. It also makes the extension initialization lazy, which saves application initialization costs for embedded platforms. The patch introduces a internal cross platform QGLTemporaryContext class that is used to create a light-weight GL context without going via QGLWidget and friends (QWS and WinCE still have QGLWidget fallbacks for now). Reviewed-by: Kim Reviewed-by: Samuel
| | | * | More changelog additions for QtWebKitSimon Hausmann2010-01-131-0/+2
| | | | | | | | | | | | | | | | | | | | Reviewed-by: Trust me
| | | * | Make compile on symbian/LinuxThomas Zander2010-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | symbian headers on Linux are lowercase and this should work on Windows too.
| | | * | Removed pointless image comparison in raster colorize filter.Samuel Rødal2010-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test is meant to check whether the grayscale operation is done in-place or not. Task-number: QTBUG-6901 Reviewed-by: Bjørn Erik Nilsen
| | | * | Improved performance of translating device coordinate graphics effects.Samuel Rødal2010-01-136-18/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't invalidate the cache if we're only translating and the effect rect is fully contained within the device rect of the painter. Task-number: QTBUG-6901 Reviewed-by: Bjørn Erik Nilsen
| | * | | Replace the truncate function with fuzzierCompare().Jan-Arve Sæther2010-01-131-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | truncate did a qRound of the two numbers, which could cause two numbers that were close to become far away (e.g. (0.000049 and 0.000051 would become 0 and 1 respectively) fuzzierCompare allows less precision than qFuzzyCompare. This is because the anchor layout engine can sometimes do quite a lot of calculations, and the error will be larger than what the qFuzzyCompare checks for. Thus, the factor in fuzzierCompare is not chosen due to mathematical proof but rather it is just chosen by what is acceptable. (actually it can still be larger and still be acceptable)
| * | | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-multimedia-team into ↵Qt Continuous Integration System2010-01-1424-173/+111
| |\ \ \ \ | | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/qt-multimedia-team: Revert "Frequency to SampleRate and channels to channelCount." missed Revert "Frequency to SampleRate and channels to channelCount." Revert "Added setChannelCount() to QAudioFormat."
| | * | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-multimedia-team into ↵Qt Continuous Integration System2010-01-1424-173/+111
| | |\ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/qt-multimedia-team: Revert "Frequency to SampleRate and channels to channelCount." missed Revert "Frequency to SampleRate and channels to channelCount." Revert "Added setChannelCount() to QAudioFormat."
| | * | | Revert "Frequency to SampleRate and channels to channelCount." missedKurt Korbatits2010-01-141-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unit test. This reverts commit 80d4a4945d3273a4b2ce91e34597533f661af320. unit test missed on last revert.
| | * | | Revert "Frequency to SampleRate and channels to channelCount."Kurt Korbatits2010-01-1418-116/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 80d4a4945d3273a4b2ce91e34597533f661af320. Conflicts: examples/multimedia/audioinput/audioinput.cpp examples/multimedia/audiooutput/audiooutput.cpp src/multimedia/audio/qaudio_mac.cpp src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp src/multimedia/audio/qaudioformat.h src/multimedia/audio/qaudioinput.cpp src/multimedia/audio/qaudiooutput.cpp tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp tests/auto/qaudioformat/tst_qaudioformat.cpp tests/auto/qaudioinput/tst_qaudioinput.cpp tests/auto/qaudiooutput/tst_qaudiooutput.cpp
| | * | | Revert "Added setChannelCount() to QAudioFormat."Kurt Korbatits2010-01-1416-57/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f124538ef4840c3d24b4c7e9e7221adb52bdee2c. Conflicts: examples/multimedia/audioinput/audioinput.cpp examples/multimedia/audiooutput/audiooutput.cpp src/multimedia/audio/qaudio_mac.cpp src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp src/multimedia/audio/qaudioformat.h src/multimedia/audio/qaudioinput.cpp src/multimedia/audio/qaudiooutput.cpp tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp tests/auto/qaudioformat/tst_qaudioformat.cpp tests/auto/qaudioinput/tst_qaudioinput.cpp tests/auto/qaudiooutput/tst_qaudiooutput.cpp
| * | | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into ↵Qt Continuous Integration System2010-01-142-1/+2
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public: Use MMP keyword, not compiler flags, to update FPU option on Symbian