| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
This seems to be the only way to get a high frame rate, regardless
of the performance of painting and all.
|
| | |
| | |
| | |
| | |
| | | |
This change is only to test how much of an impact the itemChange
mechanism has on performance. It's easy to revert later on.
|
| | |
| | |
| | |
| | |
| | |
| | | |
just calculate it top-down.
Reviewed-by: bnilsen
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
To avoid sorting siblings in real-time, ensure we lazily sort the list
in place when needed.
Reviewed-by: bnilsen
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This time with a recursive approach of processing dirty items. I've kept
the previous approach using a dirty list, but the recursive one is now
the default. Use QT_GV_USE_DIRTY_LIST=1 to swap.
I've also cached the item's device transform in both cases so that we
can re-use it later when drawing the item.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This flag helps optimize the case where an item is used only as a
transformation node in a scene graph, and where the item itself
doesn't paint anything. This is the default for FxItem (the
subclasses that do paint enable the HasContents flag). This lets
Graphics View know whether there's any point in setting up the
world transform, opacity and other things.
Reviewed-by: Lars
|
| | |
| | |
| | |
| | | |
Regression introduced during refactoring earlier today.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Greatly simplify how we handle opacity and store it as a member in
QGraphicsItemPrivate. Remove the caching of effectiveOpacity. It's
faster to calculate it on the fly, and the recursive painting algorithm
will make even that need go away.
Reviewed-by: Andreas
|