Changeset View
Standalone View
platform.h
Show All 32 Lines | |||||
33 | namespace KWayland { | 33 | namespace KWayland { | ||
34 | namespace Server { | 34 | namespace Server { | ||
35 | class OutputConfigurationInterface; | 35 | class OutputConfigurationInterface; | ||
36 | } | 36 | } | ||
37 | } | 37 | } | ||
38 | 38 | | |||
39 | namespace KWin | 39 | namespace KWin | ||
40 | { | 40 | { | ||
41 | namespace ColorCorrect { | ||||
42 | class Manager; | ||||
43 | struct GammaRamp; | ||||
44 | } | ||||
41 | 45 | | |||
42 | class Edge; | 46 | class Edge; | ||
43 | class Compositor; | 47 | class Compositor; | ||
44 | class OverlayWindow; | 48 | class OverlayWindow; | ||
45 | class OpenGLBackend; | 49 | class OpenGLBackend; | ||
46 | class Outline; | 50 | class Outline; | ||
47 | class OutlineVisual; | 51 | class OutlineVisual; | ||
48 | class QPainterBackend; | 52 | class QPainterBackend; | ||
▲ Show 20 Lines • Show All 329 Lines • ▼ Show 20 Line(s) | 68 | public: | |||
378 | virtual void createEffectsHandler(Compositor *compositor, Scene *scene); | 382 | virtual void createEffectsHandler(Compositor *compositor, Scene *scene); | ||
379 | /** | 383 | /** | ||
380 | * The CompositingTypes supported by the Platform. | 384 | * The CompositingTypes supported by the Platform. | ||
381 | * The first item should be the most preferred one. | 385 | * The first item should be the most preferred one. | ||
382 | * @since 5.11 | 386 | * @since 5.11 | ||
383 | **/ | 387 | **/ | ||
384 | virtual QVector<CompositingType> supportedCompositors() const = 0; | 388 | virtual QVector<CompositingType> supportedCompositors() const = 0; | ||
385 | 389 | | |||
390 | /** | ||||
391 | * Whether gamma control is supported by the backend. | ||||
392 | * @since 5.11 | ||||
393 | **/ | ||||
394 | bool supportsGammaControl() const { | ||||
395 | return m_supportsGammaControl; | ||||
396 | } | ||||
397 | | ||||
398 | ColorCorrect::Manager *colorCorrectManager() { | ||||
399 | return m_colorCorrect; | ||||
400 | } | ||||
401 | | ||||
402 | virtual int gammaRampSize(int screen) const { | ||||
403 | Q_UNUSED(screen); | ||||
404 | return 0; | ||||
405 | } | ||||
406 | virtual bool setGammaRamp(int screen, ColorCorrect::GammaRamp &gamma) { | ||||
407 | Q_UNUSED(screen); | ||||
408 | Q_UNUSED(gamma); | ||||
409 | return false; | ||||
410 | } | ||||
411 | | ||||
386 | /* | 412 | /* | ||
387 | * A string of information to include in kwin debug output | 413 | * A string of information to include in kwin debug output | ||
388 | * It should not be translated. | 414 | * It should not be translated. | ||
389 | * | 415 | * | ||
390 | * The base implementation prints the name. | 416 | * The base implementation prints the name. | ||
391 | * @since 5.12 | 417 | * @since 5.12 | ||
392 | */ | 418 | */ | ||
393 | virtual QString supportInformation() const; | 419 | virtual QString supportInformation() const; | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 464 | QSize initialWindowSize() const { | |||
439 | return m_initialWindowSize; | 465 | return m_initialWindowSize; | ||
440 | } | 466 | } | ||
441 | QByteArray deviceIdentifier() const { | 467 | QByteArray deviceIdentifier() const { | ||
442 | return m_deviceIdentifier; | 468 | return m_deviceIdentifier; | ||
443 | } | 469 | } | ||
444 | void setSupportsPointerWarping(bool set) { | 470 | void setSupportsPointerWarping(bool set) { | ||
445 | m_pointerWarping = set; | 471 | m_pointerWarping = set; | ||
446 | } | 472 | } | ||
473 | void setSupportsGammaControl(bool set) { | ||||
davidedmundson: ok, if this is staying in KWin I still want it layered better. Otherwise you're going to find… | |||||
Yes, you're probably right. I left the name because I was a little bit worried, that there are maybe platforms in the future, where the mechanism for changing gamma and changing color temperature is not working the same as in DRM. But probably when a platform can do one of the two things it can do the other one as well. I'll wait until we settled on the right name of the whole (see Martin's comment about the older Color Correction / ICC / Kolor Manager code) to find a better method name for it. Otherwise I would have called it "supportsColorCorrection", in case there is a platform using a different mechanism than gamma ramp adjustment. Or should we ignore this possibility for now as well in your opinion? romangg: Yes, you're probably right. I left the name because I was a little bit worried, that there are… | |||||
I agree with David here: just make it gamma. If in the future we have a difference we can still introduce more variants. graesslin: I agree with David here: just make it gamma. If in the future we have a difference we can still… | |||||
474 | m_supportsGammaControl = set; | ||||
475 | } | ||||
447 | 476 | | |||
448 | /** | 477 | /** | ||
449 | * Actual platform specific way to hide the cursor. | 478 | * Actual platform specific way to hide the cursor. | ||
450 | * Sub-classes need to implement if they support hiding the cursor. | 479 | * Sub-classes need to implement if they support hiding the cursor. | ||
451 | * | 480 | * | ||
452 | * This method is invoked by hideCursor if the cursor needs to be hidden. | 481 | * This method is invoked by hideCursor if the cursor needs to be hidden. | ||
453 | * The default implementation does nothing. | 482 | * The default implementation does nothing. | ||
454 | * | 483 | * | ||
Show All 28 Lines | 501 | private: | |||
483 | bool m_outputsEnabled = true; | 512 | bool m_outputsEnabled = true; | ||
484 | int m_initialOutputCount = 1; | 513 | int m_initialOutputCount = 1; | ||
485 | qreal m_initialOutputScale = 1; | 514 | qreal m_initialOutputScale = 1; | ||
486 | EGLDisplay m_eglDisplay; | 515 | EGLDisplay m_eglDisplay; | ||
487 | EGLConfig m_eglConfig = nullptr; | 516 | EGLConfig m_eglConfig = nullptr; | ||
488 | EGLContext m_context = EGL_NO_CONTEXT; | 517 | EGLContext m_context = EGL_NO_CONTEXT; | ||
489 | EGLSurface m_surface = EGL_NO_SURFACE; | 518 | EGLSurface m_surface = EGL_NO_SURFACE; | ||
490 | int m_hideCursorCounter = 0; | 519 | int m_hideCursorCounter = 0; | ||
520 | ColorCorrect::Manager *m_colorCorrect = nullptr; | ||||
521 | bool m_supportsGammaControl = false; | ||||
491 | }; | 522 | }; | ||
492 | 523 | | |||
493 | } | 524 | } | ||
494 | 525 | | |||
495 | Q_DECLARE_INTERFACE(KWin::Platform, "org.kde.kwin.Platform") | 526 | Q_DECLARE_INTERFACE(KWin::Platform, "org.kde.kwin.Platform") | ||
496 | 527 | | |||
497 | #endif | 528 | #endif |
ok, if this is staying in KWin I still want it layered better. Otherwise you're going to find it hard to extend it.
Nothing in Platform and subclasses should mention nightmode.
They should all refer to supportsGammaCorrection or something.