Changeset View
Changeset View
Standalone View
Standalone View
plugins/scenes/opengl/lanczosfilter.cpp
Show All 39 Lines | |||||
40 | 40 | | |||
41 | #include <cmath> | 41 | #include <cmath> | ||
42 | 42 | | |||
43 | namespace KWin | 43 | namespace KWin | ||
44 | { | 44 | { | ||
45 | 45 | | |||
46 | LanczosFilter::LanczosFilter(QObject* parent) | 46 | LanczosFilter::LanczosFilter(QObject* parent) | ||
47 | : QObject(parent) | 47 | : QObject(parent) | ||
48 | , m_offscreenTex(0) | 48 | , m_offscreenTex(nullptr) | ||
49 | , m_offscreenTarget(0) | 49 | , m_offscreenTarget(nullptr) | ||
50 | , m_inited(false) | 50 | , m_inited(false) | ||
51 | , m_shader(0) | 51 | , m_shader(nullptr) | ||
52 | , m_uOffsets(0) | 52 | , m_uOffsets(0) | ||
53 | , m_uKernel(0) | 53 | , m_uKernel(0) | ||
54 | { | 54 | { | ||
55 | } | 55 | } | ||
56 | 56 | | |||
57 | LanczosFilter::~LanczosFilter() | 57 | LanczosFilter::~LanczosFilter() | ||
58 | { | 58 | { | ||
59 | delete m_offscreenTarget; | 59 | delete m_offscreenTarget; | ||
▲ Show 20 Lines • Show All 175 Lines • ▼ Show 20 Line(s) | 234 | if (hardwareClipping) { | |||
235 | glDisable(GL_SCISSOR_TEST); | 235 | glDisable(GL_SCISSOR_TEST); | ||
236 | } | 236 | } | ||
237 | cachedTexture->unbind(); | 237 | cachedTexture->unbind(); | ||
238 | m_timer.start(5000, this); | 238 | m_timer.start(5000, this); | ||
239 | return; | 239 | return; | ||
240 | } else { | 240 | } else { | ||
241 | // offscreen texture not matching - delete | 241 | // offscreen texture not matching - delete | ||
242 | delete cachedTexture; | 242 | delete cachedTexture; | ||
243 | cachedTexture = 0; | 243 | cachedTexture = nullptr; | ||
244 | w->setData(LanczosCacheRole, QVariant()); | 244 | w->setData(LanczosCacheRole, QVariant()); | ||
245 | } | 245 | } | ||
246 | } | 246 | } | ||
247 | 247 | | |||
248 | WindowPaintData thumbData = data; | 248 | WindowPaintData thumbData = data; | ||
249 | thumbData.setXScale(1.0); | 249 | thumbData.setXScale(1.0); | ||
250 | thumbData.setYScale(1.0); | 250 | thumbData.setYScale(1.0); | ||
251 | thumbData.setXTranslation(-w->x() - left); | 251 | thumbData.setXTranslation(-w->x() - left); | ||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Line(s) | |||||
387 | 387 | | |||
388 | void LanczosFilter::timerEvent(QTimerEvent *event) | 388 | void LanczosFilter::timerEvent(QTimerEvent *event) | ||
389 | { | 389 | { | ||
390 | if (event->timerId() == m_timer.timerId()) { | 390 | if (event->timerId() == m_timer.timerId()) { | ||
391 | m_timer.stop(); | 391 | m_timer.stop(); | ||
392 | 392 | | |||
393 | delete m_offscreenTarget; | 393 | delete m_offscreenTarget; | ||
394 | delete m_offscreenTex; | 394 | delete m_offscreenTex; | ||
395 | m_offscreenTarget = 0; | 395 | m_offscreenTarget = nullptr; | ||
396 | m_offscreenTex = 0; | 396 | m_offscreenTex = nullptr; | ||
397 | foreach (Client *c, Workspace::self()->clientList()) { | 397 | foreach (Client *c, Workspace::self()->clientList()) { | ||
398 | discardCacheTexture(c->effectWindow()); | 398 | discardCacheTexture(c->effectWindow()); | ||
399 | } | 399 | } | ||
400 | foreach (Client *c, Workspace::self()->desktopList()) { | 400 | foreach (Client *c, Workspace::self()->desktopList()) { | ||
401 | discardCacheTexture(c->effectWindow()); | 401 | discardCacheTexture(c->effectWindow()); | ||
402 | } | 402 | } | ||
403 | foreach (Unmanaged *u, Workspace::self()->unmanagedList()) { | 403 | foreach (Unmanaged *u, Workspace::self()->unmanagedList()) { | ||
404 | discardCacheTexture(u->effectWindow()); | 404 | discardCacheTexture(u->effectWindow()); | ||
Show All 24 Lines |