Hello,<br><div class="gmail_quote">
<br>
Anybody can help me with directfb backend ? The git version of cairographics I get an infinite loop. I would like to know what I have to do. See the code below ... this example <span>with directfb+cairo </span>doesn't work..<br>


<br>
// g++ simple.cpp `pkg-config --cflags --libs directfb <span>cairo</span>`<br>
// -------------------------- simple.cpp ------------------------------------<br><div>
#include <stdio.h><br>
#include <unistd.h><br>
<br>
#include <directfb.h><br>
#include <<span>cairo</span>-directfb.h><br>
<br>
static int screen_width  = 0;<br>
static int screen_height = 0;<br>
<br>
int main (int argc, char **argv)<br>
{<br>
    // init dfb<br>
    IDirectFB *dfb = NULL;<br>
    IDirectFBDisplayLayer  *layer = NULL;<br>
    DFBSurfaceDescription dsc;<br>
    DFBDisplayLayerConfig  layer_dsc;<br>
<br>
    DirectFBInit (&argc, &argv);<br>
  DirectFBCreate (&dfb);<br>
<br>
    dfb->GetDisplayLayer (dfb, DLID_PRIMARY, &layer);<br>
    layer->SetCooperativeLevel (layer, DLSCL_ADMINISTRATIVE);<br>
<br>
    layer_dsc.flags = DLCONF_BUFFERMODE;<br>
    layer_dsc.buffermode = DLBM_BACKSYSTEM;<br>
    layer->SetConfiguration (layer, &layer_dsc);<br>
<br>
    // create window<br>
    IDirectFBWindow *window = NULL;<br>
    IDirectFBSurface *surface = NULL;<br>
    DFBWindowDescription desc;<br>
<br>
    desc.flags  = (DFBWindowDescriptionFlags)(DWDESC_POSX | DWDESC_POSY |<br>
DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS | DWDESC_PIXELFORMAT);<br>
    desc.caps = (DFBWindowCapabilities)(DSCAPS_NONE | DWCAPS_ALPHACHANNEL);<br>
    desc.pixelformat = DSPF_ARGB;<br>
    desc.posx = 0;<br>
    desc.posy = 0;<br>
    desc.width  = 720;<br>
    desc.height = 480;<br>
<br>
    layer->CreateWindow (layer, &desc, &window);<br>
    window->SetOpacity (window, 0xFF);<br>
    window->GetSurface (window, &surface);<br>
<br>
    // drawing<br>
  surface->SetColor (surface, 0x40, 0x60, 0x80, 0xff);<br>
  surface->FillRectangle (surface, 0, 0, screen_width, screen_height);<br>
  surface->SetColor (surface, 0x80, 0x80, 0xff, 0xff);<br>
  surface->DrawLine (surface, 0, screen_height / 2, screen_width - 1,<br>
screen_height / 2);<br>
  surface->SetColor (surface, 0x00, 0x00, 0xff, 0xa0);<br>
  surface->FillRectangle (surface, 100, 100, 300, 300);<br>
  surface->SetColor (surface, 0x80, 0x00, 0x00, 0xa0);<br>
  surface->FillRectangle (surface, 200, 200, 300, 300);<br>
<br>
    surface->Flip (surface, NULL, (DFBSurfaceFlipFlags)0);<br>
<br>
    cairo_surface_t *cairo_surface;<br>
    cairo_t *cairo_context;<br>
<br>
    cairo_surface = cairo_directfb_surface_create(dfb, surface);<br>
    cairo_context = cairo_create(cairo_surface);<br>
<br>
    cairo_set_source_rgba(cairo_context, 0x80/255.0, 0x80/255.0,<br>
0x80/255.0, 0xff/255.0);<br>
    cairo_rectangle(cairo_context, 150, 150, 300, 300);<br>
  cairo_fill(cairo_context);<br>
<br>
    cairo_destroy(cairo_context);<br>
    cairo_surface_destroy(cairo_surface);<br>
<br>
  sleep (5);<br>
<br>
    // release<br>
  surface->Release( surface );<br>
  dfb->Release( dfb );<br>
<br>
  return 23;<br>
}<br>
// ---------------------------------------- end</div><br><br><br>:: GDB ::<br><br>#0  0xb7e3a5ef in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:630<br>#1  0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#2  0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#3  0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#4  0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#5  0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#6  0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#7  0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#8  0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#9  0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#10 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#11 0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#12 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#13 0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#14 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#15 0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#16 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#17 0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#18 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#19 0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#20 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#21 0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#22 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#23 0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#24 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#25 0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#26 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#27 0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#28 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#29 0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#30 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>#31 0xb7e77298 in _cairo_dfb_surface_map_to_image (abstract_surface=0x808de90, extents=0xbfffecf8) at cairo-directfb-surface.c:200<br>

#32 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>...<br>#2048 0xb7e77298 in _cairo_dfb_surface_map_to_image 
(abstract_surface=0x808de90, extents=0xbfffecf8) at 
cairo-directfb-surface.c:200<br>
#2049 0xb7e3a618 in _cairo_surface_map_to_image (surface=0x808de90, extents=0xbfffecf8) at cairo-surface.c:637<br>
...<br><br clear="all">Best regards.<span class="HOEnZb"><font color="#888888"><br><br>-- <br>Jefferson Ferreira<br>
</font></span></div>