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