[Xfce4-commits] <ristretto:master> Improve rendering and performance of checkered-background

Stephan Arts noreply at xfce.org
Sun Oct 23 22:54:01 CEST 2011


Updating branch refs/heads/master
         to 3120c1356c63ff8ffb651a077503659b02031602 (commit)
       from d25d9c2a54ea21b70fd8a0c5d5a1cb84d9d4cce6 (commit)

commit 3120c1356c63ff8ffb651a077503659b02031602
Author: Stephan Arts <stephan at xfce.org>
Date:   Sun Oct 23 22:51:06 2011 +0200

    Improve rendering and performance of checkered-background

 src/image_viewer.c |   43 +++++++++----------------------------------
 1 files changed, 9 insertions(+), 34 deletions(-)

diff --git a/src/image_viewer.c b/src/image_viewer.c
index a16ac4c..e7f0cbe 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -951,40 +951,15 @@ paint_image (
         if (TRUE == gdk_pixbuf_get_has_alpha (viewer->priv->pixbuf))
         {
             cairo_set_source_rgba (ctx, 0.8, 0.8, 0.8, 1.0);
-            for (i = 0; i < viewer->priv->rendering.width/10; ++i)
-            {
-                if(i%2){a=0;}
-                else{a=1;}
-
-                if ((i+1) <= (viewer->priv->rendering.width/10))
-                {
-                    block_width = 10;
-                }
-                else
-                {
-                    block_width = ((gint)viewer->priv->rendering.width)%10;
-                }
-                for (; a < viewer->priv->rendering.height/10; a+=2)
-                {
-                    if ((a+1) <= (viewer->priv->rendering.height/10))
-                    {
-                        block_height = 10;
-                    }
-                    else
-                    {
-                        block_height = ((gint)viewer->priv->rendering.height%10);
-                    }
-                    cairo_rectangle (
-                            ctx,
-                            x_offset + i*10,
-                            y_offset + a*10,
-                            block_width,
-                            block_height);
-                    cairo_fill (ctx);
-                }
-            }
-
-            cairo_set_source_rgba (ctx, 0.4, 0.4, 0.4, 1.0);
+            cairo_rectangle (
+                    ctx,
+                    x_offset,
+                    y_offset,
+                    viewer->priv->rendering.width,
+                    viewer->priv->rendering.height);
+            cairo_fill (ctx);
+
+            cairo_set_source_rgba (ctx, 0.7, 0.7, 0.7, 1.0);
             for (i = 0; i < viewer->priv->rendering.width/10; ++i)
             {
                 if(i%2){a=1;}


More information about the Xfce4-commits mailing list