This is the mail archive of the mailing list for the Java project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Change to coalescePaintEvents method's heuristics

David Jee wrote:

We could introduce a mechanism to explicitly and forcefully repaint the erased heavyweight components, but that seems like a hack to me. (I could be wrong on this. Comments are welcome.)


What if a heavyweight component is already over one of the areas to be repainted (forget the coalescing for a moment)? We will have to repaint those anyway, right?

In general, we must repaint all heavyweight components that fall in any of the areas to be repainted as their Z-order is always higher than the Z-order of the lightweight ones. The repainting of the heavyweight ones should also consider the Z-order among them, of course.

As you will have to test and perhaps repaint the heavyweight components that fall over the original area, maybe it is easier for you to repaint the heavyweight components that fall over the coalesced area. Not only you keep the coalescing savings on repainting but you also save on the determination of what heavyweights will be clobbered (way easier to do it for a single rectangle). In rare occasions you may repaint a heavyweight unnecessarily in exchange for the paint operation saved by the coalesce heuristics, but hey, that is why it is called heuristic.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]