| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
QTextBlock::layoutDirection() doesn't exist, and the QStaticText
constructor no longer takes a size argument.
Task-number: QTBUG-12072
Reviewed-by: Fabien Freling
|
|
|
|
|
|
|
|
| |
This is (supposedly) more efficient as the compiler can optimise it to a
builtin, per Thiago.
Merge-request: 2430
Reviewed-by: Andreas Kling <andreas.kling@nokia.com>
|
|
|
|
| |
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
To allow more control over the layout process for a QStaticText,
introduce a QTextOption API. This will allow you to, e.g., set an
alignment for the text layout. Patch also contains a couple of bug fixes
to make right alignment work correctly when you set a text width on
the QStaticText.
Task-number: QTBUG-9031
Reviewed-by: Samuel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
qMemCopy is faster than memmove, and there's no chance of overlapping
source and destination memory in these cases.
Reviewed-by: Samuel
|
|
|
|
|
|
|
|
|
|
| |
Since QStaticText would be created once and used often, not much thought
was put into optimizing its initialization. For simplicity, the code
would do two drawText() passes. Since this was an unnecessary overhead,
the extra pass has been removed and replaced by memmoves instead.
Initialization is now twice as fast.
Reviewed-by: Samuel
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (71 commits)
Autotest: increase wait time to 3s on Windows to bypass 2s-granularity limitation
Autotest: update to the new values for the locale
do not expand variables in read()'s file name
remove ability to use break() a block outside any loop
don't add -unix to the qmake command line
Increase the timeout for the QNAM getter test to 30 seconds
Remove unstable hosts from the list
qdoc: Output TOC for more class ref pages.
Other fixes to the remote network stresstester
Fix SSL connection problem.
Make sure we don't try URLs that aren't HTTP or HTTPS
Fix menu bar visibility.
Add SSL remote host tests
Split the remote and the local tests in two, in preparation for SSL tests
Add tests for remote hosts
Change the way we calculate the average transfer rates.
Finish renaming
Move these tests to tests/manual.
Add a QNetworkAccessManager stresstest
Add a non-blocking native function too
...
|
| |
| |
| |
| |
| |
| |
| |
| | |
The bearer management code, which this bug is for, was fixed by MR 517
previously.
Task-number: QTBUG-9493
Reviewed-by: alex
|
|/
|
|
|
|
|
| |
More corrections to declarations to ensure symbol visibility is correct
Task-number: QTBUG-9998
Reviewed-by: TrustMe
|
|
|
|
|
|
| |
Synchronize order of initialization with order of declaration.
Reviewed-by: TrustMe
|
|\
| |
| |
| |
| | |
Conflicts:
src/gui/text/qstatictext.cpp
|
| |
| |
| |
| |
| | |
Merge-request: 528
Reviewed-by: Zeno Albisser
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When using rich text, QStaticText should still respect the painter's
pen color as the default. Since QTextDocument does not respect the pen
set on the painter, we need to set its default style sheet to include
the pen color as well.
Reviewed-by: Olivier
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
As a left over from when the d pointer was a plain pointer and not
a QExplicitlySharedPointer, we were setting the reference count to 1 on
construction. Since QExplicitlySharedPointer handles the ref count,
a newly constructed QStaticText would have a ref count of 2, and thus
would always detach upon modification.
Reviewed-by: Gunnar
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| | |
Gcc warns if declaration and initialization order are different.
Reviewed-by: Samuel
|
|/
|
|
|
|
|
|
| |
When the QStaticText is detached, we would previously reset the
value of useBackendOptimizations rather than copy it into the new
data.
Reviewed-by: Gunnar
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Remove unsafe comparison since true is defined as non-zero only.
|
|
|
|
|
| |
QStaticText will be added as public API in Qt 4.7, and as private API
in Qt 4.6.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
The copy constructor for QStaticTextPrivate was never called.
|
|
|
|
| |
Avoid crash when copying a QStaticTextPrivate object
|
|
|
|
|
| |
Compile QStaticText and also use font object in QPaintBuffer since it's
now available
|
|
|
|
| |
This will be needed by OpenVG paint engine, and is useful elsewhere.
|
| |
|
|
|
|
|
|
|
|
| |
The two runs (counting the number of items and then storing the
information) needs to be identical, so they need to have the same text
flags set. Otherwise we would count more items than we actually
generated and crash later when we tried to access an uninitialized
item.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Allow the QStaticText layout to be completely defined prior to painting
by introducing a function for setting the font and transform on the
object ahead of using it with a QPainter.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Instead of translating each position manually afterwards, just have
the matrix do it when calculating the positions inside
getGlyphPositions().
|
|
|
|
| |
Clarify the use of transformations combined with static texts.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|