[cairo] Using Cairo GL surface as the main surface and supply cairo_image_surface as pattern won't work
Henry (Yu) Song
henry.song at samsung.com
Fri Aug 14 09:27:10 PDT 2015
Maybe send your sample code to me? By the way which branch do you use. 1.14.2-rebase-wip is the latest branch based on 1.14.2. Your code might have a major performance problem. If your app requires fill those multiple image surfaces to gl surface for every frame, the performance will be terrible.
> On Aug 14, 2015, at 8:20 AM, Chunlin Ye <pepsin at me.com> wrote:
>
> I am tweaking an Cairo app on Android, and using the https://github.com/SRA-SiliconValley/cairogles as the GL based cairo.
>
> For now I use cairo_gl_surface_create_for_egl to create an gl surface, call it Prime Surface, and my app create multiple layer of cairo_image_surface which created by cairo_image_surface_create_for_data and using them as pattern to draw onto the Prime Surface.
>
> The drawing code are something like:
>
> cairo_pattern_t *pattern = cairo_pattern_create_for_surface(r->surface);
> int surfaceWidth = cairo_image_surface_get_width(r->surface);
> int surfaceHeight = cairo_image_surface_get_height(r->surface);
> cairo_rectangle(cr, 0, 0, surfaceWidth, surfaceHeight);
> cairo_set_source(cr, pattern);
> cairo_fill(cr);
>
> but this do not work. I also tried:
>
> cairo_set_source_surface(cr, image_surface, 0, 0);
> cairo_paint(cr);
>
>
> don’t work too.
>
> Do anybody know what causing this problem?
>
>
>
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
More information about the cairo
mailing list