fix: reduce shader usage
This commit is contained in:
@@ -19,6 +19,21 @@ class BlobInvertedRect : public BlobShape {
|
||||
Q_PROPERTY(
|
||||
qreal borderBottom READ borderBottom WRITE setBorderBottom NOTIFY
|
||||
borderBottomChanged)
|
||||
Q_PROPERTY(
|
||||
qreal outerRadius READ outerRadius WRITE setOuterRadius NOTIFY
|
||||
outerRadiusChanged)
|
||||
Q_PROPERTY(
|
||||
qreal outerTopLeftRadius READ outerTopLeftRadius WRITE
|
||||
setOuterTopLeftRadius NOTIFY outerTopLeftRadiusChanged)
|
||||
Q_PROPERTY(
|
||||
qreal outerTopRightRadius READ outerTopRightRadius WRITE
|
||||
setOuterTopRightRadius NOTIFY outerTopRightRadiusChanged)
|
||||
Q_PROPERTY(
|
||||
qreal outerBottomLeftRadius READ outerBottomLeftRadius WRITE
|
||||
setOuterBottomLeftRadius NOTIFY outerBottomLeftRadiusChanged)
|
||||
Q_PROPERTY(
|
||||
qreal outerBottomRightRadius READ outerBottomRightRadius WRITE
|
||||
setOuterBottomRightRadius NOTIFY outerBottomRightRadiusChanged)
|
||||
|
||||
public:
|
||||
explicit BlobInvertedRect(QQuickItem* parent = nullptr);
|
||||
@@ -40,15 +55,47 @@ class BlobInvertedRect : public BlobShape {
|
||||
|
||||
void setBorderBottom(qreal v);
|
||||
|
||||
[[nodiscard]] qreal outerRadius() const { return m_outerRadius; }
|
||||
|
||||
void setOuterRadius(qreal v);
|
||||
|
||||
// Per-corner outer radii. -1 falls back to outerRadius (mirrors BlobRect).
|
||||
[[nodiscard]] qreal outerTopLeftRadius() const { return m_outerTopLeftRadius; }
|
||||
|
||||
void setOuterTopLeftRadius(qreal v);
|
||||
|
||||
[[nodiscard]] qreal outerTopRightRadius() const { return m_outerTopRightRadius; }
|
||||
|
||||
void setOuterTopRightRadius(qreal v);
|
||||
|
||||
[[nodiscard]] qreal outerBottomLeftRadius() const {
|
||||
return m_outerBottomLeftRadius;
|
||||
}
|
||||
|
||||
void setOuterBottomLeftRadius(qreal v);
|
||||
|
||||
[[nodiscard]] qreal outerBottomRightRadius() const {
|
||||
return m_outerBottomRightRadius;
|
||||
}
|
||||
|
||||
void setOuterBottomRightRadius(qreal v);
|
||||
|
||||
signals:
|
||||
void borderLeftChanged();
|
||||
void borderRightChanged();
|
||||
void borderTopChanged();
|
||||
void borderBottomChanged();
|
||||
void outerRadiusChanged();
|
||||
void outerTopLeftRadiusChanged();
|
||||
void outerTopRightRadiusChanged();
|
||||
void outerBottomLeftRadiusChanged();
|
||||
void outerBottomRightRadiusChanged();
|
||||
|
||||
protected:
|
||||
[[nodiscard]] bool isInvertedRect() const override { return true; }
|
||||
|
||||
void outerCornerRadii(float out[4]) const override;
|
||||
|
||||
QSGNode* updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData*) override;
|
||||
|
||||
void registerWithGroup() override;
|
||||
@@ -59,4 +106,10 @@ class BlobInvertedRect : public BlobShape {
|
||||
qreal m_borderRight = 0;
|
||||
qreal m_borderTop = 0;
|
||||
qreal m_borderBottom = 0;
|
||||
|
||||
qreal m_outerRadius = 0;
|
||||
qreal m_outerTopLeftRadius = -1;
|
||||
qreal m_outerTopRightRadius = -1;
|
||||
qreal m_outerBottomLeftRadius = -1;
|
||||
qreal m_outerBottomRightRadius = -1;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user