Support window opacity in compositor again

This commit is contained in:
K. Lange 2018-03-17 17:27:17 +09:00 committed by Kevin Lange
parent 7229c70080
commit 8d31257fb6

View File

@ -731,10 +731,19 @@ static int yutani_blit_window(yutani_globals_t * yg, yutani_server_window_t * wi
} }
} else { } else {
draw_window: draw_window:
if (window == yg->resizing_window) { if (window->opacity != 255) {
draw_sprite_scaled(yg->backend_ctx, &_win_sprite, window->x + (int)yg->resizing_offset_x, window->y + (int)yg->resizing_offset_y, yg->resizing_w, yg->resizing_h); double opacity = (double)(window->opacity) / 255.0;
if (window == yg->resizing_window) {
draw_sprite_scaled_alpha(yg->backend_ctx, &_win_sprite, window->x + (int)yg->resizing_offset_x, window->y + (int)yg->resizing_offset_y, yg->resizing_w, yg->resizing_h, opacity);
} else {
draw_sprite_alpha(yg->backend_ctx, &_win_sprite, window->x, window->y, opacity);
}
} else { } else {
draw_sprite(yg->backend_ctx, &_win_sprite, window->x, window->y); if (window == yg->resizing_window) {
draw_sprite_scaled(yg->backend_ctx, &_win_sprite, window->x + (int)yg->resizing_offset_x, window->y + (int)yg->resizing_offset_y, yg->resizing_w, yg->resizing_h);
} else {
draw_sprite(yg->backend_ctx, &_win_sprite, window->x, window->y);
}
} }
} }
draw_finish: draw_finish: