Bug 413240

Summary: Implement support for SWT CAIRO_ANTIALIAS_SUBPIXEL
Product: [Eclipse Project] Platform Reporter: Sylvain MOUQUET <flashman22>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: ericwill
Version: 4.4Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description Sylvain MOUQUET CLA 2013-07-18 08:15:38 EDT
Hi, 

In the class org.eclipse.swt.graphics.GC, it's not possible to use Cairo.CAIRO_ANTIALIAS_SUBPIXEL in the method setAntialias : 

public void setAntialias(int antialias) { 
3046 if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); 
3047 if (data.cairo == 0 && antialias == SWT.DEFAULT) return; 
3048 int mode = 0; 
3049 switch (antialias) { 
3050 case SWT.DEFAULT: mode = Cairo.CAIRO_ANTIALIAS_DEFAULT; break; 
3051 case SWT.OFF: mode = Cairo.CAIRO_ANTIALIAS_NONE; break; 
3052 case SWT.ON: mode = Cairo.CAIRO_ANTIALIAS_GRAY; 
3053            break; 
3054 default: 
3055 SWT.error(SWT.ERROR_INVALID_ARGUMENT); 
3056 } 
3057    initCairo(); 
3058    long /*int*/ cairo = data.cairo; 
3059    Cairo.cairo_set_antialias(cairo, mode); 
3060} 

it's possible to add it ? 

cf http://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg07546.html
"Please open a enhancement bug report for this. It probably requires new SWT API (a new constant -> SWT.SUBPIXEL). I quickly looked and it seems it would only make sense on GTK/Cairo. There is no equivalent on GDI+ and Cocoa.  Another possibility is to add a constant SWT.BEST which maps to CAIRO_ANTIALIAS_SUBPIXEL on cairo and it is the same as SWT.ON on the other platforms."

Thanks,
Sylvain
Comment 1 Eric Williams CLA 2018-11-30 11:16:46 EST
I would be happy to review any patches for this sort enhancement.