mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 13:25:58 +01:00
fix blur damage issues with scaled
This commit is contained in:
parent
06e6c6021e
commit
80f58bc93f
1 changed files with 10 additions and 2 deletions
|
@ -846,10 +846,10 @@ void CHyprOpenGLImpl::renderTextureWithBlur(const CTexture& tex, wlr_box* pBox,
|
||||||
pixman_region32_t inverseOpaque;
|
pixman_region32_t inverseOpaque;
|
||||||
pixman_region32_init(&inverseOpaque);
|
pixman_region32_init(&inverseOpaque);
|
||||||
if (a >= 255.f) {
|
if (a >= 255.f) {
|
||||||
pixman_box32_t surfbox = {0, 0, pSurface->current.width, pSurface->current.height};
|
pixman_box32_t surfbox = {0, 0, pSurface->current.width * pSurface->current.scale, pSurface->current.height * pSurface->current.scale};
|
||||||
pixman_region32_copy(&inverseOpaque, &pSurface->current.opaque);
|
pixman_region32_copy(&inverseOpaque, &pSurface->current.opaque);
|
||||||
pixman_region32_inverse(&inverseOpaque, &inverseOpaque, &surfbox);
|
pixman_region32_inverse(&inverseOpaque, &inverseOpaque, &surfbox);
|
||||||
pixman_region32_intersect_rect(&inverseOpaque, &inverseOpaque, 0, 0, pSurface->current.width, pSurface->current.height);
|
pixman_region32_intersect_rect(&inverseOpaque, &inverseOpaque, 0, 0, pSurface->current.width * pSurface->current.scale, pSurface->current.height * pSurface->current.scale);
|
||||||
|
|
||||||
if (!pixman_region32_not_empty(&inverseOpaque)) {
|
if (!pixman_region32_not_empty(&inverseOpaque)) {
|
||||||
pixman_region32_fini(&inverseOpaque);
|
pixman_region32_fini(&inverseOpaque);
|
||||||
|
@ -865,8 +865,16 @@ void CHyprOpenGLImpl::renderTextureWithBlur(const CTexture& tex, wlr_box* pBox,
|
||||||
|
|
||||||
CFramebuffer* POUTFB = nullptr;
|
CFramebuffer* POUTFB = nullptr;
|
||||||
if (!USENEWOPTIMIZE) {
|
if (!USENEWOPTIMIZE) {
|
||||||
|
if (pSurface->current.scale != 1) {
|
||||||
|
// wlroots prohibits shrinking a region
|
||||||
|
// TODO: just shrink
|
||||||
|
pixman_region32_union_rect(&inverseOpaque, &inverseOpaque, 0, 0, pBox->width, pBox->height);
|
||||||
|
}
|
||||||
|
|
||||||
pixman_region32_translate(&inverseOpaque, pBox->x, pBox->y);
|
pixman_region32_translate(&inverseOpaque, pBox->x, pBox->y);
|
||||||
|
|
||||||
|
pixman_region32_intersect(&inverseOpaque, &inverseOpaque, &damage);
|
||||||
|
|
||||||
POUTFB = blurMainFramebufferWithDamage(a, pBox, &inverseOpaque);
|
POUTFB = blurMainFramebufferWithDamage(a, pBox, &inverseOpaque);
|
||||||
} else {
|
} else {
|
||||||
POUTFB = &m_RenderData.pCurrentMonData->blurFB;
|
POUTFB = &m_RenderData.pCurrentMonData->blurFB;
|
||||||
|
|
Loading…
Reference in a new issue