7#include "qml_material/scenegraph/texture_cache.h"
9namespace qml_material::sg
12enum class BlurStyle :
int
32 QSGMaterialShader* createShader(QSGRendererInterface::RenderMode)
const override;
33 QSGMaterialType* type()
const override;
34 int compare(
const QSGMaterial* other)
const override;
38 auto profile_texture() -> QSGTexture*;
40 void init_corner_textures(QQuickWindow* win);
41 const CornerCutoutTexture& corner_texture(
int index)
const;
45 QVector2D rect_size { 0.0f, 0.0f };
46 QVector4D radius { 0.0f, 0.0f, 0.0f, 0.0f };
47 BlurStyle style { BlurStyle::Normal };
54 QSGTexture* m_profile_texture {
nullptr };
55 std::array<CornerCutoutTexture, 4> m_corner_textures {};
58class BlurMaskShader :
public QSGMaterialShader {
62 bool updateUniformData(QSGMaterialShader::RenderState& state, QSGMaterial* newMaterial,
63 QSGMaterial* oldMaterial)
override;
65 void updateSampledImage(RenderState&,
int binding, QSGTexture** texture,
66 QSGMaterial* newMaterial, QSGMaterial*)
override;
Definition blur_mask_material.h:27
float effective_radius() const
Effective uniform radius used by the shader (= max of the 4 radii).
Definition blur_mask_material.cpp:26
void init_profile_texture(QQuickWindow *win)
Bind the per-window shared 1D unit-CDF profile texture. Cheap.
Definition blur_mask_material.cpp:68