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

Re: [MiNT] VDI clipping



> I'm currently improving font rendering within netsurf a bit... I want to
> make the drawing faster, at least for font renderer which support monochrom
> glyphs.
> My question is: should I calculate clippings for each character myself, or

Am I correct in interpreting this to mean that you do not use the VDI
text routines, but rather something internal to Netsurf?

> should i just let VDI do the job? As I said, this will be called for each
> and every character...

Are these actual VDI characters or simply monochrome bitmaps?

> but doing the clipping myself takes at least 3 calls to rc_intersect and
> some grect x = grect y etc.
> From the pure source code point of view vs_clip is a lot less to do... but I
> don't know how much overhead it introduces. First: is the call expensive (
> traps involved...)?

vs_clip is a VDI function and thus uses a Trap. However, you would
normally not be calling it very often, since the same clip rectangle
usually applies to many drawing calls.
Do you have any special reason for calling it often?

> Second: How expensive is clipping during the raster operation?

That would of course depend on the VDI and display driver you're
using, but in general I would expect a monochrome bitmap clip (which I
assume we are talking about here) to be quite cheap. No VDI is likely
to do the clipping on a pixel by pixel basis.

It sounds like you're talking about blitting every single character to
the screen separately. If that is so, you should definitely try to do
something about that, since there will be a lot of overhead (except
for very large characters ;-).
When drawing text, both NVDI and fVDI normally build an internal
monochrome bitmap of the whole string before blitting that to the
screen in one go.

/Johan