# HG changeset patch # User Matti Hamalainen # Date 1299162782 -7200 # Node ID 454a9fcd13caf06f18a983c80566d728f5f3b763 # Parent e9fab3c96043e926c0ba3f6fb1b395fc2d98c675 Turn antialiasing rendering hints on only for the needed elements to improve rendering speed and CPU usage. diff -r e9fab3c96043 -r 454a9fcd13ca game/Engine.java --- a/game/Engine.java Thu Mar 03 15:53:46 2011 +0200 +++ b/game/Engine.java Thu Mar 03 16:33:02 2011 +0200 @@ -550,14 +550,6 @@ { Graphics2D g2 = (Graphics2D) g; - // Use antialiasing when rendering the game elements - g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON); - - g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, - RenderingHints.VALUE_TEXT_ANTIALIAS_ON); - - // Rescale if parent component size has changed Dimension dim = getSize(); if (G.screenDim == null || !dim.equals(G.screenDim)) @@ -588,6 +580,14 @@ // Draw background image, pieces, widgets g2.drawImage(G.lautaBGScaled, 0, 0, null); + + // Use antialiasing when rendering the game elements + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + + g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + widgets.paint(g2); if (!lauta.flagGameOver)