Mobile/DFBPorting: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 31: Line 31:
==== Proposed Porting Approach ====
==== Proposed Porting Approach ====


* Clone gfxXlibSurface for DirectFB as gfxDfbSurface
* Clone gfxXlibSurface to gfxGdkCairoSurface
* Callers of gfxSlibSurface will call gfxDfbSurface for DFB case and gfxXlibSurface for X11 case, under appropriate compiler switches.
* Callers of gfxXlibSurface will now call gfxGdkCairoSurface.
* Use cairo_directfb_surface_create() to create cairo surfaces. DFB Native surface associated with the GdkDrawable will be used to create cairo surface. Following is the code:
* gfxGdkCairoSurface implementation calls Xlib specific functions under MOZ_X11 switch and calls DirectFB specific functions under MOZ_DFB switch.
 
* This approach will abstract out all backend specific functions and move them to a single place
    #include "gdk/gdkprivate-directfb.h"
* Users of gfxXlibSurface to create cairo surface for a GdkWindow will simply call gfxGdkCairoSurface with GdkDrawable
 
* Users of gfxXlibSurface to create cairo surface for an offscreen buffer (pixmap) will undergo some changes:
    gfxDfbSurface::gfxDfbSurface (GdkDrawable * drawable)
** A gdk pixmap of required depth will be created and corresponding GdkDrawable will be passed to gfxGdkCairoSurface for creating cairo surface
    {
** All other x11 dependent code (checking for xrender extension etc) will be removed as gfxGdkCairoSurface will take care of all required functionality .
        /* TODO */
* The actual cairo-xlib surface creation will use GdkDrawable's depth to call correct cairo_xlib functions:
    }
** cairo_xlib_surface_create() will be called if the GdkDrawable has non-NULL visual
** else: cairo_xlib_surface_create_for_bitmap() will be called if the depth is 1
** else : cairo_xlib_surface_create_with_xrender_format() will be called
* The actual cairo-dfb surface creation will use type of GdkDrawable (Window or pixmap) to call correct cairo-dfb functions
** cairo_directfb_surface_create() will be called with the DFB Surface returned from gdk_directfb_surface_lookup (), if the GdkDrawable is a Window
** cairo_directfb_surface_create() will be called with a newly created DFB Surface. The new DFB Surface will be created using CreateSurface() with the GdkDrawable's depth mapped to DFB pixel format.


=== NativeRenderer ===
=== NativeRenderer ===

Navigation menu