Hi, On Thu, May 18, 2017 at 03:24:52PM +0200, Christophe de Dinechin wrote: > From: Christophe de Dinechin <dinechin@xxxxxxxxxx> > > Signed-off-by: Christophe de Dinechin <dinechin@xxxxxxxxxx> Acked-by: Victor Toso <victortoso@xxxxxxxxxx> (Frediano acked too) > --- > common/mem.h | 3 +- > common/sw_canvas.c | 131 ++++++++++++++++++++++++++--------------------------- > 2 files changed, 64 insertions(+), 70 deletions(-) > > diff --git a/common/mem.h b/common/mem.h > index 857e8b0..cf24d0a 100644 > --- a/common/mem.h > +++ b/common/mem.h > @@ -116,7 +116,7 @@ size_t spice_strnlen(const char *str, size_t max_len); > __p; \ > })) > # define _SPICE_RENEW(struct_type, mem, n_structs, func) \ > - (struct_type *) (__extension__ ({ \ > + (struct_type *) (__extension__ ({ \ > size_t __n = (size_t) (n_structs); \ > size_t __s = sizeof (struct_type); \ > void *__p = (void *) (mem); \ > @@ -132,7 +132,6 @@ size_t spice_strnlen(const char *str, size_t max_len); > #else > > /* Unoptimized version: always call the _n() function. */ > - > #define _SPICE_NEW(struct_type, n_structs, func) \ > ((struct_type *) spice_##func##_n ((n_structs), sizeof (struct_type))) > #define _SPICE_RENEW(struct_type, mem, n_structs, func) \ > diff --git a/common/sw_canvas.c b/common/sw_canvas.c > index 959421f..f9bd99c 100644 > --- a/common/sw_canvas.c > +++ b/common/sw_canvas.c > @@ -88,7 +88,7 @@ static pixman_image_t *get_image(SpiceCanvas *canvas, int force_opaque) > SwCanvas *sw_canvas = (SwCanvas *)canvas; > pixman_format_code_t format; > > - spice_pixman_image_get_format (sw_canvas->image, &format); > + spice_pixman_image_get_format(sw_canvas->image, &format); > if (force_opaque && PIXMAN_FORMAT_A (format) != 0) { > uint32_t *data; > int stride; > @@ -96,11 +96,11 @@ static pixman_image_t *get_image(SpiceCanvas *canvas, int force_opaque) > > /* Remove alpha bits from format */ > format = (pixman_format_code_t)(((uint32_t)format) & ~(0xf << 12)); > - data = pixman_image_get_data (sw_canvas->image); > - stride = pixman_image_get_stride (sw_canvas->image); > - width = pixman_image_get_width (sw_canvas->image); > - height = pixman_image_get_height (sw_canvas->image); > - return pixman_image_create_bits (format, width, height, data, stride); > + data = pixman_image_get_data(sw_canvas->image); > + stride = pixman_image_get_stride(sw_canvas->image); > + width = pixman_image_get_width(sw_canvas->image); > + height = pixman_image_get_height(sw_canvas->image); > + return pixman_image_create_bits(format, width, height, data, stride); > } else { > pixman_image_ref(sw_canvas->image); > } > @@ -484,8 +484,8 @@ static void __scale_image(SpiceCanvas *spice_canvas, > > pixman_transform_init_scale(&transform, fsx, fsy); > pixman_transform_translate(&transform, NULL, > - pixman_int_to_fixed (src_x), > - pixman_int_to_fixed (src_y)); > + pixman_int_to_fixed(src_x), > + pixman_int_to_fixed(src_y)); > > pixman_image_set_transform(src, &transform); > pixman_image_set_repeat(src, PIXMAN_REPEAT_NONE); > @@ -567,8 +567,8 @@ static void __scale_image_rop(SpiceCanvas *spice_canvas, > > pixman_transform_init_scale(&transform, fsx, fsy); > pixman_transform_translate(&transform, NULL, > - pixman_int_to_fixed (src_x), > - pixman_int_to_fixed (src_y)); > + pixman_int_to_fixed(src_x), > + pixman_int_to_fixed(src_y)); > > pixman_image_set_transform(src, &transform); > pixman_image_set_repeat(src, PIXMAN_REPEAT_NONE); > @@ -761,8 +761,8 @@ static void __blend_scale_image(SpiceCanvas *spice_canvas, > > pixman_transform_init_scale(&transform, fsx, fsy); > pixman_transform_translate(&transform, NULL, > - pixman_int_to_fixed (src_x), > - pixman_int_to_fixed (src_y)); > + pixman_int_to_fixed(src_x), > + pixman_int_to_fixed(src_y)); > > mask = NULL; > if (overall_alpha != 0xff) { > @@ -925,8 +925,8 @@ static void __colorkey_scale_image(SpiceCanvas *spice_canvas, > > pixman_transform_init_scale(&transform, fsx, fsy); > pixman_transform_translate(&transform, NULL, > - pixman_int_to_fixed (src_x), > - pixman_int_to_fixed (src_y)); > + pixman_int_to_fixed(src_x), > + pixman_int_to_fixed(src_y)); > > pixman_image_set_transform(src, &transform); > pixman_image_set_repeat(src, PIXMAN_REPEAT_NONE); > @@ -1189,36 +1189,34 @@ static void canvas_destroy(SpiceCanvas *spice_canvas) > static SpiceCanvasOps sw_canvas_ops; > > static SpiceCanvas *canvas_create_common(pixman_image_t *image, > - uint32_t format > - , SpiceImageCache *bits_cache > + uint32_t format, > + SpiceImageCache *bits_cache, > #ifdef SW_CANVAS_CACHE > - , SpicePaletteCache *palette_cache > + SpicePaletteCache *palette_cache, > #endif > - , SpiceImageSurfaces *surfaces > - , SpiceGlzDecoder *glz_decoder > - , SpiceJpegDecoder *jpeg_decoder > - , SpiceZlibDecoder *zlib_decoder > - ) > + SpiceImageSurfaces *surfaces, > + SpiceGlzDecoder *glz_decoder, > + SpiceJpegDecoder *jpeg_decoder, > + SpiceZlibDecoder *zlib_decoder) > { > SwCanvas *canvas; > > spice_pixman_image_set_format(image, > - spice_surface_format_to_pixman (format)); > + spice_surface_format_to_pixman(format)); > > canvas = spice_new0(SwCanvas, 1); > canvas_base_init(&canvas->base, &sw_canvas_ops, > - pixman_image_get_width (image), > - pixman_image_get_height (image), > - format > - , bits_cache > + pixman_image_get_width(image), > + pixman_image_get_height(image), > + format, > + bits_cache, > #ifdef SW_CANVAS_CACHE > - , palette_cache > + palette_cache, > #endif > - , surfaces > - , glz_decoder > - , jpeg_decoder > - , zlib_decoder > - ); > + surfaces, > + glz_decoder, > + jpeg_decoder, > + zlib_decoder); > canvas->private_data = NULL; > canvas->private_data_size = 0; > > @@ -1227,61 +1225,58 @@ static SpiceCanvas *canvas_create_common(pixman_image_t *image, > return (SpiceCanvas *)canvas; > } > > -SpiceCanvas *canvas_create(int width, int height, uint32_t format > - , SpiceImageCache *bits_cache > +SpiceCanvas *canvas_create(int width, int height, uint32_t format, > + SpiceImageCache *bits_cache, > #ifdef SW_CANVAS_CACHE > - , SpicePaletteCache *palette_cache > + SpicePaletteCache *palette_cache, > #endif > - , SpiceImageSurfaces *surfaces > - , SpiceGlzDecoder *glz_decoder > - , SpiceJpegDecoder *jpeg_decoder > - , SpiceZlibDecoder *zlib_decoder > - ) > + SpiceImageSurfaces *surfaces, > + SpiceGlzDecoder *glz_decoder, > + SpiceJpegDecoder *jpeg_decoder, > + SpiceZlibDecoder *zlib_decoder) > { > pixman_image_t *image; > > - image = pixman_image_create_bits(spice_surface_format_to_pixman (format), > + image = pixman_image_create_bits(spice_surface_format_to_pixman(format), > width, height, NULL, 0); > > - return canvas_create_common(image, format > - , bits_cache > + return canvas_create_common(image, format, > + bits_cache, > #ifdef SW_CANVAS_CACHE > - , palette_cache > + palette_cache, > #endif > - , surfaces > - , glz_decoder > - , jpeg_decoder > - , zlib_decoder > - ); > + surfaces, > + glz_decoder, > + jpeg_decoder, > + zlib_decoder); > } > > SpiceCanvas *canvas_create_for_data(int width, int height, uint32_t format, > - uint8_t *data, int stride > - , SpiceImageCache *bits_cache > + uint8_t *data, int stride, > + SpiceImageCache *bits_cache, > #ifdef SW_CANVAS_CACHE > - , SpicePaletteCache *palette_cache > + SpicePaletteCache *palette_cache, > #endif > - , SpiceImageSurfaces *surfaces > - , SpiceGlzDecoder *glz_decoder > - , SpiceJpegDecoder *jpeg_decoder > - , SpiceZlibDecoder *zlib_decoder > - ) > + SpiceImageSurfaces *surfaces, > + SpiceGlzDecoder *glz_decoder, > + SpiceJpegDecoder *jpeg_decoder, > + SpiceZlibDecoder *zlib_decoder) > { > pixman_image_t *image; > > - image = pixman_image_create_bits(spice_surface_format_to_pixman (format), > - width, height, (uint32_t *)data, stride); > > - return canvas_create_common(image, format > - , bits_cache > + image = pixman_image_create_bits(spice_surface_format_to_pixman(format), > + width, height, (uint32 *) data, stride); > + > + return canvas_create_common(image, format, > + bits_cache, > #ifdef SW_CANVAS_CACHE > - , palette_cache > + palette_cache, > #endif > - , surfaces > - , glz_decoder > - , jpeg_decoder > - , zlib_decoder > - ); > + surfaces, > + glz_decoder, > + jpeg_decoder, > + zlib_decoder); > } > > SPICE_CONSTRUCTOR_FUNC(sw_canvas_global_init) //unsafe global function > -- > 2.11.0 (Apple Git-81) > > _______________________________________________ > Spice-devel mailing list > Spice-devel@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/spice-devel
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel