| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
demos/demos.pro
mkspecs/features/resources.prf
mkspecs/features/uic.prf
src/corelib/io/qurl.cpp
src/corelib/tools/qlocale_symbian.cpp
src/gui/graphicsview/qgraphicsscene.cpp
src/gui/graphicsview/qgraphicswidget_p.cpp
src/gui/graphicsview/qgraphicswidget_p.h
src/gui/util/qsystemtrayicon_win.cpp
src/multimedia/audio/qaudioinput.cpp
tests/auto/qhostinfo/qhostinfo.pro
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When going through the special WebKit code path for text drawing and
forcing justification for text, we would set the justification in the
text engine, but never actually update the widths of the script items.
Since the width of the script item is used to position the text, the
text would be drawn with the correct justification, but the position
would be set based on the non-justified text width. The result was
overlapping text whenever the script of the text changed. The fix goes
through the justified glyphs and sets the width and position based on the
new effective advance.
Task-number: QTBUG-10421
Reviewed-by: Simon Hausmann
|
| |
| |
| |
| |
| |
| |
| |
| | |
When using the fallback in QStaticText we have to update its font
to the current painter's font, otherwise we will override the painter's
font with the one cached in the QStaticText object.
Reviewed-by: Olivier
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use qt_draw_glyphs() to implement a QPaintBuffer::drawStaticText() which
will actually replay via drawStaticTextItem() on engines that support
it.
Task-number: QTBUG-9064
Reviewed-by: Gunnar
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a function to QTextLine which returns the accumulated advance of
the glyphs in the text. Previously QTextLine::naturalTextWidth() was
used for both this purpose and for calculating the pixel width of the
text. Since these two metrics are not the same, either of the two
usages would be wrong. QTextLine::naturalTextWidth() has been changed
to do what its documentation claims it does, and horizontalAdvance()
should now be used for laying out text horizontally.
Reviewed-by: Simon Hausmann
|
| |
| |
| |
| |
| |
| |
| | |
Copy the sub-pixmap so that we don't need to convert the entire pixmap
to a QImage each time.
Reviewed-by: Gunnar Sletta
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
4.7-integration
* '4.7-cutoff' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (82 commits)
Revert 12b6987031be9faee3886d7623888feb4e1762af
Changed TEST_COMPILER from CC to CXX in configure script.
doc: Fixed several qdoc errors.
Carbon: Native filedialog does not apply filters on app-bundles
Cocoa: Native filedialog does not apply filters on app-bundles
Improve performance of QTimer::singleShot
Add a benchmark comparing single shot timer with invokeMethod
use Qt's private mac functions, reduce code redundancy
Assistant: Fix compile warning for empty header.
Doc: mark QEasingCurve support functions as new in 4.7.
Modify the XML test suite not to use non-characters.
Autotest: Fix failing QTextCodec tests
Doc: mark methods as internal (as they were in previous releases)
Doc: add image for Qt Quick to "What's New" page.
qdoc: Clear a static multimap after each qdocconf file.
qdoc: Added some debug output to track down a crash
Fixed mouse wheel handling in scrollareas.
Added two missing keys for X11
Carbon: usage of menu bars can cause exceptions to be thrown
Mac: compile fix
...
|
| | | |
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | | |
Reviewed-by: Kim
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is the 4.7 port of d04f5336f769d9e5d2f9105e1da4a7d23ea91795.
Task-number: related to QTBUG-8455
Reviewed-by: Kim
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In change 5364fd96a72c89b281f0540da909fe64d0575ccf and some related
changes, we made sure that the natural text width used for calculating
bounding rects and line breaks in the text, takes the right bearing
of the last glyph into consideration.
As a side-effect, this broke alignment of text, as we want to align
based on the accumulated advance of the glyphs, not based on the actual
width. This is in particular important when aligning monospaced text,
since the text can become misaligned if the glyphs extend beyond their
advance. The bug was visible e.g. in line numbers ending with 2 in
Qt Creator on X11, which would be shifted one pixel to the left compared
to other line numbers.
Task-number: QTBUG-8864
Reviewed-by: Thorbjørn
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
configure
|
| |\ \
| | | |
| | | |
| | | |
| | | | |
Conflicts:
src/network/access/qnetworkaccessmanager.cpp
|
| |\ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
Conflicts:
src/s60installs/s60installs.pro
|
| |\ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Conflicts:
configure
src/gui/painting/qpainter.cpp
src/s60installs/s60installs.pro
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In some use cases where you use an external font engine and want to
use Qt's font engine for painting, you might need a function which will
give you direct access to the underlying font. A generic API for this
requires a lot of API changes, so in the meantime, we implement an
internal, specialized API to support the use cases where it is
required. The API is considered internal and experimental, and not
guaranteed to be stable or even exist across releases.
This is API which provides several fun ways to shoot yourself in the
foot, but if used properly, it will allow you to paint glyph ids at
precalculated positions.
Task-number: QTBUG-7844
Reviewed-by: Trond
|
| |_|_|/ /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\ \ \ \ \
| |_|_|_|/
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Conflicts:
configure.exe
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
src/opengl/qgl.cpp
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| |\ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
We support affine transformations in the drawStaticTextItem() backends,
but for non-affine transformation, the fallback will be taken.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Projected text always has to go via paths, so we use the fall back for
this.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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().
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The rectangle should clip the text vertically and break lines
horizontally, to mirror behavior of QPainter::drawText().
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Not much to gain by going directly to the QTextEngine, and the code
is a lot simpler if we just use the QTextLayout instead.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|