Keith-
Thanks for your reply.
Originally, I was using 4.1. So I built 4.2 and added the arbitrary format.
xdpyinfo -ext RENDER reported the new format as you described, but still no
rendering occurs.
To test this, I hacked your blend.c from test.tar.bz2 (see patch below). It
works ok with 32-bit ARGB, but the ARGB4444 appears not to render. The right
libXrender.so.1 is being loaded, and I'm pretty sure the foreground values
for the rectangles are set correctly, but I'm still missing something.
Please help...
Joe
--- blend.c.orig Mon Feb 25 20:49:10 2002
+++ blend.c Tue Feb 26 20:58:52 2002
@@ -64,16 +64,32 @@
PictFormatAlphaMask,
&pf, 0);
if (!format_alpha) exit (1);
- pf.depth = 24;
+
+
+ /*
+ pf.depth = 16;
+ pf.type = PictTypeDirect;
+ pf.direct.alpha = 12;
+ pf.direct.alphaMask = 0xf;
+ pf.direct.red = 8;
+ pf.direct.redMask = 0xf;
+ pf.direct.green = 4;
+ pf.direct.greenMask = 0xf;
+ pf.direct.blue = 0;
+ pf.direct.blueMask = 0xf;
+ */
+
+ pf.depth = 32;
pf.type = PictTypeDirect;
- pf.direct.alpha = 0;
- pf.direct.alphaMask = 0;
+ pf.direct.alpha = 24;
+ pf.direct.alphaMask = 0xff;
pf.direct.red = 16;
pf.direct.redMask = 0xff;
pf.direct.green = 8;
pf.direct.greenMask = 0xff;
pf.direct.blue = 0;
pf.direct.blueMask = 0xff;
+
format_pix = XRenderFindFormat(dpy,
PictFormatType|
PictFormatDepth|
@@ -93,10 +109,11 @@
WhitePixel (dpy, screen));
picture = XRenderCreatePicture (dpy, window, format_win, 0, 0);
- color_pix = XCreatePixmap(dpy, window, 1, 1, 24);
- pa.repeat = True;
+ /*color_pix = XCreatePixmap(dpy, window, SIZE, SIZE, 16);*/
+ color_pix = XCreatePixmap(dpy, window, SIZE, SIZE, 32);
+ /*pa.repeat = True;*/
color = XRenderCreatePicture (dpy, color_pix, format_pix,
- CPRepeat, &pa);
+ 0/*CPRepeat*/, NULL/*&pa*/);
alpha_pix = XCreatePixmap (dpy, window, SIZE, SIZE, 8);
alpha = XRenderCreatePicture (dpy, alpha_pix, format_alpha, 0, 0);
@@ -113,8 +130,9 @@
{
XClearArea (dpy, window, 0, 0, 0, 0, False);
- XSetForeground (dpy, gc32, 0xff0000);
- XFillRectangle (dpy, color_pix, gc32, 0, 0, 1, 1);
+ XSetForeground (dpy, gc32, 0x3fff0000);
+ /*XSetForeground (dpy, gc32, 0x8f00);*/
+ XFillRectangle (dpy, color_pix, gc32, 10, 10, 50, 50);
XSetForeground (dpy, gc8, 0x00);
XFillRectangle (dpy, alpha_pix, gc8, 0, 0, SIZE, SIZE);
@@ -124,12 +142,13 @@
XRenderComposite (dpy,
PictOpOver,
color,
- alpha,
+ 0/*alpha*/,
picture,
0, 0, 0, 0, 0, 0, SIZE, SIZE);
- XSetForeground (dpy, gc32, 0x0000ff);
- XFillRectangle (dpy, color_pix, gc32, 0, 0, 1, 1);
+ XSetForeground (dpy, gc32, 0x7f0000ff);
+ /*XSetForeground (dpy, gc32, 0x800f);*/
+ XFillRectangle (dpy, color_pix, gc32, 40, 40, 50, 50);
XSetForeground (dpy, gc8, 0x00);
XFillRectangle (dpy, alpha_pix, gc8, 0, 0, SIZE, SIZE);
@@ -139,7 +158,7 @@
XRenderComposite (dpy,
PictOpOver,
color,
- alpha,
+ 0/*alpha*/,
picture,
0, 0, 0, 0, 0, 0, SIZE, SIZE);
Around 20 o'clock on Feb 25, "Doyle, Joseph" wrote:
> To make a long story short, I've been asked to find out what the app I'm
> working on would like with a ARGB pixel layout with each channel having 4
> bits. At the risk of sounding incredibly naive, I hoped adding a picture
> format to picture.c would take care of it. Indeed, XRenderFindFormat()
> returns what you'd expect. However, the XRenderComposite call doesn't
render
> anything.
With XFree86 4.2, this should be sufficient; the underlying rendering code
can handle arbitrary formats. Please check the output of
$ xdpyinfo -ext RENDER
to make sure the expected pictformat looks like:
pict format:
format id: <server-defined>
type: Direct
depth: 16
alpha: 12 mask 0xf
red: 8 mask 0xf
green: 4 mask 0xf
blue: 0 mask 0xf
Keith Packard XFree86 Core Team Compaq Cambridge Research Lab
_______________________________________________
Render mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/render