Results 1 to 3 of 3
- 07-02-2012, 04:09 AM #1
Member
- Join Date
- Mar 2012
- Posts
- 5
- Rep Power
- 0
Intel HD Integrated Graphics 3000, Java Trace, Hardware Accelerated?
Hi I hope someone can help me with this problem.
I've noticed that Java seems slower on my laptop especially when viewing animations. I had a hunch that maybe my applications aren't being hardware accelerated so I enabled tracing by doing the following:Java Code:System.setProperty("sun.java2d.trace", "count");
Java Code:243 calls to sun.java2d.loops.FillRect::FillRect(AnyColor, SrcNoEa, AnyInt) 240 calls to sun.java2d.loops.FillParallelogram::FillParallelogram(AnyColor, SrcNoEa, AnyInt) 240 calls to sun.java2d.windows.GDIBlitLoops::Blit(IntRgb, SrcNoEa, "GDI") 723 total calls to 3 different primitives
On my (All in one) desktop AMD Radeon HD 6770M Graphics I get the following results:
Java Code:282 calls to sun.java2d.d3d.D3DRTTSurfaceToSurfaceBlit::Blit("D3D Surface (render-to-texture)", AnyAlpha, "D3D Surface") 287 calls to D3DFillRect 282 calls to D3DFillParallelogram 851 total calls to 3 different primitives
So my question, does the above indicate hardware acceleration isn't happening on the laptop? If so why is it not being hardware accelerated? Does it have something to do with the fact that the laptop has integrated graphics?
Thank you for your help :)
Here's the application I created for this example that creates a simple animation moving a rectangle back and forth on the screen:
Java Code:import javax.swing.*; import java.awt.*; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; public class HardwareAcceleration extends JFrame { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { System.setProperty("sun.java2d.trace", "count"); new HardwareAcceleration().setVisible(true); } }); } PaintSurface canvas = new PaintSurface(); public HardwareAcceleration() { setSize(500, 500); setLocationRelativeTo(null); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); add(canvas); } class PaintSurface extends JPanel { ScheduledThreadPoolExecutor executor; int x = 0; boolean back = false; Rectangle rect = new Rectangle(0, 0, 100, 100); public PaintSurface() { executor = new ScheduledThreadPoolExecutor(1); executor.scheduleAtFixedRate(new AnimationThread(), 0L, 16L, TimeUnit.MILLISECONDS); } class AnimationThread extends Thread { @Override public void run() { if(!back) { if((rect.x + rect.width) + 2 < getWidth()) { rect.x += 2; } else { rect.x = getWidth() - rect.width; back = !back; } } else { if(rect.x - 2 > 0) { rect.x -= 2; } else { rect.x = 0; back = !back; } } repaint(); } } @Override protected void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D)g; g2.setColor(Color.darkGray); g2.fillRect(0, 0, getWidth(), getHeight()); g2.setColor(Color.blue); g2.fill(rect); } } }
- 07-03-2012, 03:51 AM #2
Re: Intel HD Integrated Graphics 3000, Java Trace, Hardware Accelerated?
Would be good if you were to keep everyone updated with the latest findings.
Cross posted
Is it possible to make a smooth animation in Java? Animation Stutters... (Swing / AWT / SWT / JFace forum at JavaRanch)
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 07-03-2012, 08:09 AM #3
Member
- Join Date
- Mar 2012
- Posts
- 5
- Rep Power
- 0
Re: Intel HD Integrated Graphics 3000, Java Trace, Hardware Accelerated?
This is not a cross-post, see bottom. I hate it when moderators label forum posts as being cross-posted. Doing so deters others from helping with the problem at hand.
Definition of Crossposting:
Crossposting is the act of posting the same message to multiple information channels.
My question on this forum was regarding why hardware acceleration is not present on a particular machine, my question on coderanch refers to why a given animation is not fluid and how I might go about improving its performance. This has nothing to do with the lack of hardware acceleration, the netbook, and integrated graphics I question in this post.
It is a separate question. Lets not get over eager when policing for cross-posters before first reading and comparing the questions.
Why is hardware acceleration not present?:
http://www.java-forums.org/java-2d/6...celerated.html
How can I create smooth animations in Java?:
http://www.coderanch.com/t/585900/GU...ooth-animationLast edited by neptune296; 07-03-2012 at 08:22 AM.
Similar Threads
-
Does rendering to a BufferedImage get hardware accelerated? Help please?
By neptune296 in forum Java 2DReplies: 1Last Post: 03-29-2012, 06:48 AM -
Bug Tracker System with integrated Java Video Capture application
By AndyZwer in forum Java SoftwareReplies: 0Last Post: 09-17-2010, 09:48 AM -
java integrated with fingerprint device
By Azarael hashem in forum New To JavaReplies: 3Last Post: 03-28-2010, 05:36 AM -
SCJP voucher for sale @3000
By srinivasvizag in forum Java CertificationReplies: 2Last Post: 12-28-2008, 12:42 PM -
Intel Competition
By gibsonrocker800 in forum Forum LobbyReplies: 0Last Post: 01-17-2008, 01:58 AM
Bookmarks