aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/scenegraph/softwarecontext/rectanglenode.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Improve quality of RectangleNodes when rotatedAndy Nichols2014-10-211-31/+66
| | | | | | | | | | | | | | | | | | | | When there is a rotation transformation on a RectangleNode it is not possible to take advantage of accelerated blitter paths, but we still need to do custom painting to recreate the behavior of a Rectangle component in Qt Quick. Now when there is a rotaiton transformation we will fall back to using QPainter::drawRect as long as there is no border or radius. If there is a border or radius value set though we will instead first render to a QPixmap before painting as the standard behavior of QPainter::drawRect and QPainter::drawRoundedRect does not match the expected behavior of a QQuick Rectangle item. This fixes the poor quality of rotated Rectangles at the cost of speed. The Rotation of any item should still be discouraged for performance reasons, but at least now Rectangles itmes should look correct when used. Change-Id: I3919ad732c9b4354a95e28e8dc09fcefd53f604e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
* Ensure that markDirty is called when neededAndy Nichols2014-09-111-0/+6
| | | | | | | | There were many cases where properties of nodes could change but since the node was not marked dirty, the scene update was never rendered. Change-Id: I7740a43d98521073056f85fe80d6c1ff213236a3 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Improve rendering quality of RectanglesAndy Nichols2014-09-091-27/+68
| | | | | | | | | | | | | The existing implementation has both inaccurate drawing of borders as well as many alignment issues. Much of these alignment issues are due to our use of floating point sizes and the integer based nature of blitter hardware. So now for the Rectangle node we force alignment via the use of whole numbers. This should be a better compromise of speed vs accuracy than previously. Change-Id: I9d8e9d1b3347a99bf0c2ae65ec66c935d8017817 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Support rendering Gradients when stops are not between 0 and 1Andy Nichols2014-09-091-1/+88
| | | | | | | | | | | | QGradient does not allow stops positions that are outside the bounds of 0 and 1. Gradients created from QML however can have stops outside of these bounds and so we must normalize these stops before giving them to QPainter to render. This change creates a new stop at 0 or 1 if a stop goes below or above the bounds respectively, and interpolates a new color value for the stop based on the original position. Change-Id: I10cc41d923e88a9b41bfd27de0326cea25464add Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Reformat project to be a Qt ModuleAndy Nichols2014-09-021-0/+219
Change-Id: I2fe8df530a687247a9cd7ea12c1d8de79fef506e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>