[gs-devel] Re: beginpage and the vector device

Ralph Giles ralph.giles at artifex.com
Fri Nov 2 11:02:45 PDT 2007

On Fri, Nov 02, 2007 at 09:06:02AM +0000, Ken Sharp wrote:

> I'm hoping Lenoardo will be in on this too, I haven't had any exposure to 
> the area you're discussing here yet, so I'm going to be guessing a bit...

Yes. I'm not sure when we was leaving; perhaps we should all discuss it 
briefly at the meeting.

> To do this you either need to put the 'start of a page?' test somewhere 
> nice and central, guaranteed to be called at every important point, or you 
> need every operation which writes to the stream to do the test instead.

My main complaint was that the check is being done by the subclass, when 
the dispatch is in the superclass, which is messy. And more confusing I 
think than Ray's suggestion, which could at least be properly 
encapsulated. It's clearly an internal optimization, and not an 
abstraction-merging one.

I agree the first-mark test should stay in the high-level device 
machinery and not be promoted further up the drawing chain.

So how about this:

* Move the current check for in_page entirely into gdevvec.c.
* Benchmark the effect on pdfwrite, pswrite and pxl devices.
* If there's a noticable slowdown, implement Ray's optization.


More information about the gs-devel mailing list