Changeset View
Changeset View
Standalone View
Standalone View
effects/blur/blur.cpp
Show All 40 Lines | |||||
41 | namespace KWin | 41 | namespace KWin | ||
42 | { | 42 | { | ||
43 | 43 | | |||
44 | static const QByteArray s_blurAtomName = QByteArrayLiteral("_KDE_NET_WM_BLUR_BEHIND_REGION"); | 44 | static const QByteArray s_blurAtomName = QByteArrayLiteral("_KDE_NET_WM_BLUR_BEHIND_REGION"); | ||
45 | 45 | | |||
46 | BlurEffect::BlurEffect() | 46 | BlurEffect::BlurEffect() | ||
47 | { | 47 | { | ||
48 | initConfig<BlurConfig>(); | 48 | initConfig<BlurConfig>(); | ||
49 | m_shader = BlurShader::create(); | 49 | m_shader = new BlurShader(this); | ||
50 | 50 | | |||
51 | initBlurStrengthValues(); | 51 | initBlurStrengthValues(); | ||
52 | reconfigure(ReconfigureAll); | 52 | reconfigure(ReconfigureAll); | ||
53 | 53 | | |||
54 | // ### Hackish way to announce support. | 54 | // ### Hackish way to announce support. | ||
55 | // Should be included in _NET_SUPPORTED instead. | 55 | // Should be included in _NET_SUPPORTED instead. | ||
56 | if (m_shader && m_shader->isValid() && m_renderTargetsValid) { | 56 | if (m_shader && m_shader->isValid() && m_renderTargetsValid) { | ||
57 | net_wm_blur_region = effects->announceSupportProperty(s_blurAtomName, this); | 57 | net_wm_blur_region = effects->announceSupportProperty(s_blurAtomName, this); | ||
Show All 21 Lines | |||||
79 | // Fetch the blur regions for all windows | 79 | // Fetch the blur regions for all windows | ||
80 | foreach (EffectWindow *window, effects->stackingOrder()) | 80 | foreach (EffectWindow *window, effects->stackingOrder()) | ||
81 | updateBlurRegion(window); | 81 | updateBlurRegion(window); | ||
82 | } | 82 | } | ||
83 | 83 | | |||
84 | BlurEffect::~BlurEffect() | 84 | BlurEffect::~BlurEffect() | ||
85 | { | 85 | { | ||
86 | deleteFBOs(); | 86 | deleteFBOs(); | ||
87 | | ||||
88 | delete m_shader; | | |||
89 | m_shader = nullptr; | | |||
90 | } | 87 | } | ||
91 | 88 | | |||
92 | void BlurEffect::slotScreenGeometryChanged() | 89 | void BlurEffect::slotScreenGeometryChanged() | ||
93 | { | 90 | { | ||
94 | effects->makeOpenGLContextCurrent(); | 91 | effects->makeOpenGLContextCurrent(); | ||
95 | updateTexture(); | 92 | updateTexture(); | ||
96 | 93 | | |||
97 | // Fetch the blur regions for all windows | 94 | // Fetch the blur regions for all windows | ||
▲ Show 20 Lines • Show All 677 Lines • Show Last 20 Lines |