diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-11-20 10:33:31 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-11-20 10:33:46 +0100 |
| commit | aa9e2e888ef7eaca961e6d7c17ec1ebab0469e54 (patch) | |
| tree | 4c0ec7fda35a79604b03f485e30156a6e2b57e83 /src/drivers/Xlib | |
| parent | aa140973a386b16130289c1a8c97b9ae6712ee98 (diff) | |
Fix for issue #159 - continued
Changes here concentrate the fix within static function alpha_blend() and thus
are visible only when drawing transparent images under X11 platform
without Xrender.
Diffstat (limited to 'src/drivers/Xlib')
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx index c7a811262..2dc9a76aa 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx @@ -658,13 +658,15 @@ static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, i int ld = img->ld(); if (ld == 0) ld = img->data_w() * img->d(); uchar *srcptr = (uchar*)img->array + cy * ld + cx * img->d(); - int srcskip = ld - img->d() * W; - uchar *dst = new uchar[W * H * 3]; + uchar *dst = fl_read_image(NULL, X, Y, W, H, 0); + if (!dst) { + fl_draw_image(srcptr, X, Y, W, H, img->d(), ld); + return; + } + int srcskip = ld - img->d() * W; uchar *dstptr = dst; - fl_read_image(dst, X, Y, W, H, 0); - uchar srcr, srcg, srcb, srca; uchar dstr, dstg, dstb, dsta; |
