From: Sung-jae Park Date: Wed, 17 Apr 2013 08:00:46 +0000 (+0900) Subject: Clear the pixmap right after allocate it. X-Git-Tag: submit/tizen_mobile/20150527.071719~2^2~48^2~21^2~189^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8c43b1428488705f591234d75292e85df2dac54;p=platform%2Fcore%2Fappfw%2Fdata-provider-master.git Clear the pixmap right after allocate it. Change-Id: I05ee70b2761550e4a0dc1f6c2435f52d09c7c26e --- diff --git a/src/buffer_handler.c b/src/buffer_handler.c index dba3e79..b410a82 100644 --- a/src/buffer_handler.c +++ b/src/buffer_handler.c @@ -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;