Abort glyph rendering if everything is clipped

Alexandre Julliard julliard at winehq.org
Wed Oct 8 12:46:30 CDT 2003

Warren_Baird at cimmetry.com writes:

> Well, it was intended as an optimization - if we move the check down to the "if
> (flags & (ETO_CLIPPED) ..." clause, we may end up doing a HeapAlloc, and calls
> to GetGlyphIndices and GetObject that we don't need to do.  I'd much rather bail
> out as soon as we can and avoid doing all of that extra work...

But then you are doing extra work for the "normal" case, and you are
also making the code less readable; not a good trade-off IMO. You
could always move the whole clipping rectangle stuff to avoid the
HeapAlloc (which would also fix a memory leak in the existing code...)
if you prefer. But I think keeping that code readable is more
important than wringing every last nanosecond of the empty clip
rectangle case.

Alexandre Julliard
julliard at winehq.com

More information about the wine-devel mailing list