mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
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:
parent
9e97393e3a
commit
0af969543d
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user