<Swing Dev> How to resolve image tearing
ximalaya
ims3g at 126.com
Mon Apr 18 16:51:30 UTC 2011
Hi Anthony,
Thanks for your comments!
Sorry, I don't quite understand why we simply can't sync up with repainting of lw and hw components. Could you please give me more information?
For lw component, there is a sync paint method, named 'paintImmediately'. But for hw component, there is no such method. Seems your answer can explain this difference. BTW, then, what should I do if I need sync paint for hw component?
For the difference between openJDK 1.6.0_18 and latest openJDK, please pay attention that, openJDK was used in our test. I am not sure the code base of openJDK 1.6.0_18 is same as JDK 1.6.0 u18, perhaps you can have a try with openJDK?
Thanks and Best Regards,
ZhangL
Hi Lin,
On 4/12/2011 7:30 PM, ximalaya wrote:
> Then in our case, do we have to draw texts directly in the canvas?
Yes, I think this is the most robust solution for you. In general case
AWT is unable to draw on arbitrary custom hw components because we
simply can't sync up with their repainting - this is the main reason we
can't implement reliable support for non-opaque lw components mixing.
However, in your case the application fully controls painting on your
own hw canvas, so you can render the text directly onto the canvas
yourself, thus resolving your particular issue.
> Regarding the different behaviour between openJDK 1.6.0_18 and latest
> openJDK build, seems something has been changed?
I've looked through the bugs fixed in 6u18+ and don't seem to find
anything related to mixing. Could you please provide more details:
1. Since what exact 6 update release the issue is reproducible? u19?
u20? or...?
2. A simple and short test case that reproduces the issue?
> If you ever experienced image tearing or have knowledge on this topic, welcome to share with me. I've spent rather a lot time to look into this issue. For a video player written in Java, this might be a common problem. I've posted to 2d-dev mailing list, no response yet.
Sorry, but no, I'm not a graphics expert. Please ping 2d-dev@ folks on this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20110419/ba704b7b/attachment.html>
More information about the swing-dev
mailing list