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