Attached is a simple xlib program to draw a filled arc in a box. If I cover the window with another top level window and then gradually expose it the arc is not properly redrawn. Large pieces are missing until the program's top level window is completely exposed. If I use XFillRectange instead it works perfectly. It looks like a bug either in the X server or the Intel driver.
I have Centos 6.2 with [ 28.060] Build Operating System: c6b18n2 2.6.32-71.el6.x86_64 [ 28.060] Current Operating System: Linux newpc 2.6.32-220.2.1.el6.x86_64 #1 SMP Fri Dec 23 02:21:33 CST 2011 x86_64 [ 28.060] Build Date: 17 December 2011 04:58:47PM [ 28.060] Build ID: xorg-x11-server 1.10.4-6.el6_2.1 [ 28.269] (II) Loading /usr/lib64/xorg/modules/drivers/intel_drv.so [ 28.276] (II) Module intel: vendor="X.Org Foundation" [ 28.276] compiled for 1.10.4, module version = 2.16.0 [ 28.300] (II) intel(0): Integrated Graphics Chipset: Intel(R) Sandybridge Desktop (GT1) [ 28.300] (--) intel(0): Chipset: "Sandybridge Desktop (GT1)" Separately, I get a lot of these [2899491.227] (WW) intel(0): intel_uxa_prepare_access: bo map failed: Argument list too long -- Anthony Shipman Mamas don't let your babies a...@iinet.net.au grow up to be outsourced.
#include <X11/Xlib.h> #include <string.h> #include <stdlib.h> #include <stdio.h> //====================================================================== static int topWidth; static int topHeight; static GC topGC; void configureTop(Display* display, XConfigureEvent* event) { topWidth = event->width; topHeight = event->height; printf("configure width=%d height=%d\n", topWidth, topHeight); } void exposeTop(Display* display, XExposeEvent* event) { /* There is only strange drawing behaviour with arcs. The arc filling is delayed for quite a long time, usually until the Leave event on the window. */ #if 1 XFillArc( display, event->window, topGC, 0, 0, topWidth, topHeight, 0, 64 * 360); #else XFillRectangle( display, event->window, topGC, 50, 50, 400, 600); #endif printf("expose x=%d y=%d width=%d height=%d\n", event->x, event->y, event->width, event->height); } int main(int argc, char *argv[]) { char* dispName = getenv("DISPLAY"); Display* display = XOpenDisplay(dispName); Window root; Window top; XSetWindowAttributes attrs; XGCValues gcValues; root = DefaultRootWindow(display); attrs.background_pixel = WhitePixel(display, 0); attrs.event_mask = ExposureMask | ConfigureNotify; topWidth = 500; topHeight = 800; top = XCreateWindow( display, root, 0, 0, topWidth, topHeight, 0, CopyFromParent, InputOutput, CopyFromParent, CWBackPixel | CWEventMask, &attrs ); unsigned long gcMask = GCForeground | GCFillStyle | GCArcMode; gcValues.foreground = BlackPixel(display, 0); gcValues.fill_style = FillSolid; gcValues.arc_mode = ArcPieSlice; topGC = XCreateGC(display, top, gcMask, &gcValues); XMapWindow(display, top); for(;;) { XEvent event; XNextEvent(display, &event); if (event.type == Expose && event.xexpose.window == top) { exposeTop(display, &event.xexpose); } else if (event.type == ConfigureNotify && event.xconfigure.window == top) { configureTop(display, &event.xconfigure); } else { printf("Event type %d\n", event.type); } XFlush(display); } return 0; }
_______________________________________________ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.x.org/mailman/listinfo/xorg Your subscription address: arch...@mail-archive.com