Clear the pixmap right after allocate it.
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 17 Apr 2013 08:00:46 +0000 (17:00 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 17 Apr 2013 09:16:24 +0000 (18:16 +0900)
Change-Id: I05ee70b2761550e4a0dc1f6c2435f52d09c7c26e

src/buffer_handler.c

index dba3e79..b410a82 100644 (file)
@@ -171,6 +171,8 @@ static inline struct buffer *create_pixmap(struct buffer_info *info)
        struct buffer *buffer;
        Display *disp;
        Window parent;
+       XGCValues gcv;
+       GC gc;
 
        disp = ecore_x_display_get();
        if (!disp)
@@ -210,7 +212,20 @@ static inline struct buffer *create_pixmap(struct buffer_info *info)
                return NULL;
        }
 
-       XSync(disp, False);
+       /*!
+        * \note
+        * Clear pixmap
+        */
+       memset(&gcv, 0, sizeof(gcv));
+       gc = XCreateGC(disp, gem->pixmap, GCForeground, &gcv);
+       if (gc) {
+               XFillRectangle(disp, gem->pixmap, gc, 0, 0, info->w, info->h);
+               XSync(disp, False);
+               XFreeGC(disp, gc);
+       } else {
+               XSync(disp, False);
+               ErrPrint("Unable to clear the pixmap\n");
+       }
 
        DbgPrint("Pixmap:0x%X is created\n", gem->pixmap);
        return buffer;