summaryrefslogtreecommitdiff
path: root/surface.c
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2009-11-28 10:58:41 -0800
committerAaron Plattner <aplattner@nvidia.com>2009-11-28 17:51:28 -0800
commitf9adc569498bd6612af9f9aae1717b13b7662a49 (patch)
tree555f46af953232899871562eb7c4bb9f5ceb6514 /surface.c
parentcbcda62580e0d5a58be9aeb924ece32e3f7a8a71 (diff)
Misc. updates.
Use the freedesktop.org logo with part of it translucent as the destination image. Load the dst image every time we start the test loop. Use a test image with a more interesting alpha channel (the X.Org logo with a white X). Add an option to create a 32-bit ARGB window instead of one with the default visual. In that mode, create the destination pictures with a format that has alpha so ops like PictOpIn will work correctly. Reduce the test time from 5 seconds to 2 seconds to make things go a little faster. Change the mask image to have colors so component alpha will look interesting.
Diffstat (limited to 'surface.c')
-rw-r--r--surface.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/surface.c b/surface.c
index 5299276..022a935 100644
--- a/surface.c
+++ b/surface.c
@@ -31,11 +31,13 @@ xrender_surf_new(Display *disp, Drawable draw, int format, int w, int h, Bool ca
XRenderSurf *
xrender_surf_adopt(Display *disp, Drawable draw, int w, int h)
{
+ XWindowAttributes win_attr;
XRenderSurf *rs;
XRenderPictFormat *fmt;
XRenderPictureAttributes att;
- Visual *vis = DefaultVisual(disp, DefaultScreen(disp));
+ XGetWindowAttributes(disp, draw, &win_attr);
+ Visual *vis = win_attr.visual;
rs = (XRenderSurf*)calloc(1, sizeof(XRenderSurf));
fmt = XRenderFindVisualFormat(disp, vis);