kwo pushed a commit to branch master. http://git.enlightenment.org/e16/e16.git/commit/?id=83e1e6e88f10f181938b2a38e3bb9a41b29c7989
commit 83e1e6e88f10f181938b2a38e3bb9a41b29c7989 Author: Kim Woelders <k...@woelders.dk> Date: Sun Aug 17 13:27:53 2014 +0200 Add argb option to EPictureCreateBuffer(). --- src/ecompmgr.c | 2 +- src/x.c | 14 +++++++++----- src/xwin.h | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ecompmgr.c b/src/ecompmgr.c index 0695c96..2ebd58f 100644 --- a/src/ecompmgr.c +++ b/src/ecompmgr.c @@ -1990,7 +1990,7 @@ static void ECompMgrRootBufferCreate(unsigned int w, unsigned int h) { /* Root buffer picture and pixmap */ - rootBuffer = EPictureCreateBuffer(VROOT, w, h, &Mode_compmgr.pmap); + rootBuffer = EPictureCreateBuffer(VROOT, w, h, 0, &Mode_compmgr.pmap); /* Screen region */ Mode_compmgr.rgn_screen = ERegionCreateRect(0, 0, w, h); diff --git a/src/x.c b/src/x.c index 4b3ad40..da9cd2f 100644 --- a/src/x.c +++ b/src/x.c @@ -2063,7 +2063,7 @@ EPictureCreate(Win win, EX_Drawable draw) if (!win) win = VROOT; pictfmt = XRenderFindVisualFormat(disp, WinGetVisual(win)); - pict = XRenderCreatePicture(disp, draw, pictfmt, 0, 0); + pict = XRenderCreatePicture(disp, draw, pictfmt, 0, NULL); return pict; } @@ -2097,15 +2097,19 @@ EPictureCreateSolid(EX_Window xwin, int argb, unsigned int a, unsigned int rgb) } EX_Picture -EPictureCreateBuffer(Win win, int w, int h, EX_Pixmap * ppmap) +EPictureCreateBuffer(Win win, int w, int h, int argb, EX_Pixmap * ppmap) { EX_Picture pict; EX_Pixmap pmap; XRenderPictFormat *pictfmt; + int depth; - pmap = XCreatePixmap(disp, WinGetXwin(win), w, h, WinGetDepth(win)); - pictfmt = XRenderFindVisualFormat(disp, WinGetVisual(win)); - pict = XRenderCreatePicture(disp, pmap, pictfmt, 0, 0); + depth = argb ? 32 : WinGetDepth(win); + pictfmt = argb ? + XRenderFindStandardFormat(disp, PictStandardARGB32) : + XRenderFindVisualFormat(disp, WinGetVisual(win)); + pmap = XCreatePixmap(disp, WinGetXwin(win), w, h, depth); + pict = XRenderCreatePicture(disp, pmap, pictfmt, 0, NULL); if (ppmap) *ppmap = pmap; else diff --git a/src/xwin.h b/src/xwin.h index 390d8c5..1592d24 100644 --- a/src/xwin.h +++ b/src/xwin.h @@ -309,7 +309,7 @@ void PmapMaskFree(PmapMask * pmm); EX_Picture EPictureCreate(Win win, EX_Drawable draw); EX_Picture EPictureCreateSolid(EX_Window xwin, int argb, unsigned int a, unsigned int rgb); -EX_Picture EPictureCreateBuffer(Win win, int w, int h, +EX_Picture EPictureCreateBuffer(Win win, int w, int h, int argb, EX_Pixmap * ppmap); void EPictureDestroy(EX_Picture pict); --