Changeset View
Changeset View
Standalone View
Standalone View
effects/blur/blur.cpp
Show First 20 Lines • Show All 574 Lines • ▼ Show 20 Line(s) | 574 | bool blurBehindDecos = effects->decorationsHaveAlpha() && | |||
---|---|---|---|---|---|
575 | effects->decorationSupportsBlurBehind(); | 575 | effects->decorationSupportsBlurBehind(); | ||
576 | 576 | | |||
577 | if (!w->hasAlpha() && w->opacity() >= 1.0 && !(blurBehindDecos && w->hasDecoration())) | 577 | if (!w->hasAlpha() && w->opacity() >= 1.0 && !(blurBehindDecos && w->hasDecoration())) | ||
578 | return false; | 578 | return false; | ||
579 | 579 | | |||
580 | return true; | 580 | return true; | ||
581 | } | 581 | } | ||
582 | 582 | | |||
583 | void BlurEffect::drawWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) | 583 | void BlurEffect::drawWindow(EffectWindow *w, int mask, const QRegion ®ion, WindowPaintData &data) | ||
584 | { | 584 | { | ||
585 | const QRect screen = GLRenderTarget::virtualScreenGeometry(); | 585 | const QRect screen = GLRenderTarget::virtualScreenGeometry(); | ||
586 | if (shouldBlur(w, mask, data)) { | 586 | if (shouldBlur(w, mask, data)) { | ||
587 | QRegion shape = region & blurRegion(w).translated(w->pos()) & screen; | 587 | QRegion shape = region & blurRegion(w).translated(w->pos()) & screen; | ||
588 | 588 | | |||
589 | // let's do the evil parts - someone wants to blur behind a transformed window | 589 | // let's do the evil parts - someone wants to blur behind a transformed window | ||
590 | const bool translated = data.xTranslation() || data.yTranslation(); | 590 | const bool translated = data.xTranslation() || data.yTranslation(); | ||
591 | const bool scaled = data.xScale() != 1 || data.yScale() != 1; | 591 | const bool scaled = data.xScale() != 1 || data.yScale() != 1; | ||
Show All 19 Lines | 610 | if (!shape.isEmpty()) { | |||
611 | doBlur(shape, screen, data.opacity(), data.screenProjectionMatrix(), w->isDock(), w->geometry()); | 611 | doBlur(shape, screen, data.opacity(), data.screenProjectionMatrix(), w->isDock(), w->geometry()); | ||
612 | } | 612 | } | ||
613 | } | 613 | } | ||
614 | 614 | | |||
615 | // Draw the window over the blurred area | 615 | // Draw the window over the blurred area | ||
616 | effects->drawWindow(w, mask, region, data); | 616 | effects->drawWindow(w, mask, region, data); | ||
617 | } | 617 | } | ||
618 | 618 | | |||
619 | void BlurEffect::paintEffectFrame(EffectFrame *frame, QRegion region, double opacity, double frameOpacity) | 619 | void BlurEffect::paintEffectFrame(EffectFrame *frame, const QRegion ®ion, double opacity, double frameOpacity) | ||
620 | { | 620 | { | ||
621 | const QRect screen = effects->virtualScreenGeometry(); | 621 | const QRect screen = effects->virtualScreenGeometry(); | ||
622 | bool valid = m_renderTargetsValid && m_shader && m_shader->isValid(); | 622 | bool valid = m_renderTargetsValid && m_shader && m_shader->isValid(); | ||
623 | 623 | | |||
624 | QRegion shape = frame->geometry().adjusted(-borderSize, -borderSize, borderSize, borderSize) & screen; | 624 | QRegion shape = frame->geometry().adjusted(-borderSize, -borderSize, borderSize, borderSize) & screen; | ||
625 | 625 | | |||
626 | if (valid && !shape.isEmpty() && region.intersects(shape.boundingRect()) && frame->style() != EffectFrameNone) { | 626 | if (valid && !shape.isEmpty() && region.intersects(shape.boundingRect()) && frame->style() != EffectFrameNone) { | ||
627 | doBlur(shape, screen, opacity * frameOpacity, frame->screenProjectionMatrix(), false, frame->geometry()); | 627 | doBlur(shape, screen, opacity * frameOpacity, frame->screenProjectionMatrix(), false, frame->geometry()); | ||
▲ Show 20 Lines • Show All 209 Lines • Show Last 20 Lines |