aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgbasicinternalrectanglenode.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Refactor corner radius handling with explicit unset stateMagdalena Stojek2025-02-211-12/+56
| | | | | | | | | | Replace the use of -1 to indicate unset corner radii with explicit bitfield flags to track whether each corner radius is set. The default value for unset radii remains 0.0. Fixes: QTBUG-120188 Change-Id: If51a0165386a0c474ecd57ef23310d1c28f0f60b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove unnecessary ternary operatorMatthias Rauter2023-08-281-20/+20
| | | | | Change-Id: I7a2ce0027cba99c11e6e7a907c4942c9a2919b1f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix bug in gradient of Quick RectangleMatthias Rauter2023-08-211-0/+2
| | | | | | | | | | A recent commit (ca20f7e82f21dd06ce0d04fd937e915e2805e51e) introduced a bug in the gradient of the Rectangle, which was spotted in a Lancelot test. This patch fixes the gradient and restores the baseline of the Lancelot test. Change-Id: Icf433c421fa366e5a89ad856bd94e84aaa4b0ef5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add a radius property for each corner of a RectangleMatthias Rauter2023-08-191-106/+472
| | | | | | | | | | | | | | | | | | | | | This patch adds 4 properties to the Rectangle: topLeftRadius, topRightRadius, bottomLeftRadius and bottomRightRadius. These properties can be used to get a Rectangle where the corners have different radii. If the properties are not set or if they are zero, the value of the property radius will be used to draw the corner. If radius is zero too, the corner will be drawn normally. The opportunity was used to rename some variables in the QSGRectangleNode and comment the code. We now use float as the storage type for small-valued numbers, to reduce memory usage, even though the setters take qreal values. They lose precision during rendering anyway. [ChangeLog][QtQuick][Rectangle] Rectangle can now render individual radii on each corner. Fixes: QTBUG-48774 Change-Id: Icba1f6a26da513c657b7b218adc9187afb085eda Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-111-38/+2
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Avoid unnecessary color format conversionJiDe Zhang2021-10-291-4/+6
| | | | | | | | | | | | If a color is not the rgb format, when QColor::red() QColor::blue() QColor::green() is used continuously to obtain the values of different channels, three times color conversions will occur. Therefore, use QColor::toRgb() before that to ensure that only one conversion is performed at most. Not only rgb, the conversion of other formats is the same. Change-Id: Ia969e1ca6f1524ad5d7e8dec915bcbc407875c66 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add support for horizontal gradients in RectangleMichael Brasser2018-05-031-95/+130
| | | | | | | | | [ChangeLog][QtQuick] Added support for horizontal gradients in Rectangle. Change-Id: I4feee8ec93d9fe75a9f91a7afbe33c8d4756cedb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Fix enums in QSGGeometryLaszlo Agocs2016-10-121-3/+3
| | | | | | | | | | | | | | | | Minor fixes based on comments from the 5.8 API changes review: Revert to using Qt-style enum values (POSITION -> PositionAttribute). Use ByteType, FloatType, etc. instead of TypeByte, TypeFloat, ... Add comments about magic GL values. Add missing docs for Attribute::createWithAttributeType(). Change-Id: I1b8242efd3936f000ce8df6c11ff9ab7affb5713 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add cross-backend simple rect, texture, and ninepatch nodesLaszlo Agocs2016-06-221-0/+687
QSGSimpleRectNode is deprecated -> use QSGRectangleNode via QQuickWindow::createRectangleNode() instead. QSGSimpleTextureNode is deprecated -> use QSGImageNode via QQuickWindow::createImageNode() instead. The OpenGL version of the simple rectangle node is switched over to the vertex color material instead of flat, to allow for better batching. Use the same concept for nine patch nodes. The "style" node from Quick Controls 1 is now QSGNinePatchNode in order to provide a proper cross-backend solution which is already necessary due to the software backend, but now generalize it to apply to the accelerated backends with proper materials as well. QC can now simply call createNinePatchNode() without further ado. Also fixes a bug with the D3D12 texture material not enabling blending when needed. When it comes to the internal class names, QSGRectangleNode and QSGImageNode get the Internal prefix in the adaptation layer in order to differentiate from the public API. This involves quite a lot of renaming, but results in a nice and clean public API. Change-Id: Iddf9f9412377843ea6d652bcf25e68d1d74659ea Reviewed-by: Gunnar Sletta <gunnar@sletta.org>