Results 1 to 3 of 3
  1. #1
    neptune296 is offline Member
    Join Date
    Mar 2012
    Posts
    5
    Rep Power
    0

    Question 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");
    On my laptop with Intel HD Integrated Graphics 3000 (Netbook) I got the following results:

    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
    I see a lot of java2d.loops calls which to my understanding indicates rendering is going through the software pipeline.

    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
    Lots of D3D calls as expected indicates hardware accelerated rendering?

    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);
            }
        }
    }

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default 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)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    neptune296 is offline Member
    Join Date
    Mar 2012
    Posts
    5
    Rep Power
    0

    Default Re: Intel HD Integrated Graphics 3000, Java Trace, Hardware Accelerated?

    Quote Originally Posted by DarrylBurke View Post
    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)

    db
    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?:
    Intel HD Integrated Graphics 3000, Java Trace, Hardware Accelerated?

    How can I create smooth animations in Java?:
    http://www.coderanch.com/t/585900/GU...ooth-animation
    Last edited by neptune296; 07-03-2012 at 09:22 AM.

Similar Threads

  1. Replies: 1
    Last Post: 03-29-2012, 07:48 AM
  2. Replies: 0
    Last Post: 09-17-2010, 10:48 AM
  3. java integrated with fingerprint device
    By Azarael hashem in forum New To Java
    Replies: 3
    Last Post: 03-28-2010, 06:36 AM
  4. SCJP voucher for sale @3000
    By srinivasvizag in forum Java Certification
    Replies: 2
    Last Post: 12-28-2008, 01:42 PM
  5. Intel Competition
    By gibsonrocker800 in forum Forum Lobby
    Replies: 0
    Last Post: 01-17-2008, 02:58 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •