Changeset View
Changeset View
Standalone View
Standalone View
effects/backgroundcontrast/contrast.h
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | 67 | public Q_SLOTS: | |||
---|---|---|---|---|---|
68 | void slotWindowAdded(KWin::EffectWindow *w); | 68 | void slotWindowAdded(KWin::EffectWindow *w); | ||
69 | void slotWindowDeleted(KWin::EffectWindow *w); | 69 | void slotWindowDeleted(KWin::EffectWindow *w); | ||
70 | void slotPropertyNotify(KWin::EffectWindow *w, long atom); | 70 | void slotPropertyNotify(KWin::EffectWindow *w, long atom); | ||
71 | void slotScreenGeometryChanged(); | 71 | void slotScreenGeometryChanged(); | ||
72 | 72 | | |||
73 | private: | 73 | private: | ||
74 | QRegion contrastRegion(const EffectWindow *w) const; | 74 | QRegion contrastRegion(const EffectWindow *w) const; | ||
75 | bool shouldContrast(const EffectWindow *w, int mask, const WindowPaintData &data) const; | 75 | bool shouldContrast(const EffectWindow *w, int mask, const WindowPaintData &data) const; | ||
76 | void updateContrastRegion(EffectWindow *w) const; | 76 | void updateContrastRegion(EffectWindow *w); | ||
77 | void doContrast(const QRegion &shape, const QRect &screen, const float opacity, const QMatrix4x4 &screenProjection); | 77 | void doContrast(EffectWindow *w, const QRegion &shape, const QRect &screen, const float opacity, const QMatrix4x4 &screenProjection); | ||
78 | void uploadRegion(QVector2D *&map, const QRegion ®ion); | 78 | void uploadRegion(QVector2D *&map, const QRegion ®ion); | ||
79 | void uploadGeometry(GLVertexBuffer *vbo, const QRegion ®ion); | 79 | void uploadGeometry(GLVertexBuffer *vbo, const QRegion ®ion); | ||
80 | 80 | | |||
81 | private: | 81 | private: | ||
82 | ContrastShader *shader; | 82 | ContrastShader *shader; | ||
83 | long net_wm_contrast_region; | 83 | long net_wm_contrast_region; | ||
84 | QRegion m_paintedArea; // actually painted area which is greater than m_damagedArea | 84 | QRegion m_paintedArea; // actually painted area which is greater than m_damagedArea | ||
85 | QRegion m_currentContrast; // keeps track of the currently contrasted area of non-caching windows(from bottom to top) | 85 | QRegion m_currentContrast; // keeps track of the currently contrasted area of non-caching windows(from bottom to top) | ||
86 | QHash< const EffectWindow*, QMatrix4x4> m_colorMatrices; | ||||
86 | QHash< const EffectWindow*, QMetaObject::Connection > m_contrastChangedConnections; // used only in Wayland to keep track of effect changed | 87 | QHash< const EffectWindow*, QMetaObject::Connection > m_contrastChangedConnections; // used only in Wayland to keep track of effect changed | ||
87 | KWayland::Server::ContrastManagerInterface *m_contrastManager = nullptr; | 88 | KWayland::Server::ContrastManagerInterface *m_contrastManager = nullptr; | ||
88 | }; | 89 | }; | ||
89 | 90 | | |||
90 | inline | 91 | inline | ||
91 | bool ContrastEffect::provides(Effect::Feature feature) | 92 | bool ContrastEffect::provides(Effect::Feature feature) | ||
92 | { | 93 | { | ||
93 | if (feature == Contrast) { | 94 | if (feature == Contrast) { | ||
Show All 10 Lines |