1 message in net.java.dev.jna.usersRe: WindowUtils with rectangles
FromSent OnAttachments
Timothy WallMar 31, 2008 7:32 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: WindowUtils with rectanglesActions...
From:Timothy Wall (twal@dev.java.net)
Date:Mar 31, 2008 7:32:22 am
List:net.java.dev.jna.users

On Mar 30, 2008, at 3:24 PM, Christopher Deckers wrote:

Hi Timothy,

As you probably remember, I am using JNA WindowUtils for my NativeSwing framework. It is heavily used to allow mixing lightweight and heavyweight components, by setting the mask of covered areas.

I noticed that big components can take up to 200ms to apply the mask, and that it also creates images everytime I do that (which can consume a lot of memory). Some applications have several components, with each one applying masks, so this really becomes a bottleneck in terms of memory and speed.

Since I only use rectangular areas, I added a method to pass the rectangles directly: this reduces the time to apply the mask to 0-15ms. I did the change for win32 and X11, the default implementation creating a Shape and falling back on the Shape-based algorithm.

I must be missing something. You're masking a rectangular area (the native window) with a rectangle? Why not just change the size of the native window?

I enclose my version in case you feel it is an intersting addition.

Cheers, -Christopher <WindowUtils.java>