| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
This reverts commit 0fc58ca3220083b9e10f88aab2e39824c2764db3.
Conflicts:
src/gui/graphicsview/qgraphicsitem.cpp
src/gui/graphicsview/qgraphicsitem_p.h
|
|
|
|
|
|
|
|
|
|
| |
properly pass to drawItemHelper.
The second is a double conversion to deviceTransform in createStyleOption
of QGraphicsItem. Since the recursive drawing already give a transform
in device mode we don't need to convert it two times.
Reviewed-by:andreas
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reapply commit 8ad5020940f10d4ecc5c5e8b3b9656531cb84ef3 and its
dependent change that has been reverted while rebasing the
recursivepaint branch.
With the new properties it is possible to easily animate transformations
Reviewed-by: Andreas
Documentation still need to be reviewed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
E.g. item->update(QRectF(0, 0, 5, 5)); item->update();
The problem was that we discarded all update requests whenever the item
was already marked as dirty. The dirty bit only means it has pending
updates (which might be a full update). However, we have a separate bit
for full updates (fullUpdatePending) so we have to check against that
bit instead.
Makes tst_QGraphicsProxyWidget::paintEvent happy.
Another auto-test included.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Once a _q_processDirtyItems call is queued, it means we at least have
one item that is marked as dirty and we must reset it when the
_q_processDirtyItems slot is called. The problem however, was that
we didn't reset the item's dirty state if a full scene update occurred
in between, i.e. item->update(); scene.update();
We don't have to calculate the item's dirty rect if a full scene update
occurs in between, but we still have to reset its state.
Auto-test included.
|
|
|
|
|
| |
The problem was that we only marked the painted view bounding rect of
the moved item as dirty. We also have to mark its children.
|
| |
|
|
|
|
| |
Use itemCollidesWithPath, the helper function.
|
|
|
|
|
| |
The recursive items function didn't contain the special case check for
when the source and target rectangle are identical.
|
|
|
|
| |
Don't skip all indexed items that aren't transparent ;-).
|
|
|
|
|
|
| |
Make sure we don't claim that we have sorted all toplevel items when
we are using the BSP tree, as when painting we have only actually sorted
a subset of the elements.
|
|
|
|
|
| |
This is necessary after we made the sceneRect grow lazily when it's not
assigned.
|
|
|
|
|
|
|
|
|
|
|
| |
Calling repaint() instead of update() is bad when having multiple
views (which GV perfectly supports). The result is that e.g. when
moving a chip in the chip demo, there's a visible lag between
each view. It can also be a performance killer on QWS, where
the surface is locked for each repaint().
Instead of calling repaint() we call update() as before, but we also
make sure the updates are processed immediately.
|
|
|
|
| |
Makes tst_QGraphicsItem::paint happy.
|
|
|
|
| |
Makes tst_QGraphicsItem::cacheMode happy.
|
|
|
|
|
| |
Makes tst_QGraphicsScene::changedSignal and
tst_QGraphicsItem::setMatrix happy.
|
|
|
|
| |
Makes tst_QGraphicsScene::update happy.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have to keep the growingItemsBoundingRect up-to-date if there's no
scene rect. The only difference now is that sceneRectChanged will not
be emitted before entering the event-loop, but the documentation
only states it'll be emitted when the scene rect changes, so we
consider it harmless.
Makes tst_QGraphicsView::sceneRect_growing and
tst_QGrahicsScene::sceneRect happy.
Reviewed-by: Andreas
|
|
|
|
| |
Partially fixes tst_QGraphicsScene::update failure.
|
|
|
|
|
| |
This fixes one of two failures in tst_QGraphicsScene::items_QRectF_2.
The other seems unrelated.
|
|
|
|
|
| |
Enable QGraphicsView::IndirectPainting to make sure it detects which
items are drawn.
|
|
|
|
|
|
|
|
|
| |
The code marked the item's own stacking order as dirty when changing
its own Z value, the right thing is however to set the _parent's_ bit.
Also added missing code for when the ItemStacksBehindParent flag was
toggled.
Reviewed-by: bnilsen
|
|
|
|
|
|
|
|
|
| |
Test if the children ignore the parent's opacity if the current item's
opacity is 0.0. If any of the children do ignore the parent then we must
continue. Further optimizations are possible: if the item itself is
transparent, then don't visit children that don't ignore parent opacity.
Reviewed-by: bnilsen
|
|
|
|
|
|
|
| |
See change 72842b2d, the patch misplaces 'p' and 'parent'. This fixes
the tst_QGraphicsItem::opacity autotests.
Reviewed-by: bnilsen
|
|
|
|
|
|
|
|
|
| |
This removes a microoptimization we did to avoid processing items whose
size was (0x0). Turns out an autotest started failing if we did this -
we have to find and draw such items because they are commonly used to
draw points (e.g., plot graphs).
Reviewed-by: bnilsen
|
|
|
|
|
|
|
| |
The children variable tested for clipping was the wrong variable. This
broke when the code was moved down as part of a previous cleanup change.
Reviewed-by: bnilsen
|
|
|
|
|
| |
The code looks ugly and needs to be refactored, but at least this
reintroduces the BSP so the chip demo works fine again.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function allows the user to disable notifications for item changes.
In QSimpleCanvasItem, all notifications are disabled by default, and
you can enable them one at a time. QGraphicsItem's behavior is to by
default enable all notifications.
A side effect of this change is that I've removed one optimization in
favor of another: by not constructing a QVariant at all when there's no
notification we get maximum performance, at the expense of constructing
it twice if there is a notification.
|
|
|
|
|
|
|
|
|
|
| |
connection
This connection was queued in the views before, but we don't do that
anymore, instead we re-use the _q_emitUpdated slot and process
pending updates on the views there.
Makes tst_QGraphicsView::viewportUpdateMode happy again.
|
|
|
|
|
|
| |
This patch also contains a bug fix where a child item didn't
update due to a bit not being properly set. No more rendering
artifacts :)
|
|
|
|
| |
We don't want to re-calculate the dirty rect for each view.
|
|
|
|
| |
This is a microoptimization.
|
|
|
|
|
| |
Ensure that we don't ask for or multiply with the view transform if the
view is not transformed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Invalidating the scene transform is just a matter of setting a bit on
the item. Then, when we ask for the item's scene transform, we
traverse its ancestors recursively and find the top-most dirty item.
The algorithm then backtracks to that item and start calculating the scene
transform for the item itself and all its children in the call stack.
If the item itself and all its ancestors are "clean", nothing is
calculated, only traversed.
We use this approach when processing dirty items / drawing items
as well. That way we ensure the scene transform is only calculated
once when absolutely needed.
G'night :)
|
|
|
|
|
|
|
| |
Add back compatibility support and make it independent of the views.
Also store the sceneTransform instead of the deviceTransform. This
will later be the item's cached scene transform (coming in another
commit).
|
|
|
|
|
| |
This cuts down quite some intructions in some use cases,
making esp. discardUpdateRequest() a bit cheaper.
|
|
|
|
|
|
|
| |
Using qFuzzyCompare for checking whether two transformations
are equal doesn't give us too much and is inconsistent with
our other matrix classes. Using simple floating point
equality is a lot faster as well.
|
|
|
|
|
|
| |
This cut's off some cycles in discardUpdateRequest()
which is called from most places when something in
the items changes.
|
|
|
|
| |
This caused a crash in the contacts demo.
|
|
|
|
|
|
|
|
|
|
| |
This function works much faster than the last one, but still it can be
much faster. The main expense right now it seems is the transform
calculations, and the item->collidesWithPath call. There's still much
to gain here.
This function does not make use of the BSP tree's fast lookup so it makes
lookups slower in (e.g.) the chip demo.
|
|
|
|
|
| |
Also change the order of comparisons, as the transformable flags are
most likely to fail first.
|
|
|
|
|
|
|
|
| |
The QStyleOption constructor is expensive, as it allocates a QFont,
a QPalette and a QFontMetrics. By simply reusing a temporary style
option object instead we carve away wasted cycles.
Reviewed-by: Ariya
|
|
|
|
|
| |
The recursive approach is faster and fits better into the new
scene transform cache we'll do later.
|
|
|
|
|
|
|
|
|
|
| |
Mark the children list for sorting when the Z value for items changes.
Change the signature of the recursive draw function slightly so that
the expose region is optional, and ensure we don't intersect with this
region if it's not available.
This change also flips the direct painting so that the default is to
use the recursive approach.
|
|
|
|
|
|
|
|
|
| |
This change introduces two helper functions in QGraphicsItemPrivate,
that combine the item's transform into the current transform, effectively
merging the code that calculates any item's combined to-parent transform.
This makes the code more readable, and also makes it easier for us to
reintroduce the componentized transform API in QGraphicsItem (which
was previously reverted).
|
|
|
|
|
|
| |
This change also changes the direct painting path to be opt-in as a
temporary testing measure to see what's broken when using the old code
path.
|
|
|
|
|
|
|
|
| |
Convert some repaint() calls back to updates(). This ensures that any
updates triggered before this call are processed normally, while still
keeping the synchronous repaint() call intact.
Reviewed-by: bnilsen
|
| |
|