Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Right approach to enable SWT hardware acceleration(Best coding approach to have SWT hardware accelerated as much as possible)
Right approach to enable SWT hardware acceleration [message #1696915] Fri, 29 May 2015 07:17 Go to next message
Eclipse UserFriend
On Windows, I understand that SWT delegates rendering to the GDI and GDI+.

According to https://www.eclipse.org/forums/index.php?t=msg&th=152875&goto=481944&#msg_481944, operation done via GDI is accelerated while those on GDI+ is not.

Does that implies we should set GC advanced to false as soon as possible after the advanced drawing (e.g. setAlpha)? Does it implies drawing after turning off GC Advanced is done via GDI and hardward accelerated?

I found this code in StyledText. Is it the recommended approach for every call to the advanced function like setAlpha, setAntialias?

if (gc.getAdvanced()) {
			gc.setAlpha(100);
			gc.fillRectangle(rect);
			gc.setAdvanced(false);
		}
Re: Right approach to enable SWT hardware acceleration [message #1697463 is a reply to message #1696915] Thu, 04 June 2015 03:34 Go to previous messageGo to next message
Eclipse UserFriend
Does that implies we should set GC advanced to false as soon as possible after the advanced drawing (e.g. setAlpha)? Does it implies drawing after turning off GC Advanced is done via GDI and hardward accelerated?
>> As soon you set GC#setAdvence(false), the advanced graphics subsystem is no longer used, advanced graphics state is cleared and the normal graphics subsystem "GDI" is used from now on, which is hardware accelerated.

I found this code in StyledText. Is it the recommended approach for every call to the advanced function like setAlpha, setAntialias?
>> Normally, the advanced graphics subsystem is invoked automatically when any one of the alpha, antialias, patterns, interpolation, paths, clipping or transformation operations in the receiver is requested.
>> When you don't need GDI+, it's better to turn Advance function 'off' as we do in StyledText.java
Re: Right approach to enable SWT hardware acceleration [message #1697565 is a reply to message #1697463] Thu, 04 June 2015 21:23 Go to previous message
Eclipse UserFriend
Thanks for your reply Modi.

What would be the best approach to measure graphical performance to ensure the hardware acceleration is enabled?
Previous Topic:Browser.setUrl(String, String, String[]) not sending post data
Next Topic:drawImage directly to browser <image>
Goto Forum:
  


Current Time: Sun Jul 27 16:11:15 EDT 2025

Powered by FUDForum. Page generated in 0.03975 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top