summaryrefslogtreecommitdiff
path: root/src/render/pass/RectPassElement.hpp
blob: a61ab15589d7932dcb7ee1884304117d5ddc6836 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include "PassElement.hpp"
#include <hyprutils/math/Region.hpp>

class CRectPassElement : public IPassElement {
  public:
    struct SRectData {
        CBox       box;
        CHyprColor color;
        int        round         = 0;
        float      roundingPower = 2.0f;
        bool       blur = false, xray = false;
        float      blurA = 1.F;
        CBox       clipBox;

        // internal
        CBox    modifiedBox;
        float   TOPLEFT[2];
        float   FULLSIZE[2];
        CRegion drawRegion;
    };

    CRectPassElement(const SRectData& data);
    virtual ~CRectPassElement() = default;

    virtual bool                needsLiveBlur();
    virtual bool                needsPrecomputeBlur();
    virtual std::optional<CBox> boundingBox();
    virtual CRegion             opaqueRegion();

    virtual const char*         passName() {
        return "CRectPassElement";
    }

    virtual ePassElementType type() {
        return EK_RECT;
    };

    SRectData m_data;
};