[cairo] PNG surface not showing on EGL/GLES2

Tarnyko tarnyko at tarnyko.net
Fri Sep 20 02:03:42 PDT 2013


Hi folks, 

I'm currently testing Cairo on Wayland using only native technologies (no 
GLX/GL/XWayland, only EGL/GLES2). 

I wrote the following sample code, which compiles and runs fine with Wayland 
1.2 : 

http://pastebin.com/jqXViEST 


Problem is : on the screen, only the red rectangle shows. The PNG image, 
which is supposed to be blitted and displayed too, is never shown. 

So basically the following section works : 

     cairo_set_source_rgb (cr, 1, 0, 0);
     cairo_rectangle (cr, 0, 0, 320, 240);
     cairo_fill (cr); 

but the other one doesn't : 

      cairo_surface_t *image;
      image = cairo_image_surface_create_from_png ("monimage.png");
      cairo_set_source_surface (cr, image, 0, 0);
      cairo_paint (cr); 

I have a very similar code working on Android using native ImageSurfaces. 

So, what's the problem ? A bug, a mistake I made, or maybe the feature is 
not present using GL backend ? 

Thanks for your time. 

Regards,
Tarnyko


More information about the cairo mailing list