Skip to content

Commit

Permalink
fixup! more work
Browse files Browse the repository at this point in the history
  • Loading branch information
ammen99 committed Feb 10, 2024
1 parent 1990449 commit 16359b9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions plugins/common/wayfire/plugins/common/workspace-wall.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ class workspace_wall_t : public wf::signal::provider_t
// Avoid keeping a low resolution if we are going up in the scale (for example, expo exit
// animation) and we're close to the 1.0 scale. Otherwise, we risk popping artifacts as we
// suddenly switch from low to high resolution.
const bool rescale_magnification = (render_scale > 0.5) && (render_scale > current_scale * 1.1);
const bool rescale_magnification = (render_scale > 0.5) &&
(render_scale > current_scale * 1.1);

// In general, it is worth changing the buffer scale if we have a lot of damage to the old
// buffer, so that for ex. a full re-scale is actually cheaper than repaiting the old buffer.
Expand Down Expand Up @@ -356,7 +357,7 @@ class workspace_wall_t : public wf::signal::provider_t
{
for (int j = 0; j < (int)self->workspaces[i].size(); j++)
{
const auto ws_bbox = self->wall->get_workspace_rectangle({i, j});
const auto ws_bbox = self->wall->get_workspace_rectangle({i, j});
const auto visible_box =
geometry_intersection(self->wall->viewport, ws_bbox) - wf::origin(ws_bbox);
wf::region_t visible_damage = self->aux_buffer_damage[i][j] & visible_box;
Expand All @@ -369,7 +370,7 @@ class workspace_wall_t : public wf::signal::provider_t
{
scene::render_pass_params_t params;
params.instances = &instances[i][j];
params.damage = std::move(visible_damage);
params.damage = std::move(visible_damage);
params.reference_output = self->wall->output;
params.target = self->aux_buffers[i][j];
scene::run_render_pass(params, scene::RPASS_EMIT_SIGNALS);
Expand All @@ -388,13 +389,13 @@ class workspace_wall_t : public wf::signal::provider_t
damage ^= self->get_bounding_box();
}

static gl_geometry scale_fbox( wf::geometry_t A, wf::geometry_t B, wf::geometry_t box)
static gl_geometry scale_fbox(wf::geometry_t A, wf::geometry_t B, wf::geometry_t box)
{
const float px = 1.0 * (box.x - A.x) / A.width;
const float py = 1.0 * (box.y - A.y) / A.height;
const float px2 = 1.0 * (box.x + box.width - A.x) / A.width;
const float py2 = 1.0 * (box.y + box.height - A.y) / A.height;
return gl_geometry {
return gl_geometry{
B.x + B.width * px,
B.y + B.height * py,
B.x + B.width * px2,
Expand Down Expand Up @@ -507,6 +508,7 @@ class workspace_wall_t : public wf::signal::provider_t
buffer.release();
}
}

OpenGL::render_end();
}

Expand Down

0 comments on commit 16359b9

Please sign in to comment.