I've checked in a fix for this, but some more testing reveals that rapid window resizing causes some flickering of black rectangles in the corners. Not ideal.
Chris Bartlett wrote: > I haven't had time to investigate in any way, but this commit needs > more testing. > > I isolated this single commit and ran the same app with and without it > (bad = with, good = without). > See attached screen shots from a test on my dev box (Windows XP x64, > with Oracle JRE 1.6.0_26) > The small painted areas on the right side of the 'bad' example are > where a tooltip popped up (but are not the entire size of the tooltip) > > I will put together a minimal example if I can find the time, but that > won't be until next week at the earliest. > > On 17 October 2011 15:36, <noelgran...@apache.org> wrote: >> Author: noelgrandin >> Date: Mon Oct 17 08:36:55 2011 >> New Revision: 1185040 >> >> URL: http://svn.apache.org/viewvc?rev=1185040&view=rev >> Log: >> PIVOT-778 Optimise DisplayHost.paintBuffered and >> DisplayHost.paintVolatileBuffered >> cache the VolatileImage >> >> Modified: >> pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java >> >> Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java >> URL: >> http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java?rev=1185040&r1=1185039&r2=1185040&view=diff >> ============================================================================== >> --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java >> (original) >> +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java Mon Oct >> 17 08:36:55 2011 >> @@ -92,6 +92,7 @@ public abstract class ApplicationContext >> private boolean paintPending = false; >> private boolean disableVolatileBuffer = false; >> private boolean debugPaint = false; >> + private java.awt.image.VolatileImage volatileImage = null; >> >> private Random random = null; >> >> @@ -511,9 +512,10 @@ public abstract class ApplicationContext >> // Paint the display into a volatile offscreen buffer >> GraphicsConfiguration gc = graphics.getDeviceConfiguration(); >> java.awt.Rectangle clipBounds = graphics.getClipBounds(); >> - java.awt.image.VolatileImage volatileImage = >> - gc.createCompatibleVolatileImage(clipBounds.width, >> clipBounds.height, >> + if (volatileImage == null) { >> + volatileImage = >> gc.createCompatibleVolatileImage(clipBounds.width, clipBounds.height, >> Transparency.OPAQUE); >> + } >> >> // If we have a valid volatile image, attempt to paint the >> // display to it >> @@ -534,6 +536,9 @@ public abstract class ApplicationContext >> } >> >> painted = !volatileImage.contentsLost(); >> + } else { >> + volatileImage.flush(); >> + volatileImage = null; >> } >> } >> >> >> >>