[PATCH xserver 3/3] glamor: Switch XY bitmap putimage function for small images

Keith Packard keithp at keithp.com
Sat Oct 1 05:44:02 UTC 2016


Use the glamor_put_image_xy_gl for small images as that is quite a bit
faster.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 glamor/glamor_image.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/glamor/glamor_image.c b/glamor/glamor_image.c
index 47968e2..6a70e6a 100644
--- a/glamor/glamor_image.c
+++ b/glamor/glamor_image.c
@@ -306,8 +306,13 @@ glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
             return;
         break;
     case XYBitmap:
-        if (glamor_put_image_xybitmap_gl(drawable, gc, x, y, w, h, leftPad, bits))
-            return;
+        if (w * h >= 100 * 100) {
+            if (glamor_put_image_xybitmap_gl(drawable, gc, x, y, w, h, leftPad, bits))
+                return;
+        } else {
+            if (glamor_put_image_xy_gl(drawable, gc, depth, x, y, w, h, leftPad, format, bits))
+                return;
+        }
         break;
     }
     glamor_put_image_bail(drawable, gc, depth, x, y, w, h, leftPad, format, bits);
-- 
2.9.3



More information about the xorg-devel mailing list