Bug 7075 - DCR - Rendering hints on GC - anti alias / mitre
Summary: DCR - Rendering hints on GC - anti alias / mitre
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: All Windows XP
: P4 enhancement with 27 votes (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 52602 (view as bug list)
Depends on:
Blocks: 32057
  Show dependency tree
 
Reported: 2001-12-18 18:58 EST by Randy Hudson CLA
Modified: 2007-06-04 05:21 EDT (History)
20 users (show)

See Also:


Attachments
Example usage of antialiasing (8.02 KB, image/gif)
2002-03-04 09:52 EST, Randy Hudson CLA
no flags Details
gdiplus.zip from newsgroup (259.85 KB, application/octet-stream)
2004-12-13 09:09 EST, Rob Grzywinski CLA
no flags Details
Native part of GDIplus Graphics (113.92 KB, application/zip)
2005-01-03 00:08 EST, Gunnar Wagenknecht CLA
no flags Details
default vs cleartype on rotated text (11.96 KB, image/gif)
2005-04-14 11:52 EDT, Randy Hudson CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2001-12-18 18:58:02 EST
The SWT GC should support rendering hints on the GC.  By documenting these 
as "hints" application developers are free to take advantage of better graphics 
support on platforms that have them, and on platforms that don't, the graphics 
will degrade in an acceptible fashion to the platform defaults.  For example, 
Windows will support anti-aliased lines, elipses, fills, etc.  Also, you can 
change the mitre of lines and polylines.

This should be exposed in SWT.  In my current project, I am debating whether I 
should use Images to cache the desired anti-alised appearance, and render the 
antialiasing myself.  Or I might store a few decorations as Images because I 
cannot paint those decorations the way I would like.  The end result is that I 
am going to use more Image handles.
Comment 1 Randy Hudson CLA 2002-03-03 21:50:36 EST
I would like this to be higher priority.  It seems like an easy thing to make 
available on windows, and have its behavior be "optional" on other platforms.
Comment 2 Randy Hudson CLA 2002-03-04 09:52:27 EST
Created attachment 420 [details]
Example usage of antialiasing
Comment 3 Alex Selkov CLA 2002-05-28 21:59:20 EDT
Some applications that are using arcs (spetially with caps) and lines 
intensively looks simply unacceptable without antialiasing. Very low-level 
algoritm implementation to solve this problem in application that uses high 
level framework looks srtange, and better to have this support included in SWT.
Comment 4 Randy Hudson CLA 2003-02-17 15:16:29 EST
A GEF user has posted a working version of the win32 GDIPlus support to the GEF 
newsgroup.  Search for the post titled "GDI".

Not all win32 boxes have the GDIPlus DLL, so SWT would have to detect this and 
ignore the rendering hints when not available.
Comment 5 Randy Hudson CLA 2003-05-30 15:07:56 EDT
changing severity since this is important to a lot of people, and there is no 
workaround for clients of SWT.
Comment 6 Steve Northover CLA 2003-06-02 14:04:32 EDT
Sorry but "higher quality graphics in SWT" didn't even make it as a deferred 
item on the Eclipse 3.0 plan.  Could OpenGL be used instead?
Comment 7 Randy Hudson CLA 2003-06-02 17:31:03 EDT
That's unfortunate. There are only 9 SWT bugzillas with 3 or more votes.
Comment 8 Brian Fernandes CLA 2003-12-29 04:22:33 EST
I downloaded the zip file posted on the GEF newsgroup under the topic "GDI+.
Logic example with antialiasing (big)" and I followed the instructions posted in
that topic to the letter; but I didn't manage to see any antialiasing in my
plugin or the Logic plugin for that matter.

I do have gdiplus.dll in my system path, I'm using Windows 2000 and I used
the suggested command line. I tried this out with eclipse 2.1.1, 2.1.2 and 3M2.

I would really really love to see my GEF plugin anti-aliased; we have a non
GEF version (using Win32 API) which my plugin has replaced; but the dated
application still looks much better because it antialiases the figures. I still
need to put in arcs on my connections and I imagine those will look pretty bad
without antialiasing.
Comment 9 Steve Northover CLA 2004-02-20 14:12:46 EST
*** Bug 52602 has been marked as a duplicate of this bug. ***
Comment 10 Morten Moeller CLA 2004-05-09 14:39:02 EDT
I've looked all over the GEF newsgroup for the posting mentioned here. Is there anyway someone can 
repost it or attach the patch to this bug?
Comment 11 Gunnar Wagenknecht CLA 2004-05-10 00:15:20 EDT
23 votes and still P4
Comment 12 Silenio Quarti CLA 2004-11-16 14:21:04 EST
We have added support for line CAP and JOIN (>20041116). See GC.setLineCap() 
and GC.setLineJoin().
Comment 13 Rob Grzywinski CLA 2004-12-13 08:48:22 EST
Requested (from Morten Moeller) GDI+ posting:

 http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg01709.html
Comment 14 Rob Grzywinski CLA 2004-12-13 09:09:18 EST
Created attachment 16549 [details]
gdiplus.zip from newsgroup
Comment 15 Gunnar Wagenknecht CLA 2005-01-03 00:08:23 EST
Created attachment 16893 [details]
Native part of GDIplus Graphics

Here are the sources for the native part.
Comment 16 Randy Hudson CLA 2005-03-18 17:47:47 EST
Is there any chance this bug is targeted for 3.1? There is no workaround so 
it's very important for clients.
Comment 17 Silenio Quarti CLA 2005-03-21 13:11:59 EST
Antialising and interpolation hints are items for the 3.1 M6 milestone. We 
have been working on this as part of the new advanced graphics API. It is very 
hard to come up with an API that is reasonable for all the platforms/libraries 
we are working with: GDI+, Cairo and Quartz.

On Cairo, currently there is no API to control if antialiasing is applied or 
not. Output is aways antialised.

On GDI+, it is possible to control if antialising is applied separately for 
lines/curves and text. There are also different algorithms (it is not only an 
ON/OFF property). On Mac, antialising is a ON/OFF property.

The same goes for interpolation (image quality/speed hint). There are 
different algorithms available on different platforms.

Comment 18 Randy Hudson CLA 2005-03-21 14:24:07 EST
I think image interpolation is a separate enhancement.  GTK and Motif are 
basically ignores since you can't do anything anyway.

On the Mac you could emulate the GDI+ behavior. Turn on/off global AA based on 
the type of graphics call being made.
Or, you could provide a bunch of hint styles which may or may not have an 
effect, or may conflict with each other (Sounds pretty bad)

Or, just provide a single setting which affects as many operations as the 
platform supports.  Clients could turn this setting on and off based on what 
they are painting.

Which way are you leaning? It would be nice if Fonts were not affected. SWT 
currently renders using ClearType(TM) if enabled. I would not want AA to 
override clear type, making fonts harder to read. (Or is clear-type one of the 
available AA-algorithms?)

Also, what does AA do when printing?
Comment 19 James Willans CLA 2005-04-11 16:13:45 EDT
Can someone update me on the current state of this.  Is there any provision for
this functionality in M6 and how do we take advantage of it?

Thanks.  James
Comment 20 Silenio Quarti CLA 2005-04-11 18:02:28 EDT
Code did go into M6, but check GC.setAntialias() in HEAD.
Comment 21 Silenio Quarti CLA 2005-04-12 11:49:43 EDT
Fixed in HEAD. See GC.setAntialias() and GC.setTextAntialias().
Comment 22 Randy Hudson CLA 2005-04-12 15:50:55 EDT
What is the behavior of calling this API if Cairo is not present?
Comment 23 Randy Hudson CLA 2005-04-14 11:48:29 EDT
When drawing rotated text, it is desirable to enable
Gdip.TextRenderingHintAntiAliasGridFit
rather than
Gdip.TextRenderingHintClearTypeGridFit

ClearType only does antialiasing in the horizontal direction when using LCD or
Trinitron monitors.

I think more styles are needed for setTextAntiAlias.
Comment 24 Randy Hudson CLA 2005-04-14 11:52:00 EDT
Created attachment 19916 [details]
default vs cleartype on rotated text
Comment 25 Ed Burnette CLA 2005-05-20 17:39:41 EDT
Are there any example code snippets that use the new API?