kwin/src/shadowitem.h
Vlad Zahorodnii 935fa6a9e1 Move ownership of Shadow to Toplevel
This decouples the management of Shadow from the scene window and allows
multiple items share the same Shadow.

Currently, kwin has a single scene graph, but it makes sense to create a
scene graph per output as they could have different layers, etc. This
would also allow QtQuick share more textures with kwin, which is worth
doing for optimization purposes in the future.
2021-09-06 10:42:39 +00:00

44 lines
814 B
C++

/*
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "item.h"
namespace KWin
{
class Deleted;
class Shadow;
class Toplevel;
/**
* The ShadowItem class represents a nine-tile patch server-side drop-shadow.
*/
class KWIN_EXPORT ShadowItem : public Item
{
Q_OBJECT
public:
explicit ShadowItem(Shadow *shadow, Toplevel *window, Item *parent = nullptr);
~ShadowItem() override;
Shadow *shadow() const;
protected:
WindowQuadList buildQuads() const override;
private Q_SLOTS:
void handleTextureChanged();
void updateGeometry();
void handleWindowClosed(Toplevel *original, Deleted *deleted);
private:
Toplevel *m_window;
Shadow *m_shadow = nullptr;
};
} // namespace KWin