mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-08 16:11:57 -07:00
renderer: proper full occlusion checks for back layer
This commit is contained in:
@@ -88,6 +88,11 @@ CRegion& CRegion::invert(pixman_box32_t* box) {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CRegion& CRegion::invert(const CBox& box) {
|
||||||
|
pixman_box32 pixmanBox = {box.x, box.y, box.w + box.x, box.h + box.y};
|
||||||
|
return this->invert(&pixmanBox);
|
||||||
|
}
|
||||||
|
|
||||||
CRegion& CRegion::translate(const Vector2D& vec) {
|
CRegion& CRegion::translate(const Vector2D& vec) {
|
||||||
pixman_region32_translate(&m_rRegion, vec.x, vec.y);
|
pixman_region32_translate(&m_rRegion, vec.x, vec.y);
|
||||||
return *this;
|
return *this;
|
||||||
|
@@ -47,6 +47,7 @@ class CRegion {
|
|||||||
CRegion& translate(const Vector2D& vec);
|
CRegion& translate(const Vector2D& vec);
|
||||||
CRegion& transform(const wl_output_transform t, double w, double h);
|
CRegion& transform(const wl_output_transform t, double w, double h);
|
||||||
CRegion& invert(pixman_box32_t* box);
|
CRegion& invert(pixman_box32_t* box);
|
||||||
|
CRegion& invert(const CBox& box);
|
||||||
CRegion& scale(float scale);
|
CRegion& scale(float scale);
|
||||||
CBox getExtents();
|
CBox getExtents();
|
||||||
bool containsPoint(const Vector2D& vec) const;
|
bool containsPoint(const Vector2D& vec) const;
|
||||||
|
@@ -2187,7 +2187,12 @@ bool CHyprRenderer::canSkipBackBufferClear(CMonitor* pMonitor) {
|
|||||||
ls->geometry.height != pMonitor->vecSize.y)
|
ls->geometry.height != pMonitor->vecSize.y)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!ls->layerSurface->surface->opaque)
|
// TODO: cache maybe?
|
||||||
|
CRegion opaque = &ls->layerSurface->surface->opaque_region;
|
||||||
|
CBox lsbox = {0, 0, ls->layerSurface->surface->current.buffer_width, ls->layerSurface->surface->current.buffer_height};
|
||||||
|
opaque.invert(lsbox);
|
||||||
|
|
||||||
|
if (!opaque.empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user