[cairo] Fwd: cairo_paint() with GPU Buffer

Uli Schlachter psychon at znc.in
Mon Feb 11 08:07:11 UTC 2019


Hi,

On 11.02.19 08:11, Abimathi Natarajan wrote:
[...]
>          The above command will decode the input file (input.mp4) with
> hardware accelerations(vaapi) and hwmap will directly map the hardware
>          frames to system memory.
[...]
>    - I will directly feed this memory to
> 
>                 cairo_image_surface_create_for_data ((unsigned char
> *)buffer, CAIRO_FORMAT_ARGB32,width, height, stride) to create a
> cairo_surface for the given frame.

>From the information you provided, I can only make a guess. My guess is
that CPU access to the buffer in GPU memory is uncached and thus slow.

You could try copying the image to a buffer in main memory and using
that copy for cairo_image_surface_create_for_data(). That way
cairo/pixman get to operate on cached memory.

Cheers,
Uli
-- 
"Are you preparing for another war, Plutarch?" I ask.
"Oh, not now. Now we're in that sweet period where
everyone agrees that our recent horrors should never
be repeated," he says.


More information about the cairo mailing list