Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/virtual/virtual_backend.cpp
Show All 26 Lines | |||||
27 | // KWayland | 27 | // KWayland | ||
28 | #include <KWayland/Server/seat_interface.h> | 28 | #include <KWayland/Server/seat_interface.h> | ||
29 | // system | 29 | // system | ||
30 | #include <fcntl.h> | 30 | #include <fcntl.h> | ||
31 | #include <unistd.h> | 31 | #include <unistd.h> | ||
32 | #if HAVE_GBM | 32 | #if HAVE_GBM | ||
33 | #include <gbm.h> | 33 | #include <gbm.h> | ||
34 | #endif | 34 | #endif | ||
35 | #include <colorcorrection/nightcolor.h> | ||||
35 | 36 | | |||
36 | namespace KWin | 37 | namespace KWin | ||
37 | { | 38 | { | ||
38 | 39 | | |||
39 | VirtualBackend::VirtualBackend(QObject *parent) | 40 | VirtualBackend::VirtualBackend(QObject *parent) | ||
40 | : Platform(parent) | 41 | : Platform(parent) | ||
41 | { | 42 | { | ||
42 | if (qEnvironmentVariableIsSet("KWIN_WAYLAND_VIRTUAL_SCREENSHOTS")) { | 43 | if (qEnvironmentVariableIsSet("KWIN_WAYLAND_VIRTUAL_SCREENSHOTS")) { | ||
43 | m_screenshotDir.reset(new QTemporaryDir); | 44 | m_screenshotDir.reset(new QTemporaryDir); | ||
44 | if (!m_screenshotDir->isValid()) { | 45 | if (!m_screenshotDir->isValid()) { | ||
45 | m_screenshotDir.reset(); | 46 | m_screenshotDir.reset(); | ||
46 | } | 47 | } | ||
47 | if (!m_screenshotDir.isNull()) { | 48 | if (!m_screenshotDir.isNull()) { | ||
48 | qDebug() << "Screenshots saved to: " << m_screenshotDir->path(); | 49 | qDebug() << "Screenshots saved to: " << m_screenshotDir->path(); | ||
49 | } | 50 | } | ||
50 | } | 51 | } | ||
51 | setSupportsPointerWarping(true); | 52 | setSupportsPointerWarping(true); | ||
53 | setSupportsNightColor(true); | ||||
52 | } | 54 | } | ||
53 | 55 | | |||
54 | VirtualBackend::~VirtualBackend() | 56 | VirtualBackend::~VirtualBackend() | ||
55 | { | 57 | { | ||
56 | #if HAVE_GBM | 58 | #if HAVE_GBM | ||
57 | if (m_gbmDevice) { | 59 | if (m_gbmDevice) { | ||
58 | gbm_device_destroy(m_gbmDevice); | 60 | gbm_device_destroy(m_gbmDevice); | ||
59 | } | 61 | } | ||
Show All 32 Lines | 93 | { | |||
92 | return new VirtualQPainterBackend(this); | 94 | return new VirtualQPainterBackend(this); | ||
93 | } | 95 | } | ||
94 | 96 | | |||
95 | OpenGLBackend *VirtualBackend::createOpenGLBackend() | 97 | OpenGLBackend *VirtualBackend::createOpenGLBackend() | ||
96 | { | 98 | { | ||
97 | return new EglGbmBackend(this); | 99 | return new EglGbmBackend(this); | ||
98 | } | 100 | } | ||
99 | 101 | | |||
102 | int VirtualBackend::gammaRampSize(int screen) const { | ||||
103 | return m_gammaSizes[screen]; | ||||
104 | } | ||||
105 | | ||||
106 | bool VirtualBackend::setGammaRamp(int screen, ColorCorrect::GammaRamp &gamma) { | ||||
107 | Q_UNUSED(gamma); | ||||
108 | return m_gammaResults[screen]; | ||||
109 | } | ||||
110 | | ||||
100 | } | 111 | } |