← Back to team overview

kicad-developers team mailing list archive

Re: GerbView GAL port

 

Le 14/02/2017 à 19:38, Jon Evans a écrit :
> Hi all,
> 
> I want to get familiar with the GAL codebase, and it occurred to me that it might be fun to play
> with porting GerbView to GAL.  I know it is on the 6.x roadmap, but it seemed to me that it would be
> mostly not dependent on any other changes that I see on the roadmap or have seen people talking
> about on the mailing list.
> 
> - Is anyone currently working on this?
> 
> - Does anyone think it would be a bad idea for me to start working on this now?
> 
> - If a GAL port is "feature-complete", is there any reason for the app to retain the legacy graphics
> code, or can it just provide OpenGL and Cairo backends?  My impression is the only think keeping
> legacy canvas in pcbnew is feature differences between legacy and GAL, but I wanted to check if
> there are other reasons.
> 
> - In my first hour of looking at the code for this, it seems like the GAL code currently has some
> interdependence with pcbnew that needs to be straightened out before using GAL in other
> applications.  For example, EDA_DRAW_PANEL_GAL depends on PCB_PAINTER, not a generic PAINTER.  Is
> this an open problem for anyone to tackle, or does anyone actively have plans to refactor this?
> 
> Best,
> Jon

Hi Jon,

I don't think there is a work in progress on this.

To answer to these questions:

Our "GAL" covers 2 very different things:
* The new GAL canvas using currently OpenGL and Cairo backends.
* A new way to handle events from menus.

I am talking here only of the GAL canvas.
Currently, the GAL port is not a "feature-complete".
It is missing the current wxDC backend.
It was planned, but I am thinking it is not really started (At least I am not aware of).
(I just wrote a very minimal stub (basic_gal.h) to use in legacy canvas a few methods from GAL
canvas to draw/plot a text.
This is made to avoid duplicate code, and different rendering of texts)

If the current legacy drawing code is removed, the wxDC backend is needed for the printing system,
which uses the wxDC.

Now, OpenGL and Cairo backends are powerful and fast.

Note also the "legacy" wxDC works fine on wxGTK built with GTK2, but does not work if wxGTK is built
with GTK3 (I am guessing under GTK3, the wxDC graphic layer is Cairo, and some of graphic operations
(OR, XOR) used in Kicad are no longer available).

So, in short, porting GerbView to GAL canvas is very important, because one day our current wxDC
will be not available.

However, Gerbview should be not depending on any Pcbnew code, especially PCB_PAINTER.
Note also Gerbview has very few menus events handlers.

-- 
Jean-Pierre CHARRAS


References