gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: supportsDrawGState


From: Fred Kiefer
Subject: Re: supportsDrawGState
Date: Mon, 13 Jun 2011 21:37:31 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.17) Gecko/20110414 SUSE/3.1.10 Thunderbird/3.1.10

On 13.06.2011 20:19, Quentin Mathé wrote:
Le 13 juin 2011 à 14:41, Fred Kiefer a écrit :

I had to restrict the usage of the new image drawing mechanism for
the cairo backend to the cases where the clipping region is
representable as a list of rectangles. With the new drawing code we
store and restore the GState and this only works correctly when the
clipping region is composed of rectangles.

I don't see where the gstate is saved/restored in the new drawing
code and not in the old code path. I checked both Back and  Gui.
Which lines are you referring to precisely? In Back cairo_save() and
cairo_restore() seems to be used in both cases. On the Gui side,
PSgsave(), DPSgsave(), PSgrestore() or DPSgrestore() seems to be used
in the same way in the two drawing methods.

The problem became obvious in the JigSaw Application which is now
part of GAP and which does use non-rectangular shapes for its
pieces. These pieces where drawn incorrectly with the new drawing
mechanism but correctly with the old one.

Are they drawn correctly on Mac OS X?

I would love to see a better solution for this, so feel free to
suggest one.

Agreed :-)

Quentin,

I would have expected a little trust in my analysis here :-)
But anyway you are free to ask and not just take my word for it. The
difference is between the methods guiDrawInRect:... and
nativeDrawInRect:... If you carefully count the PSgsave calls you will
see that each has exactly one in each call path. The difference is that
in guiDrawInRect:.. the save happens while drawing on the cache surface
whereas for nativeDrawInRect:.. we use the save while drawing on the
main surface. This may look only slightly different but changed the whole thing.

The annoying bit here is that we now know that we have a general problem. For this image drawing issue I was able to resolve it, but if somebody manually sets a non rectangular clip and than uses PSsave we are in trouble.

Fred



reply via email to

[Prev in Thread] Current Thread [Next in Thread]