cogl-texture: Share the common code in the set_region virtual
There was a lot of common code that was copied to all of the backends to convert the data to a suitable format and wrap it into a CoglBitmap so that it can be passed to _cogl_texture_driver_upload_subregion_to_gl. This patch moves the common code to cogl-texture.c so that the virtual just takes a CoglBitmap that is already in the right format.
This commit is contained in:
@ -406,23 +406,16 @@ _cogl_sub_texture_set_region (CoglTexture *tex,
|
||||
int dst_y,
|
||||
unsigned int dst_width,
|
||||
unsigned int dst_height,
|
||||
int width,
|
||||
int height,
|
||||
CoglPixelFormat format,
|
||||
unsigned int rowstride,
|
||||
const guint8 *data)
|
||||
CoglBitmap *bmp)
|
||||
{
|
||||
CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);
|
||||
|
||||
return cogl_texture_set_region (sub_tex->full_texture,
|
||||
src_x, src_y,
|
||||
dst_x + sub_tex->sub_x,
|
||||
dst_y + sub_tex->sub_y,
|
||||
dst_width, dst_height,
|
||||
width, height,
|
||||
format,
|
||||
rowstride,
|
||||
data);
|
||||
return _cogl_texture_set_region_from_bitmap (sub_tex->full_texture,
|
||||
src_x, src_y,
|
||||
dst_x + sub_tex->sub_x,
|
||||
dst_y + sub_tex->sub_y,
|
||||
dst_width, dst_height,
|
||||
bmp);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user