[cairo] [patch] gl: create BGRA texture and avoid conversion

Henry (Yu) Song - SISA hsong at sisa.samsung.com
Fri Feb 1 08:55:59 PST 2013

Hi, Chris

Thanks a lot on this

From: cairo-bounces+henry.song=samsung.com at cairographics.org [cairo-bounces+henry.song=samsung.com at cairographics.org] on behalf of Chris Wilson [chris at chris-wilson.co.uk]
Sent: Friday, February 01, 2013 8:37 AM
To: Henry (Yu) Song - SISA
Cc: cairo at cairographics.org
Subject: Re: [cairo] [patch] gl: create BGRA texture and avoid conversion

On Fri, Feb 01, 2013 at 04:10:40PM +0000, Henry (Yu) Song - SISA wrote:
> Hi, Chris
> Thanks for comments. First patch - add _cairo_image_surface_coerce_to_pixman_format().

And as you discovered, not quite what you needed for your task. So I've

t c391093f40472c2300f38d0e5857858f85586b60
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Feb 1 16:31:49 2013 +0000

    image: Add a convenience function for creating an image from another's data

    The GL backend would like to extract a rectangle from another surface
    and convert it to a different pixel format. The
    _cairo_image_surface_create_from_image() does that by returning a new
    image that has the contents of the specified rectangle in the source

Which provides

cairo_image_surface_t *
_cairo_image_surface_create_from_image (cairo_image_surface_t *other,
                                       pixman_format_code_t format,
                                       int x, int y,
                                       int width, int height, int stride);

for you to use.

Hope this helps,

Chris Wilson, Intel Open Source Technology Centre
cairo mailing list
cairo at cairographics.org

More information about the cairo mailing list