Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2005:
[Freeciv-Dev] Re: (PR#11791) SGL software 2D drawing
Home

[Freeciv-Dev] Re: (PR#11791) SGL software 2D drawing

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#11791) SGL software 2D drawing
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Tue, 4 Jan 2005 14:33:07 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11791 >

On Tue, 4 Jan 2005, John Bauman wrote:
> From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
> > This patch changes the gtk-2.0 client to use our own software rendering
> > code, more or less based on SDL code. For now only 'trident' will
> > work more or less properly, a lot of things are broken. But the main
> > map should display most things.
>
> Would you mind reminding me why we're doing this? Won't this be a lot slower? 
> It
> still needs a lot of work to get to the same level as the current code.  What
> advantages will this have?

Well, for one, the previous code did not allow alpha-blending (although
Jason's changes should allow it now). For another, this code actually is
faster than using X11 for the off-screen drawing, which is most of the
drawing activity. Here are some benchmark results I got here:

GDK-PIXMAP OFF-SCREEN:      5.37 secs;   335.29 Mpixels/sec
GDK-PIXMAP ON-SCREEN:      10.78 secs;   148.46 Mpixels/sec
GDK-PIXBUF OFF-SCREEN:      4.52 secs;   397.90 Mpixels/sec
GDK-PIXBUF ON-SCREEN:      15.90 secs;   100.62 Mpixels/sec
SGL-IMAGE OFF-SCREEN:       2.08 secs;   863.39 Mpixels/sec
SGL-IMAGE ON-SCREEN 1a:    14.72 secs;   108.71 Mpixels/sec
SGL-IMAGE ON-SCREEN 1b:    14.71 secs;   108.74 Mpixels/sec
SGL-IMAGE ON-SCREEN 2:     12.81 secs;   124.90 Mpixels/sec

The provided SGL patch uses SGL-IMAGE OFF-SCREEN and
SGL-IMAGE ON-SCREEN 1a. The old code used GDK-PIXMAP OFF-SCREEN and
GDK-PIXMAP ON-SCREEN. Jason's patch makes the old code path
even slower when using the new style fog.

As you can see, SGL-IMAGE OFF-SCREEN beats GDK-PIXMAP OFF-SCREEN handily,
so the off-screen process of drawing the map should be much faster. The
copies from the off-screen buffers to the on-screen window will be slower,
since it is necessary to move data from X11 client space to X11 server
space, but these should be much less important than off-screen drawing.

The basic software drawing code is quite portable ANSI C99, so this code
can be reused for the other clients in the future.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa





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