[Spice-devel] [PATCH spice-common 4/8] canvas: Remove unused dc parameter from surface_create

Frediano Ziglio fziglio at redhat.com
Wed Jan 17 11:31:06 UTC 2018


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 common/canvas_base.c  | 36 ++++++------------------------------
 common/canvas_utils.c |  7 +------
 common/canvas_utils.h |  5 -----
 3 files changed, 7 insertions(+), 41 deletions(-)

diff --git a/common/canvas_base.c b/common/canvas_base.c
index 39439ed..d295ba4 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -418,11 +418,7 @@ static pixman_image_t *canvas_get_quic(CanvasBase *canvas, SpiceImage *image,
     spice_return_val_if_fail((uint32_t)width == image->descriptor.width, NULL);
     spice_return_val_if_fail((uint32_t)height == image->descriptor.height, NULL);
 
-    surface = surface_create(
-#ifdef WIN32
-                             canvas->dc,
-#endif
-                             pixman_format,
+    surface = surface_create(pixman_format,
                              width, height, FALSE);
 
     spice_return_val_if_fail(surface != NULL, NULL);
@@ -481,11 +477,7 @@ static pixman_image_t *canvas_get_jpeg(CanvasBase *canvas, SpiceImage *image)
     spice_return_val_if_fail((uint32_t)width == image->descriptor.width, NULL);
     spice_return_val_if_fail((uint32_t)height == image->descriptor.height, NULL);
 
-    surface = surface_create(
-#ifdef WIN32
-                             canvas->dc,
-#endif
-                             PIXMAN_LE_x8r8g8b8,
+    surface = surface_create(PIXMAN_LE_x8r8g8b8,
                              width, height, FALSE);
     if (surface == NULL) {
         spice_warning("create surface failed");
@@ -563,11 +555,7 @@ static pixman_image_t *canvas_get_lz4(CanvasBase *canvas, SpiceImage *image)
             return NULL;
     }
 
-    surface = surface_create(
-#ifdef WIN32
-                             canvas->dc,
-#endif
-                             format,
+    surface = surface_create(format,
                              width, height, top_down);
     if (surface == NULL) {
         spice_warning("create surface failed");
@@ -694,11 +682,7 @@ static pixman_image_t *canvas_bitmap_to_surface(CanvasBase *canvas, SpiceBitmap*
                                           bitmap->format == SPICE_BITMAP_FMT_RGBA);
     }
 
-    image = surface_create(
-#ifdef WIN32
-                           canvas->dc,
-#endif
-                           format,
+    image = surface_create(format,
                            bitmap->x, bitmap->y, FALSE);
     if (image == NULL) {
         spice_warning("create surface failed");
@@ -1263,11 +1247,7 @@ static pixman_image_t *canvas_get_image_internal(CanvasBase *canvas, SpiceImage
                                                  surface_format == PIXMAN_a8r8g8b8);
 
         if (surface_format != wanted_format) {
-            converted = surface_create(
-#ifdef WIN32
-                                       canvas->dc,
-#endif
-                                       wanted_format,
+            converted = surface_create(wanted_format,
                                        pixman_image_get_width(surface),
                                        pixman_image_get_height(surface),
                                        TRUE);
@@ -1412,11 +1392,7 @@ static pixman_image_t *canvas_get_bitmap_mask(CanvasBase *canvas, SpiceBitmap* b
     int line_size;
     int dest_stride;
 
-    surface = surface_create(
-#ifdef WIN32
-            canvas->dc,
-#endif
-            PIXMAN_a1, bitmap->x, bitmap->y, TRUE);
+    surface = surface_create(PIXMAN_a1, bitmap->x, bitmap->y, TRUE);
     spice_return_val_if_fail(surface != NULL, NULL);
 
     spice_chunks_linearize(bitmap->data);
diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index 57fffbe..b586886 100644
--- a/common/canvas_utils.c
+++ b/common/canvas_utils.c
@@ -114,12 +114,7 @@ static inline pixman_image_t *__surface_create_stride(pixman_format_code_t forma
     return surface;
 }
 
-#ifdef WIN32
-pixman_image_t *surface_create(HDC dc, pixman_format_code_t format,
-                                int width, int height, int top_down)
-#else
 pixman_image_t * surface_create(pixman_format_code_t format, int width, int height, int top_down)
-#endif
 {
     if (top_down) {
         pixman_image_t *surface;
@@ -177,7 +172,7 @@ pixman_image_t *surface_create_stride(pixman_format_code_t format, int width, in
 #ifdef WIN32
     if (dc) {
         if (abs(stride) == (width * 4)) {
-            return surface_create(dc, format, width, height, (stride > 0));
+            return surface_create(format, width, height, (stride > 0));
         }
     }
 #endif
diff --git a/common/canvas_utils.h b/common/canvas_utils.h
index 63d0fbb..c198234 100644
--- a/common/canvas_utils.h
+++ b/common/canvas_utils.h
@@ -36,12 +36,7 @@ void spice_pixman_image_set_format(pixman_image_t *image,
 int spice_pixman_image_get_format(pixman_image_t *image, pixman_format_code_t *format);
 
 
-#ifdef WIN32
-pixman_image_t *surface_create(HDC dc, pixman_format_code_t format,
-                               int width, int height, int top_down);
-#else
 pixman_image_t *surface_create(pixman_format_code_t format, int width, int height, int top_down);
-#endif
 
 #ifdef WIN32
 pixman_image_t *surface_create_stride(HDC dc, pixman_format_code_t format, int width, int height,
-- 
2.14.3



More information about the Spice-devel mailing list