Changeset View
Changeset View
Standalone View
Standalone View
effects/blur/blur.cpp
Show First 20 Lines • Show All 601 Lines • ▼ Show 20 Line(s) | 585 | if (shouldBlur(w, mask, data)) { | |||
---|---|---|---|---|---|
602 | 602 | | |||
603 | //Only translated, not scaled | 603 | //Only translated, not scaled | ||
604 | } else if (translated) { | 604 | } else if (translated) { | ||
605 | shape = shape.translated(data.xTranslation(), data.yTranslation()); | 605 | shape = shape.translated(data.xTranslation(), data.yTranslation()); | ||
606 | shape = shape & region; | 606 | shape = shape & region; | ||
607 | } | 607 | } | ||
608 | 608 | | |||
609 | if (!shape.isEmpty()) { | 609 | if (!shape.isEmpty()) { | ||
610 | doBlur(shape, screen, data.opacity(), data.screenProjectionMatrix(), w->isDock(), w->geometry()); | 610 | doBlur(shape, screen, data.opacity(), data.screenProjectionMatrix(),!w->hasDecoration(), w->geometry()); | ||
611 | } | 611 | } | ||
612 | } | 612 | } | ||
613 | 613 | | |||
614 | // Draw the window over the blurred area | 614 | // Draw the window over the blurred area | ||
615 | effects->drawWindow(w, mask, region, data); | 615 | effects->drawWindow(w, mask, region, data); | ||
616 | } | 616 | } | ||
617 | 617 | | |||
618 | void BlurEffect::paintEffectFrame(EffectFrame *frame, const QRegion ®ion, double opacity, double frameOpacity) | 618 | void BlurEffect::paintEffectFrame(EffectFrame *frame, const QRegion ®ion, double opacity, double frameOpacity) | ||
Show All 31 Lines | 632 | { | |||
650 | // The noise texture looks distorted when not scaled with integer | 650 | // The noise texture looks distorted when not scaled with integer | ||
651 | noiseImage = noiseImage.scaled(noiseImage.size() * m_scalingFactor); | 651 | noiseImage = noiseImage.scaled(noiseImage.size() * m_scalingFactor); | ||
652 | 652 | | |||
653 | m_noiseTexture = GLTexture(noiseImage); | 653 | m_noiseTexture = GLTexture(noiseImage); | ||
654 | m_noiseTexture.setFilter(GL_NEAREST); | 654 | m_noiseTexture.setFilter(GL_NEAREST); | ||
655 | m_noiseTexture.setWrapMode(GL_REPEAT); | 655 | m_noiseTexture.setWrapMode(GL_REPEAT); | ||
656 | } | 656 | } | ||
657 | 657 | | |||
658 | void BlurEffect::doBlur(const QRegion& shape, const QRect& screen, const float opacity, const QMatrix4x4 &screenProjection, bool isDock, QRect windowRect) | 658 | void BlurEffect::doBlur(const QRegion& shape, const QRect& screen, const float opacity, const QMatrix4x4 &screenProjection, bool noDecoration, QRect windowRect) | ||
659 | { | 659 | { | ||
660 | // Blur would not render correctly on a secondary monitor because of wrong coordinates | 660 | // Blur would not render correctly on a secondary monitor because of wrong coordinates | ||
661 | // BUG: 393723 | 661 | // BUG: 393723 | ||
662 | const int xTranslate = -screen.x(); | 662 | const int xTranslate = -screen.x(); | ||
663 | const int yTranslate = effects->virtualScreenSize().height() - screen.height() - screen.y(); | 663 | const int yTranslate = effects->virtualScreenSize().height() - screen.height() - screen.y(); | ||
664 | 664 | | |||
665 | const QRegion expandedBlurRegion = expand(shape) & expand(screen); | 665 | const QRegion expandedBlurRegion = expand(shape) & expand(screen); | ||
666 | 666 | | |||
Show All 14 Lines | |||||
681 | 681 | | |||
682 | /* | 682 | /* | ||
683 | * If the window is a dock or panel we avoid the "extended blur" effect. | 683 | * If the window is a dock or panel we avoid the "extended blur" effect. | ||
684 | * Extended blur is when windows that are not under the blurred area affect | 684 | * Extended blur is when windows that are not under the blurred area affect | ||
685 | * the final blur result. | 685 | * the final blur result. | ||
686 | * We want to avoid this on panels, because it looks really weird and ugly | 686 | * We want to avoid this on panels, because it looks really weird and ugly | ||
687 | * when maximized windows or windows near the panel affect the dock blur. | 687 | * when maximized windows or windows near the panel affect the dock blur. | ||
688 | */ | 688 | */ | ||
689 | if (isDock) { | 689 | if (noDecoration) { | ||
690 | m_renderTargets.last()->blitFromFramebuffer(sourceRect, destRect); | 690 | m_renderTargets.last()->blitFromFramebuffer(sourceRect, destRect); | ||
691 | 691 | | |||
692 | if (useSRGB) { | 692 | if (useSRGB) { | ||
693 | glEnable(GL_FRAMEBUFFER_SRGB); | 693 | glEnable(GL_FRAMEBUFFER_SRGB); | ||
694 | } | 694 | } | ||
695 | 695 | | |||
696 | copyScreenSampleTexture(vbo, blurRectCount, shape.translated(xTranslate, yTranslate), screenProjection); | 696 | copyScreenSampleTexture(vbo, blurRectCount, shape.translated(xTranslate, yTranslate), screenProjection); | ||
697 | } else { | 697 | } else { | ||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |