can draw!!@&@(c
authorDana Jansens <danakj@orodu.net>
Mon, 26 May 2003 21:17:14 +0000 (21:17 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 26 May 2003 21:17:14 +0000 (21:17 +0000)
render2/paint.c
render2/planar.h
render2/test.c

index aa2b95271370d5d6350f171aca15471b6ec0f43f..d37290c8fa44612864e227e590870f3d9ab2d82c 100644 (file)
@@ -50,7 +50,7 @@ void RrPaintArea(struct RrSurface *sur, int x, int y, int w, int h)
 
     switch (RrSurfaceType(sur)) {
     case RR_SURFACE_PLANAR:
-        RrPlanarPaint(sur, x, y, w, h);
+        RrPlanarPaint(sur, RrSurfaceX(sur) + x, RrSurfaceY(sur) + y, w, h);
         break;
     case RR_SURFACE_NONPLANAR:
         assert(0);
index 907ff8392179466411fa0dee57a8e7bd831380b6..876601c7eff401224374f4b43a121e1621f8e446 100644 (file)
@@ -12,7 +12,7 @@ struct RrPlanarSurface {
 
 #define RrPlanarColorType(sur) ((sur)->data.planar.colortype)
 #define RrPlanarPrimaryColor(sur) ((sur)->data.planar.primary)
-#define RrPlanarSecondaryColor(sur) ((sur)->data.planar.primary)
+#define RrPlanarSecondaryColor(sur) ((sur)->data.planar.secondary)
 
 void RrPlanarPaint(struct RrSurface *sur, int x, int y, int w, int h);
 
index 59545c96b008cf15193dd3050c16832590ceb085..9eb060f597a4360d1ed8f7cf9ebfcdc23ee638d4 100644 (file)
@@ -24,7 +24,7 @@ int main()
 {
     Display *display;
     Window win;
-    XEvent report;
+    XEvent report, report2;
     XClassHint chint;
     Atom delete_win, protocols;
     int quit;
@@ -78,9 +78,20 @@ int main()
                 if ((Atom)report.xclient.data.l[0] == delete_win)
                     quit = 1;
         case Expose:
-            RrPaint(sur);
-            break;
+            if (XCheckTypedWindowEvent(display, win, ConfigureNotify,
+                                       &report2)) {
+                XPutBackEvent(display, &report);
+                XPutBackEvent(display, &report2);
+                /* fall through ... */
+            } else {
+                while (XCheckTypedWindowEvent(display, win, Expose, &report));
+                RrPaintArea(sur, report.xexpose.x, report.xexpose.y,
+                            report.xexpose.width, report.xexpose.height);
+                break;
+            }
         case ConfigureNotify:
+            while (XCheckTypedWindowEvent(display, win, ConfigureNotify,
+                                          &report));
             RrSurfaceSetArea(sur,
                              report.xconfigure.x,
                              report.xconfigure.y,