[Kde-games-devel] Review Request: Choose raster graphicssystem by default in all apps linking against libkdegames

Stefan Majewsky majewsky at gmx.net
Fri Oct 7 17:59:18 UTC 2011



> On Oct. 7, 2011, 6:19 a.m., Ian Wadham wrote:
> > I think this patch requires comments, in the code or CMakeLists.txt, to say what using (Qt) raster graphics will achieve, under what conditions the patch will become redundant and how the patch actually works.  I do not think many people will understand the nuances of C++ involved in it if you are no longer around someday.  IIUC it is not actually a static object, in which the keyword "static" is used throughout, but an "anonymous namespace" (whatever that implies, I am self-taught in C++).
> > 
> > Anyway, the effect is what matters most, so please ship it if you have not already done so.  Thanks for such a good idea, Stefan!

Agreed on comments. Will include some.

Re anonymous namespaces: Problem is that "static" actually does two different things in C++. (Plus I misused the term when I said "static object" where I actually meant to say "global object".) One use of "static" is to declare static class members (those shared by all instances). The other use (and the reason why "static" is also a keyword in C) is to suppress the function from being exported (that is, written into the object table). For example:

static int foo() { return 42; }

This is useful because "foo" does not pollute the application-global function namespace; it's only visible in the compilation unit. Now we have two different (and potentially interfering) usages of the "static" keyword. That's why C++ introduced the notion of anonymous namespaces: Any function or class placed in an anonymous namespace will be visible in the compilation unit like usual, but no globally visible symbols will be generated.

... Note to self: Stop using ReviewBoard like Stack Overflow.


- Stefan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/6810/#review10436
-----------------------------------------------------------


On Oct. 3, 2011, 12:11 p.m., Stefan Majewsky wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/6810/
> -----------------------------------------------------------
> 
> (Updated Oct. 3, 2011, 12:11 p.m.)
> 
> 
> Review request for KDE Games.
> 
> 
> Description
> -------
> 
> Various games already choose the raster graphicssystem manually in their main(), because it has way better rendering performance than the older X11 graphicssystem. This change implements this choice of graphicssystem in libkdegames, as a static object. For Qt 4.7, this improves the rendering performance in all games immediately, sometimes the improvement is drastical. For example, in Kolf, when the ball moves over the Kolf banner on the intro screen, the animation is very flaky with the X11 graphicssystem, but fluent with the raster graphicssystem.
> 
> As far as I remember, Qt 4.8 will choose the raster graphicssystem by default, so this patch could be removed again when we require Qt >= 4.8. This patch is mainly interesting for users of Qt 4.7 (which is why I propose to also backport this patch to 4.7.3).
> 
> 
> This addresses bug 277590.
>     https://bugs.kde.org/show_bug.cgi?id=277590
> 
> 
> Diffs
> -----
> 
>   trunk/KDE/kdegames/libkdegames/CMakeLists.txt 1257072 
>   trunk/KDE/kdegames/libkdegames/chooserastergraphicssystem.cpp PRE-CREATION 
> 
> Diff: http://svn.reviewboard.kde.org/r/6810/diff/diff
> 
> 
> Testing
> -------
> 
> Compiled Kolf against patched libkdegames and started it. Rendering performance indicates that correct graphicssystem is selected.
> 
> I have tested all of kdegames for visible regressions with "-graphicssystem raster". The only problem (in KBounce) is fixed in trunk by revision 1257154, and backported to 4.7 in revision 1257156.
> 
> 
> Thanks,
> 
> Stefan Majewsky
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20111007/eb55b994/attachment.html>


More information about the kde-games-devel mailing list