backport the changes to render/ from the alttab branch (commit 3592046b2b26e05ee94c0d...
authorDana Jansens <danakj@orodu.net>
Thu, 14 Feb 2008 19:44:17 +0000 (14:44 -0500)
committerDana Jansens <danakj@orodu.net>
Thu, 14 Feb 2008 19:44:17 +0000 (14:44 -0500)
git show 3592046b -- render

render/render.c
render/render.h

index 2813dda..b81e80a 100644 (file)
@@ -132,10 +132,20 @@ Pixmap RrPaintPixmap(RrAppearance *a, gint w, gint h)
             break;
         case RR_TEXTURE_RGBA:
             g_assert(!transferred);
             break;
         case RR_TEXTURE_RGBA:
             g_assert(!transferred);
-            RrImageDraw(a->surface.pixel_data,
-                        &a->texture[i].data.rgba,
-                        a->w, a->h,
-                        &tarea);
+            {
+                RrRect narea = tarea;
+                RrTextureRGBA *rgb = &a->texture[i].data.rgba;
+                if (rgb->twidth)
+                    narea.width = MIN(tarea.width, rgb->twidth);
+                if (rgb->theight)
+                    narea.height = MIN(tarea.height, rgb->theight);
+                narea.x += rgb->tx;
+                narea.y += rgb->ty;
+                RrImageDraw(a->surface.pixel_data,
+                            &a->texture[i].data.rgba,
+                            a->w, a->h,
+                            &narea);
+            }
             force_transfer = 1;
         break;
         }
             force_transfer = 1;
         break;
         }
index d9438ed..10eafc6 100644 (file)
@@ -167,6 +167,11 @@ struct _RrTextureRGBA {
     gint cwidth;
     gint cheight;
     RrPixel32 *cache;
     gint cwidth;
     gint cheight;
     RrPixel32 *cache;
+/* size and position to draw at */
+    gint tx;
+    gint ty;
+    gint twidth;
+    gint theight;
 };
 
 struct _RrTextureLineArt {
 };
 
 struct _RrTextureLineArt {