Changeset View
Changeset View
Standalone View
Standalone View
platformsupport/scenes/qpainter/backend.cpp
- This file was copied from plugins/platforms/fbdev/scene_qpainter_fb_backend.h.
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | 2 | KWin - the KDE window manager | ||
3 | This file is part of the KDE project. | 3 | This file is part of the KDE project. | ||
4 | 4 | | |||
5 | Copyright (C) 2015 Martin Gräßlin <mgraesslin@kde.org> | 5 | Copyright (C) 2013 Martin Gräßlin <mgraesslin@kde.org> | ||
6 | 6 | | |||
7 | This program is free software; you can redistribute it and/or modify | 7 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation; either version 2 of the License, or | 9 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | 10 | (at your option) any later version. | ||
11 | 11 | | |||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef KWIN_SCENE_QPAINTER_FB_BACKEND_H | 20 | #include "backend.h" | ||
21 | #define KWIN_SCENE_QPAINTER_FB_BACKEND_H | | |||
22 | #include "scene_qpainter.h" | | |||
23 | 21 | | |||
24 | #include <QObject> | 22 | #include <QtGlobal> | ||
25 | 23 | | |||
26 | namespace KWin | 24 | namespace KWin | ||
27 | { | 25 | { | ||
28 | class FramebufferBackend; | | |||
29 | 26 | | |||
30 | class FramebufferQPainterBackend : public QObject, public QPainterBackend | 27 | QPainterBackend::QPainterBackend() | ||
28 | : m_failed(false) | ||||
31 | { | 29 | { | ||
32 | Q_OBJECT | 30 | } | ||
33 | public: | | |||
34 | FramebufferQPainterBackend(FramebufferBackend *backend); | | |||
35 | virtual ~FramebufferQPainterBackend(); | | |||
36 | 31 | | |||
37 | QImage *buffer() override; | 32 | QPainterBackend::~QPainterBackend() | ||
38 | bool needsFullRepaint() const override; | 33 | { | ||
39 | bool usesOverlayWindow() const override; | 34 | } | ||
40 | void prepareRenderingFrame() override; | 35 | | ||
41 | void present(int mask, const QRegion &damage) override; | 36 | OverlayWindow* QPainterBackend::overlayWindow() | ||
37 | { | ||||
38 | return nullptr; | ||||
39 | } | ||||
42 | 40 | | |||
43 | private: | 41 | void QPainterBackend::showOverlay() | ||
44 | QImage m_renderBuffer; | 42 | { | ||
45 | QImage m_backBuffer; | 43 | } | ||
46 | FramebufferBackend *m_backend; | | |||
47 | }; | | |||
48 | 44 | | |||
45 | void QPainterBackend::screenGeometryChanged(const QSize &size) | ||||
46 | { | ||||
47 | Q_UNUSED(size) | ||||
49 | } | 48 | } | ||
50 | 49 | | |||
51 | #endif | 50 | void QPainterBackend::setFailed(const QString &reason) | ||
51 | { | ||||
52 | Q_UNUSED(reason) | ||||
53 | m_failed = true; | ||||
54 | } | ||||
55 | | ||||
56 | bool QPainterBackend::perScreenRendering() const | ||||
57 | { | ||||
58 | return false; | ||||
59 | } | ||||
60 | | ||||
61 | QImage *QPainterBackend::bufferForScreen(int screenId) | ||||
62 | { | ||||
63 | Q_UNUSED(screenId) | ||||
64 | return buffer(); | ||||
65 | } | ||||
66 | | ||||
67 | } |