Author: AlbrechtS
Date: 2011-04-20 07:12:14 -0700 (Wed, 20 Apr 2011)
New Revision: 8614
Log:
Fixed alpha blending under X11 when line data size != 0 (STR #2606)
Modified:
branches/branch-1.1/CHANGES
branches/branch-1.1/src/Fl_Image.cxx
Modified: branches/branch-1.1/CHANGES
===================================================================
--- branches/branch-1.1/CHANGES 2011-04-20 14:05:41 UTC (rev 8613)
+++ branches/branch-1.1/CHANGES 2011-04-20 14:12:14 UTC (rev 8614)
@@ -1,5 +1,6 @@
CHANGES IN FLTK 1.1.11
+ - Fixed alpha blending under X11 when line data size != 0 (STR #2606)
- Update libpng access for libpng 1.5 and higher (STR #2542)
- Fixed linker issue (missing -lfontconfig) when configured with
--enable-xft (STR #2570)
Modified: branches/branch-1.1/src/Fl_Image.cxx
===================================================================
--- branches/branch-1.1/src/Fl_Image.cxx 2011-04-20 14:05:41 UTC (rev
8613)
+++ branches/branch-1.1/src/Fl_Image.cxx 2011-04-20 14:12:14 UTC (rev
8614)
@@ -329,8 +329,10 @@
// Composite an image with alpha on systems that don't have accelerated
// alpha compositing...
static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx,
int cy) {
- uchar *srcptr = (uchar*)img->array + img->d() * (img->w() * cy + cx);
- int srcskip = img->d() * (img->w() - W);
+ int ld = img->ld();
+ if (ld == 0) ld = img->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 *dstptr = dst;
@@ -342,7 +344,6 @@
if (img->d() == 2) {
// Composite grayscale + alpha over RGB...
- // Composite RGBA over RGB...
for (int y = H; y > 0; y--, srcptr+=srcskip)
for (int x = W; x > 0; x--) {
srcg = *srcptr++;
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit