chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] imlib2 image-create clear image


From: John J Foerch
Subject: [Chicken-hackers] [PATCH] imlib2 image-create clear image
Date: Sun, 11 Sep 2016 17:52:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Here is a patch to fix issue #1271 http://bugs.call-cc.org/ticket/1271

>From 7bb5dacc1cdec113d11eedf207b0b5eefd2114d5 Mon Sep 17 00:00:00 2001
From: "John J. Foerch" <address@hidden>
Date: Sun, 11 Sep 2016 17:49:53 -0400
Subject: [PATCH] image-create: clear image

fixes #1271

diff --git a/imlib2.scm b/imlib2.scm
index 27b119e..23f0abd 100644
--- a/imlib2.scm
+++ b/imlib2.scm
@@ -179,7 +179,12 @@
            (imlib-err 'image-create "Could not create new image" (list width 
height))
            (begin
              (image-alpha-set! img #t)
-             (image-fill-rectangle img (color/rgba 0 0 0 0) 0 0 width height)
+              ((foreign-lambda* void ((image img) (int width) (int height))
+                 "imlib_context_set_image(img);\n"
+                 "DATA32* data = imlib_image_get_data();\n"
+                 "memset(data, 0, 4 * width * height);\n"
+                 "imlib_image_put_back_data(data);\n")
+               (image-ptr img) width height)
              (set-finalizer! img gc-collect-image))))))
 
 (define (gc-collect-image img)
-- 
2.9.3


reply via email to

[Prev in Thread] Current Thread [Next in Thread]