R3 Graphics overhaul

216 views
Skip to first unread message

Cyphre

unread,
Mar 7, 2013, 4:05:17 PM3/7/13
to re...@googlegroups.com
While working on the R3/Saphir (R3 fork by Saphirion) graphics code overhaul(a necessary step to make porting R3 with graphics to other platforms more flexible) I'd like to share the current high-level design and source code structure with you. Any feedback is welcome.

So this is high-level description how the system will work:

SHOW GOB -> COMPOSITOR -> DIALECT-DISPATCHER -> DIALECT-API-CALL -> GFX-BACKEND/LIB processing

Explanation:

1. SHOW GOB command calls COMPOSITOR module.
2. COMPOSITOR can do following:
2.1 Compose and render simple GOB (in cases where gob/color or gob/image is set) and finish.
2.2 Compose calls appropriate DIALECT-DISPATCHER (in cases where gob/effect, gob/draw or gob/text is set) and continue in step 3.
3. DIALECT-DISPATCHER executes commands in the dialect block. The commands are dispatched to the low-level DIALECT-API.
4. DIALECT-API calls are bound to specific gaphics backend code which is responsible for rendering appropriate result defined by the dialect command(s).
5. Finally the rendered result is composed by the COMPOSITOR code and whole sequence is finished.

Notes:

-It will be possible to have multiple COMPOSITORs based on different graphics engine (AGG, OpenGL, DirectFB, plain GDI...).
-It will be possible to have multiple sets of DIALECT-APIs based on specific graphics backend/library/code (AGG, Cairo, Skia, OpenGL...).
-The system will be designed in a way so only minimal amount of OS dependent stubs needs to be implemented for particular platform/OS.

The new source code sturcture could look like this example:

src/os/host-view.c ;base for shared OS independent 'VIEW'(ie.graphics related) code
src/os/host-draw.c ;DRAW dialect dispatcher (OS independent)
src/os/host-text.c ;TEXT dialect dispatcher (OS independent)
src/os/host-effect.c ;EFFECT dialect dispatcher (OS independent)
src/os/<platform>/host-window.c ;OS specific code related to window handling
src/os/<platform>/host-graphics.c ;OS specific code related to graphics (support for misc. 'VIEW' command!s)
src/os/<platform>/host-compositor.c ;OS/gfx-engine specific code which handled GOB tree composition (simple 'stub' version)
src/os/<platform>/host-compositor-agg.c ;OS/gfx-engine specific code which handled GOB tree composition (AGG version)
src/os/<platform>/host-compositor-ogl.c ;OS/gfx-engine specific code which handled GOB tree composition (HW accelerated OpenGL version)
src/os/<platform>/host-draw-api-agg.c ;unified dialect api functions that are called from DRAW dialect dispatcher (AGG version)
src/os/<platform>/host-draw-api-cairo.c ;unified dialect api functions that are called from DRAW dialect dispatcher (Cairo version)
src/os/<platform>/host-text-api-gdi.c ;unified dialect api functions that are called from TEXT dialect dispatcher (Windows GDI version)
src/os/<platform>/host-text-api-ft.c ;unified dialect api functions that are called from TEXT dialect dispatcher (FreeType2 lib version)
src/os/<platform>/host-effect-funcs-agg.c ;unified dialect api functions that are called from EFFECT dialect dispatcher (AGG version)
src/os/<platform>/host-effect-funcs-ogl.c ;unified dialect api functions that are called from EFFECT dialect dispatcher (OpenGL version)
...

So what do you think about this? As non-native english speaker I'd like to know especially how you like the file-naming or do you have better ideas?

Cyphre

Ladislav

unread,
Mar 8, 2013, 4:34:31 AM3/8/13
to re...@googlegroups.com
I am OK with that, but I may not be a naming expert either.

notchent

unread,
Mar 8, 2013, 8:40:43 AM3/8/13
to re...@googlegroups.com
"host-" is in every file name.  Is it required?

notchent

unread,
Mar 8, 2013, 8:45:38 AM3/8/13
to re...@googlegroups.com
Otherwise, the English words and abbreviations seem good to me.

Cyphre

unread,
Mar 8, 2013, 11:05:42 AM3/8/13
to re...@googlegroups.com
Well, the host- prefix is convention used in the whole R3 host code part so we are stick to it. Anyway, thanks for your feedback.
Reply all
Reply to author
Forward
0 new messages