Changeset View
Changeset View
Standalone View
Standalone View
effects/blur/blur.h
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | |||||
71 | 71 | | |||
72 | public Q_SLOTS: | 72 | public Q_SLOTS: | ||
73 | void slotWindowAdded(KWin::EffectWindow *w); | 73 | void slotWindowAdded(KWin::EffectWindow *w); | ||
74 | void slotWindowDeleted(KWin::EffectWindow *w); | 74 | void slotWindowDeleted(KWin::EffectWindow *w); | ||
75 | void slotPropertyNotify(KWin::EffectWindow *w, long atom); | 75 | void slotPropertyNotify(KWin::EffectWindow *w, long atom); | ||
76 | void slotScreenGeometryChanged(); | 76 | void slotScreenGeometryChanged(); | ||
77 | 77 | | |||
78 | private: | 78 | private: | ||
79 | void updateTexture(); | ||||
79 | QRect expand(const QRect &rect) const; | 80 | QRect expand(const QRect &rect) const; | ||
80 | QRegion expand(const QRegion ®ion) const; | 81 | QRegion expand(const QRegion ®ion) const; | ||
81 | QRegion blurRegion(const EffectWindow *w) const; | 82 | QRegion blurRegion(const EffectWindow *w) const; | ||
82 | bool shouldBlur(const EffectWindow *w, int mask, const WindowPaintData &data) const; | 83 | bool shouldBlur(const EffectWindow *w, int mask, const WindowPaintData &data) const; | ||
83 | void updateBlurRegion(EffectWindow *w) const; | 84 | void updateBlurRegion(EffectWindow *w) const; | ||
84 | void doSimpleBlur(EffectWindow *w, const float opacity, const QMatrix4x4 &screenProjection); | 85 | void doSimpleBlur(EffectWindow *w, const float opacity, const QMatrix4x4 &screenProjection); | ||
85 | void doBlur(const QRegion &shape, const QRect &screen, const float opacity, const QMatrix4x4 &screenProjection); | 86 | void doBlur(const QRegion &shape, const QRect &screen, const float opacity, const QMatrix4x4 &screenProjection); | ||
86 | void doCachedBlur(EffectWindow *w, const QRegion& region, const float opacity, const QMatrix4x4 &screenProjection); | 87 | void doCachedBlur(EffectWindow *w, const QRegion& region, const float opacity, const QMatrix4x4 &screenProjection); | ||
87 | void uploadRegion(QVector2D *&map, const QRegion ®ion); | 88 | void uploadRegion(QVector2D *&map, const QRegion ®ion); | ||
88 | void uploadGeometry(GLVertexBuffer *vbo, const QRegion &horizontal, const QRegion &vertical); | 89 | void uploadGeometry(GLVertexBuffer *vbo, const QRegion &horizontal, const QRegion &vertical); | ||
89 | 90 | | |||
90 | private: | 91 | private: | ||
91 | BlurShader *shader; | 92 | BlurShader *shader; | ||
92 | GLShader *m_simpleShader; | 93 | GLShader *m_simpleShader; | ||
93 | GLRenderTarget *target; | 94 | GLRenderTarget *target = nullptr; | ||
94 | GLTexture tex; | 95 | GLTexture tex; | ||
95 | long net_wm_blur_region; | 96 | long net_wm_blur_region; | ||
96 | QRegion m_damagedArea; // keeps track of the area which has been damaged (from bottom to top) | 97 | QRegion m_damagedArea; // keeps track of the area which has been damaged (from bottom to top) | ||
97 | QRegion m_paintedArea; // actually painted area which is greater than m_damagedArea | 98 | QRegion m_paintedArea; // actually painted area which is greater than m_damagedArea | ||
98 | QRegion m_currentBlur; // keeps track of the currently blured area of non-caching windows(from bottom to top) | 99 | QRegion m_currentBlur; // keeps track of the currently blured area of non-caching windows(from bottom to top) | ||
99 | bool m_shouldCache; | 100 | bool m_shouldCache; | ||
100 | 101 | | |||
101 | struct BlurWindowInfo { | 102 | struct BlurWindowInfo { | ||
Show All 26 Lines |