FLTK logo

[master] c684505 - Fix for issue #163: Improve Xrender scaling quality

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] c684505 - Fix for issue #163: Improve Xrender scaling quality "ManoloFLTK" Nov 24, 2020  
 
commit c684505407fa9a03ff68292017840e7b8598a775
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Tue Nov 24 09:53:53 2020 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Tue Nov 24 10:05:36 2020 +0100

    Fix for issue #163: Improve Xrender scaling quality

 src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
index 2dc9a76..b43d29c 100644
--- src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
+++ src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
@@ -812,6 +812,15 @@ int Fl_Xlib_Graphics_Driver::scale_and_render_pixmap(Fl_Offscreen pixmap, int de
       { XDoubleToFixed( 0 ),       XDoubleToFixed( 0 ),       XDoubleToFixed( 1 ) }
     }};
     XRenderSetPictureTransform(fl_display, src, &mat);
+    if (Fl_Image::scaling_algorithm() == FL_RGB_SCALING_BILINEAR) {
+      XRenderSetPictureFilter(fl_display, src, FilterBilinear, 0, 0);
+      // A note at  https://www.talisman.org/~erlkonig/misc/x11-composite-tutorial/ :
+      // "When you use a filter you'll probably want to use PictOpOver as the render op,  
+      // regardless of whether the source picture has an alpha channel or not, since
+      // the edges may end up having alpha values after the filter has been applied."
+      // suggests this would be preferable :
+      // has_alpha = true;
+    }
   }
   XRenderComposite(fl_display, (has_alpha ? PictOpOver : PictOpSrc), src, None, dst, srcx, srcy, 0, 0,
                    XP, YP, WP, HP);
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.