diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2015-01-21 17:51:53 +0100 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2015-01-23 16:24:04 +0100 |
commit | ac26fd7acbe863964148b960a949ec87cbfb56c1 (patch) | |
tree | d1e60a860f9094702fe277291cc6d99a443729f3 | |
parent | 062bf67442e80b138f4240b017b307e3915c4489 (diff) |
Remove redundant #if defined(SW_CANVAS_CACHE) || defined(SW_CANVAS_IMAGE_CACHE)
SW_CANVAS_CACHE is always defined when building spice-gtk,
SW_CANVAS_IMAGE_CACHE is always defined when building spice-server, and
they are the only 2 users of spice-common. Moreover, build when none of
these is defined is broken.
-rw-r--r-- | common/canvas_base.c | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/common/canvas_base.c b/common/canvas_base.c index e6d5399..64d0aae 100644 --- a/common/canvas_base.c +++ b/common/canvas_base.c @@ -141,9 +141,7 @@ typedef struct CanvasBase { int height; pixman_region32_t canvas_region; -#if defined(SW_CANVAS_CACHE) || defined(SW_CANVAS_IMAGE_CACHE) SpiceImageCache *bits_cache; -#endif #ifdef SW_CANVAS_CACHE SpicePaletteCache *palette_cache; #endif @@ -1059,7 +1057,6 @@ static int image_has_palette_to_cache(SpiceImage *image) } #endif -#if defined(SW_CANVAS_CACHE) || defined(SW_CANVAS_IMAGE_CACHE) //#define DEBUG_LZ /* If real get is FALSE, then only do whatever is needed but don't return an image. For instance, @@ -1253,36 +1250,6 @@ static pixman_image_t *canvas_get_image_internal(CanvasBase *canvas, SpiceImage return surface; } -#else - -static pixman_image_t *canvas_get_image_internal(CanvasBase *canvas, SpiceImage *image, - int want_original, int real_get) -{ - SpiceImageDescriptor *descriptor = &image->descriptor; - pixman_format_code_t format; - - /* When touching, never load image. */ - if (!real_get) { - return NULL; - } - - switch (descriptor->type) { - case SPICE_IMAGE_TYPE_QUIC: { - return canvas_get_quic(canvas, image, 0); - } - case SPICE_IMAGE_TYPE_BITMAP: { - return canvas_get_bits(canvas, &image->u.bitmap, want_original, &format); - } - default: - spice_warn_if_reached(); - return NULL; - } - - return NULL; -} - -#endif - static SpiceCanvas *canvas_get_surface_mask(CanvasBase *canvas, SpiceImage *image) { return canvas_get_surface_mask_internal(canvas, image); @@ -1582,7 +1549,6 @@ static pixman_image_t *canvas_get_mask(CanvasBase *canvas, SpiceQMask *mask, int return NULL; } -#if defined(SW_CANVAS_CACHE) || defined(SW_CANVAS_IMAGE_CACHE) if (cache_me) { canvas->bits_cache->ops->put(canvas->bits_cache, image->descriptor.id, surface); } @@ -1597,7 +1563,7 @@ static pixman_image_t *canvas_get_mask(CanvasBase *canvas, SpiceQMask *mask, int surface = inv_surf; } } -#endif + return surface; } @@ -3581,9 +3547,7 @@ static int canvas_base_init(CanvasBase *canvas, SpiceCanvasOps *ops, canvas->width, canvas->height); -#if defined(SW_CANVAS_CACHE) || defined(SW_CANVAS_IMAGE_CACHE) canvas->bits_cache = bits_cache; -#endif #ifdef SW_CANVAS_CACHE canvas->palette_cache = palette_cache; #endif |