← Back to team overview

kicad-developers team mailing list archive

Re: GAL edit merges


Hi Dick,

On 04.11.2011 18:38, Dick Hollenbeck wrote:
Hi Torsten,

Some concerns about GAL:

1) what would be the cost of doing OPENGL_GAL::DrawGrid()
using the GAL API itself?  (This would be better "self promotion", than using the opengl
API, or cairo API, and would let this function be moved up into GAL itself.)

I believe I've implemented it this way, because I draw the lines in screen coordinates and I can use faster drawing methods rather than using the universal DrawLine(..) method. But I'll check if that could be unified for Cairo/OpenGL.

2) To best capitalize on the hardware acceleration, I wonder if we should not separate the
generation of the opengl display lists, from actually repainting them on the screen.
This means *two* functions, something like this:

a) The scene has changed, create new opengl display lists.

b) The on screen wxWindow containing a GAL has been resized or uncovered, simply use
existing opengl display lists and ask opengl to put them on screen.

This separation is what is being done in the existing 3d-viewer logic.    The board is
only scanned one time to generate the display lists, and in the 3d-viewer of course the
board never changes, so this separation of list generation and screen update becomes a big
performance win.

I have yet to find this separation 2) in the GAL.

You can do this already with the group methods.

BeginGroup() starts a new group, EndGroup() finishes the group - and you can simply draw the recorded graphics elements with DrawGroup(). For OpenGL basically a display list is created; for Cairo I'm using a deque and a simple state machine (later Cairo versions have now already a group function, I'll use that in the next versions).

Have a look at the group example in the test folder.


Follow ups