KWin
Loading...
Searching...
No Matches
shadowitem.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "scene/item.h"
10
11namespace KWin
12{
13
14class Shadow;
15class Window;
16
17class KWIN_EXPORT ShadowTextureProvider
18{
19public:
20 explicit ShadowTextureProvider(Shadow *shadow);
21 virtual ~ShadowTextureProvider();
22
23 Shadow *shadow() const { return m_shadow; }
24
25 virtual void update() = 0;
26
27protected:
29};
30
34class KWIN_EXPORT ShadowItem : public Item
35{
36 Q_OBJECT
37
38public:
39 explicit ShadowItem(Shadow *shadow, Window *window, Scene *scene, Item *parent = nullptr);
40 ~ShadowItem() override;
41
42 Shadow *shadow() const;
43 ShadowTextureProvider *textureProvider() const;
44
45protected:
46 WindowQuadList buildQuads() const override;
47 void preprocess() override;
48
49private Q_SLOTS:
50 void handleTextureChanged();
51 void updateGeometry();
52
53private:
54 Window *m_window;
55 Shadow *m_shadow = nullptr;
56 std::unique_ptr<ShadowTextureProvider> m_textureProvider;
57 bool m_textureDirty = true;
58};
59
60} // namespace KWin
Class representing a Window's Shadow to be rendered by the Compositor.
Definition shadow.h:48
Shadow * shadow() const
Definition shadowitem.h:23