11 messages in net.java.dev.jna.usersRe: [jna-users] Re: shaped windows us...
FromSent OnAttachments
Timothy WallMay 24, 2007 7:12 am 
Christopher DeckersMay 29, 2007 2:21 am 
Christopher DeckersMay 29, 2007 3:29 am 
Wayne MeissnerMay 29, 2007 3:53 am 
Christopher DeckersMay 29, 2007 7:10 am 
Wayne MeissnerMay 29, 2007 7:43 am 
Timothy WallMay 29, 2007 11:04 am 
Olivier ChafikMay 29, 2007 6:19 pm 
Christopher DeckersMay 29, 2007 11:56 pm 
Timothy WallMay 30, 2007 5:19 am 
Christopher DeckersMay 30, 2007 6:10 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: [jna-users] Re: shaped windows using images - performanceActions...
From:Christopher Deckers (chrr@gmail.com)
Date:May 30, 2007 6:10:59 am
List:net.java.dev.jna.users

There are a few issues with the new code, and I replied to Olivier directly to avoid spamming the list. I guess if we come up with a fixed version we will say so on that list.

Feel free to use the dev list so that the discussion is archived.

I'll register to the dev list for further discussion then.

The window masking, transparency, and alpha probably belong in their own project, but for the moment they live with JNA.

Agreed. Being a functionality that many users seek, and finding it in "examples", is odd.

Olivier's solution is one I considered (and I'm glad he did it), but since it wasn't likely to affect performance for complex masks, I didn't want to spend time to implement it.

With the modification I added to his former post, I got impressive results. I use 2 images, and monitor the time the call to setWindowMask(xxx) takes, including my modification. Here is what I get:

Small image: - Before: 1828ms - After: 63ms

Big image: - Before: 41407ms - After: 157ms

Let me know if you'd like developer status if you want to spin your own branch and make sure your dev history gets tracked in SVN.

I am more of a user of this library than someone with enough knowledge of what happens internally. I am happy to contribute mainly with testing, and I can even provide the code I am using as a test case. I will also try to learn a bit about the internals in case I can contribute code, but I'll let you know if that happens.

Note that my test case adjusts the mask of the window depending on its content. Thus I diff the paint buffers and if I notice any shape/alpha change, then I set the mask with my new image. This is why good performance is of interest to me as it allows a content to define whatever shape and transparency simply by drawing that way, and have the Window picking it up. Corollary: I don't know what image gets used as a shape since it is what the application draws.

Cheers, -Christopher