Kirigami2

shadowedtexturematerial.h
1 /*
2  * SPDX-FileCopyrightText: 2020 Arjen Hiemstra <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 #pragma once
8 
9 #include <QSGTexture>
10 
11 #include "shadowedrectanglematerial.h"
12 
13 /**
14  * A material rendering a rectangle with a shadow.
15  *
16  * This material uses a distance field shader to render a rectangle with a
17  * shadow below it, optionally with rounded corners.
18  */
20 {
21 public:
23 
24 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
25  QSGMaterialShader *createShader() const override;
26 #else
27  QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override;
28 #endif
29  QSGMaterialType *type() const override;
30  int compare(const QSGMaterial *other) const override;
31 
32  QSGTexture *textureSource = nullptr;
33 
34  static QSGMaterialType staticType;
35 };
36 
37 class ShadowedTextureShader : public ShadowedRectangleShader
38 {
39 public:
40  ShadowedTextureShader(ShadowedRectangleMaterial::ShaderType shaderType);
41 
42 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
43  void initialize() override;
44  void updateState(const QSGMaterialShader::RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override;
45 #else
46  void
47  updateSampledImage(QSGMaterialShader::RenderState &state, int binding, QSGTexture **texture, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override;
48 #endif
49 };
A material rendering a rectangle with a shadow.
virtual QSGMaterialShader * createShader() const const=0
A material rendering a rectangle with a shadow.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Jan 29 2023 04:11:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.