[Spice-commits] 4 commits - common/gl_canvas.c common/glc.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Sun Sep 29 17:18:49 PDT 2013


 common/gl_canvas.c |   14 ++++++++++----
 common/glc.c       |    2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

New commits:
commit e443c9f6039407633d38a0eba03c344272ac8559
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Mon Sep 23 22:25:29 2013 +0200

    gl: use glCopyPixels()
    
    I don't see why the fallback method should be the default.
    
    glCopyTexImage2D and glCopyPixels are equally broken with current Intel
    mesa/drivers (I'll be filing a bug). But sw rendering is correct.

diff --git a/common/glc.c b/common/glc.c
index 91b295c..c1795de 100644
--- a/common/glc.c
+++ b/common/glc.c
@@ -1263,7 +1263,7 @@ void glc_copy_pixels(GLCCtx glc, int x_dest, int y_dest, int x_src, int y_src, i
     int recreate = 0;
 
     spice_assert(ctx);
-#ifdef USE_COPY_PIXELS
+#if 1 /* USE_COPY_PIXELS */
     start_draw(ctx);
     if (ctx->pat) {
         glDisable(GL_TEXTURE_2D);
commit 0aadda70d5cac2498e1b5bf09ee623130091da50
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Mon Sep 23 22:20:06 2013 +0200

    gl: cope with positive stride in put_image()
    
    Keeping the warning, because I don't think this should happen anyway.

diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index 176c3ef..fe152ef 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -758,7 +758,7 @@ static void gl_canvas_put_image(SpiceCanvas *spice_canvas, const SpiceRect *dest
     GLCImage image;
     uint32_t i;
 
-    spice_return_if_fail(src_stride <= 0);
+    spice_warn_if_fail(src_stride <= 0);
 
     glc_clip_reset(canvas->glc);
 
@@ -788,9 +788,13 @@ static void gl_canvas_put_image(SpiceCanvas *spice_canvas, const SpiceRect *dest
     image.format = GLC_IMAGE_RGB32;
     image.width = src_width;
     image.height = src_height;
-    src_stride = -src_stride;
+    if (src_stride < 0) {
+        src_stride = -src_stride;
+        image.pixels = (uint8_t *)src_data - (src_height - 1) * src_stride;
+    } else {
+        image.pixels = (uint8_t *)src_data;
+    }
     image.stride = src_stride;
-    image.pixels = (uint8_t *)src_data - (src_height - 1) * src_stride;
     image.pallet = NULL;
     glc_draw_image(canvas->glc, &gldest, &src, &image, 0, 1);
 
commit b6faccb3812c89ea0a4b1a19147ecdfe423aa4d9
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Mon Sep 23 22:18:36 2013 +0200

    gl: ignore alpha channel in draw_copy
    
    Similar to sw canvas blit copy operation, and not a blend.

diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index 0736a08..176c3ef 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -373,6 +373,7 @@ static void gl_canvas_draw_copy(SpiceCanvas *spice_canvas, SpiceRect *bbox, Spic
     surface_to_image(canvas, surface, &image, 0);
     SET_GLC_RECT(&dest, bbox);
     SET_GLC_RECT(&src, &copy->src_area);
+    image.format = GLC_IMAGE_RGB32;
     glc_draw_image(canvas->glc, &dest, &src, &image, 0, 1);
 
     pixman_image_unref(surface);
commit 370ba35339b98cb5f74ee529b42dc3364bdb37df
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Mon Sep 23 22:16:08 2013 +0200

    gl: ignore if mask has not bitmap
    
    Similar to how sw canvas ignore mask if !bitmap in canvas_mask_pixman().

diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index 2adc986..0736a08 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -207,7 +207,8 @@ static void set_mask(GLCanvas *canvas, SpiceQMask *mask, int x, int y)
 {
     pixman_image_t *image;
 
-    if (!(image = canvas_get_mask(&canvas->base, mask, NULL))) {
+    if (!mask->bitmap ||
+        !(image = canvas_get_mask(&canvas->base, mask, NULL))) {
         glc_clear_mask(canvas->glc, GLC_MASK_A);
         return;
     }


More information about the Spice-commits mailing list