xserver: Branch 'orib-soc-2006'
Ori Bernstein
orib at kemper.freedesktop.org
Fri Jun 16 05:25:09 EEST 2006
hw/xnest/Cursor.c | 8 ++------
hw/xnest/Events.c | 6 +++---
hw/xnest/GCOps.c | 40 ++++++++++++++++++++--------------------
3 files changed, 25 insertions(+), 29 deletions(-)
New commits:
diff-tree 9d20580082874eea87a13b641a8b76fdea0b6729 (from e9407475283fe838b91d32bb43c9b0fc9dbe7fa9)
Author: Ori Bernstein <rand.chars at gmail.com>
Date: Thu Jun 15 21:18:39 2006 -0500
Fixed display corruption
diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c
index 720ccdd..b169797 100644
--- a/hw/xnest/Cursor.c
+++ b/hw/xnest/Cursor.c
@@ -49,7 +49,6 @@ Bool xnestRealizeCursor(ScreenPtr pScree
XCBCURSOR c;
unsigned long valuemask;
XCBParamsGC values;
-#if 0
valuemask = XCBGCFunction |
XCBGCPlaneMask |
XCBGCForeground |
@@ -87,7 +86,7 @@ Bool xnestRealizeCursor(ScreenPtr pScree
size = (((pCursor->bits->width + pad - 1) & -pad) >> 3) * pCursor->bits->height;
d.pixmap = source;
XCBPutImage(xnestConnection,
- XCBImageFormatZPixmap,
+ XCBImageFormatXYBitmap,
d,
xnestBitmapGC,
pCursor->bits->width,
@@ -99,7 +98,7 @@ Bool xnestRealizeCursor(ScreenPtr pScree
pCursor->bits->source); /*bits*/
d.pixmap = mask;
XCBPutImage(xnestConnection,
- XCBImageFormatZPixmap,
+ XCBImageFormatXYBitmap,
d,
xnestBitmapGC,
pCursor->bits->width,
@@ -109,9 +108,7 @@ Bool xnestRealizeCursor(ScreenPtr pScree
1, /*depth*/
size, /*length..correct??*/
pCursor->bits->mask); /*bits*/
-#endif
pCursor->devPriv[pScreen->myNum] = (pointer)xalloc(sizeof(xnestPrivCursor));
-#if 0
c = XCBCURSORNew(xnestConnection);
xnestCursorPriv(pCursor, pScreen)->cursor = c.xid;
XCBCreateCursor(xnestConnection,
@@ -129,7 +126,6 @@ Bool xnestRealizeCursor(ScreenPtr pScree
XCBFreePixmap(xnestConnection, source);
XCBFreePixmap(xnestConnection, mask);
-#endif
return True;
}
diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c
index 62d6682..f550fdb 100644
--- a/hw/xnest/Events.c
+++ b/hw/xnest/Events.c
@@ -253,7 +253,6 @@ void xnestCollectEvents()
XCBFontError *fe;
XCBWindowError *we;
- e = XCBWaitForEvent(xnestConnection);
while ((e = XCBPollForEvent(xnestConnection, NULL)) != NULL) {
if (!e->response_type) {
err = (XCBGenericError *)e;
@@ -278,9 +277,10 @@ void xnestCollectEvents()
default:
break;
}
- }
- else
+ } else {
+ ErrorF("Handling event %x(%d) serial %d\n", e->response_type, e->response_type, e->sequence);
xnestHandleEvent(e);
+ }
}
}
diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c
index 51678c7..5e744ae 100644
--- a/hw/xnest/GCOps.c
+++ b/hw/xnest/GCOps.c
@@ -76,26 +76,26 @@ void xnestQueryBestSize(int class, unsig
void xnestPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
int w, int h, int leftPad, int format, char *pImage)
{
- XCBImage *img;
- img = XCBImageCreate(xnestConnection,
- depth,
- format,
- 0, /*offset*/
- (BYTE *)pImage,
- w, h,
- leftPad,
- 0 /*bytes_per_line, initialized in XCBImageInit*/);
- if (img) {
- XCBImageInit(img);
- XCBImagePut(xnestConnection,
- xnestDrawable(pDrawable),
- xnestGC(pGC),
- img,
- 0, 0, /*offsets*/
- x, y,
- w, h);
- XCBImageDestroy(img);
- }
+ int size, pad;
+ int bpp;
+ int i;
+ for (i=0; i<xnestNumPixmapFormats; i++) {
+ if (xnestPixmapFormats[i].depth == depth) {
+ pad = xnestPixmapFormats[i].scanline_pad;
+ bpp = xnestPixmapFormats[i].bits_per_pixel;
+ }
+ }
+ size = (((bpp * w + pad - 1) & -pad) >> 3)*h;
+ XCBPutImage(xnestConnection,
+ format,
+ xnestDrawable(pDrawable),
+ xnestGC(pGC),
+ w, h,
+ x, y,
+ leftPad,
+ depth,
+ size,
+ (CARD8*) pImage+leftPad);
}
void xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
More information about the xorg-commit
mailing list