[PATCH spice-common 6/8] canvas: Remove dc fields from CanvasBase and LzDecodeUsrData

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now always NULL.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 common/canvas_base.c  | 17 -----------------
 common/canvas_utils.c | 19 +------------------
 common/canvas_utils.h |  8 --------
 3 files changed, 1 insertion(+), 43 deletions(-)

diff --git a/common/canvas_base.c b/common/canvas_base.c
index d295ba4..3d3ea6c 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -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);
 
@@ -841,10 +835,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);
@@ -887,9 +877,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);
@@ -3482,9 +3469,5 @@ static int canvas_base_init(CanvasBase *canvas, SpiceCanvasOps *ops,
     canvas->palette_cache = palette_cache;
 #endif
 
-#ifdef WIN32
-    canvas->dc = NULL;
-#endif
-
     return 1;
 }
diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index b586886..3e143de 100644
--- a/common/canvas_utils.c
+++ b/common/canvas_utils.c
@@ -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;
 }
diff --git a/common/canvas_utils.h b/common/canvas_utils.h
index c198234..60a9e16 100644
--- a/common/canvas_utils.h
+++ b/common/canvas_utils.h
@@ -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;
 
-- 
2.14.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]