mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-08-16 05:23:30 +00:00
canvas: Remove dc fields from CanvasBase and LzDecodeUsrData
Now always NULL. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
b0f1d31dd1
commit
3bf6e7b899
@ -132,9 +132,6 @@ typedef struct CanvasBase {
|
||||
#ifdef SW_CANVAS_CACHE
|
||||
SpicePaletteCache *palette_cache;
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
HDC dc;
|
||||
#endif
|
||||
|
||||
SpiceImageSurfaces *surfaces;
|
||||
|
||||
@ -623,9 +620,6 @@ static pixman_image_t *canvas_get_jpeg_alpha(CanvasBase *canvas, SpiceImage *ima
|
||||
alpha_top_down = TRUE;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
lz_data->decode_data.dc = canvas->dc;
|
||||
#endif
|
||||
surface = alloc_lz_image_surface(&lz_data->decode_data, PIXMAN_LE_a8r8g8b8,
|
||||
width, height, width*height, alpha_top_down);
|
||||
|
||||
@ -840,10 +834,6 @@ static pixman_image_t *canvas_get_lz(CanvasBase *canvas, SpiceImage *image,
|
||||
spice_return_val_if_fail((unsigned)height == image->descriptor.height, NULL);
|
||||
|
||||
spice_return_val_if_fail((image->descriptor.type == SPICE_IMAGE_TYPE_LZ_PLT) || (n_comp_pixels == width * height), NULL);
|
||||
#ifdef WIN32
|
||||
lz_data->decode_data.dc = canvas->dc;
|
||||
#endif
|
||||
|
||||
|
||||
alloc_lz_image_surface(&lz_data->decode_data, pixman_format,
|
||||
width, height, n_comp_pixels, top_down);
|
||||
@ -886,9 +876,6 @@ static pixman_image_t *canvas_get_glz(CanvasBase *canvas, SpiceImage *image,
|
||||
int want_original)
|
||||
{
|
||||
spice_return_val_if_fail(image->descriptor.type == SPICE_IMAGE_TYPE_GLZ_RGB, NULL);
|
||||
#ifdef WIN32
|
||||
canvas->glz_data.decode_data.dc = canvas->dc;
|
||||
#endif
|
||||
|
||||
spice_return_val_if_fail(image->u.lz_rgb.data->num_chunks == 1, NULL); /* TODO: Handle chunks */
|
||||
return canvas_get_glz_rgb_common(canvas, image->u.lz_rgb.data->chunk[0].data, want_original);
|
||||
@ -3481,9 +3468,5 @@ static int canvas_base_init(CanvasBase *canvas, SpiceCanvasOps *ops,
|
||||
canvas->palette_cache = palette_cache;
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
canvas->dc = NULL;
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -161,22 +161,9 @@ pixman_image_t * surface_create(pixman_format_code_t format, int width, int heig
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
pixman_image_t *surface_create_stride(HDC dc, pixman_format_code_t format, int width, int height,
|
||||
int stride)
|
||||
#else
|
||||
pixman_image_t *surface_create_stride(pixman_format_code_t format, int width, int height,
|
||||
int stride)
|
||||
#endif
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (dc) {
|
||||
if (abs(stride) == (width * 4)) {
|
||||
return surface_create(format, width, height, (stride > 0));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return __surface_create_stride(format, width, height, stride);
|
||||
}
|
||||
|
||||
@ -196,11 +183,7 @@ pixman_image_t *alloc_lz_image_surface(LzDecodeUsrData *canvas_data,
|
||||
stride = -stride;
|
||||
}
|
||||
|
||||
surface = surface_create_stride(
|
||||
#ifdef WIN32
|
||||
canvas_data->dc,
|
||||
#endif
|
||||
pixman_format, width, height, stride);
|
||||
surface = surface_create_stride(pixman_format, width, height, stride);
|
||||
canvas_data->out_surface = surface;
|
||||
return surface;
|
||||
}
|
||||
|
||||
@ -38,19 +38,11 @@ int spice_pixman_image_get_format(pixman_image_t *image, pixman_format_code_t *f
|
||||
|
||||
pixman_image_t *surface_create(pixman_format_code_t format, int width, int height, int top_down);
|
||||
|
||||
#ifdef WIN32
|
||||
pixman_image_t *surface_create_stride(HDC dc, pixman_format_code_t format, int width, int height,
|
||||
int stride);
|
||||
#else
|
||||
pixman_image_t *surface_create_stride(pixman_format_code_t format, int width, int height,
|
||||
int stride);
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct LzDecodeUsrData {
|
||||
#ifdef WIN32
|
||||
HDC dc;
|
||||
#endif
|
||||
pixman_image_t *out_surface;
|
||||
} LzDecodeUsrData;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user