Thanks for the quick response, Noel.  This  certainly looks better
than the original but I still have an issue.

My main app appears to be painted properly, but I have a custom
*transparent* exit confirmation 'dialog' which no longer repaints the
chosen 'option' when it is clicked on or selected with  the keyboard.
If I switch to another window and then re-activate my app, I see it
has repainted properly.  There is a chance that this is a problem with
my custom components, but it worked fine before your original commit
and also in your original commit.  (I could see a small window of the
chosen 'option' getting painted when using the keyboard).

In the screenshot, if I select 'Cancel' by clicking on it or with the
keyboard, the red background is not repainted.
I ran it with the org.apache.pivot.wtk.debugpaint=true property set
and can see that the correct bounds are being painted by Pivot, but
the actual result of the paint is not immediately visible.

Chris

On 20 October 2011 14:34, Noel Grandin <noelgran...@gmail.com> wrote:
>
> 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;
>>>                 }
>>>             }
>>>
>>>
>>>
>>>
>
>

Reply via email to