nitpicker: preserve alpha channel during resize

This patch reduces flickering artifacts that appear during the
resizing of clients that use an alpha channel.

Issue #3812
This commit is contained in:
Norman Feske 2020-09-08 17:05:38 +02:00 committed by Christian Helmuth
parent 9e97393e3a
commit 0af969543d

View File

@ -16,6 +16,7 @@
/* Genode includes */
#include <blit/painter.h>
#include <os/pixel_alpha8.h>
/* local includes */
#include "chunky_texture.h"
@ -80,6 +81,20 @@ class Nitpicker::Resizeable_texture
Texture<PT> const &texture = *_textures[_current];
Blit_painter::paint(surface, texture, Point(0, 0));
/* copy alpha channel */
if (_textures[_current]->alpha() && _textures[next]->alpha()) {
typedef Pixel_alpha8 AT;
Surface<AT> surface((AT *)_textures[next]->alpha(),
_textures[next]->Texture_base::size());
Texture<AT> const texture((AT *)_textures[_current]->alpha(), nullptr,
_textures[_current]->Texture_base::size());
Blit_painter::paint(surface, texture, Point(0, 0));
}
}
_textures[_current].destruct();