summaryrefslogtreecommitdiff
path: root/miext
diff options
context:
space:
mode:
authorTorrey Lyons <torrey@mrcla.com>2004-10-25 19:09:11 +0000
committerTorrey Lyons <torrey@mrcla.com>2004-10-25 19:09:11 +0000
commitdb65fce04ddec1dac0d92ad3abc95ab4996bd206 (patch)
tree43e72de09aaf8c6cfd2e77f08ac67a88b7cc8907 /miext
parenta57e85b52357f15f52e81c8d9b310a76e0c62b3f (diff)
Fix rootless Cygwin crash due to acceleration code illegally modifying a
const structure (Reported by Kensuke Matsuzaki).
Diffstat (limited to 'miext')
-rw-r--r--miext/rootless/accel/rlAccel.c43
1 files changed, 37 insertions, 6 deletions
diff --git a/miext/rootless/accel/rlAccel.c b/miext/rootless/accel/rlAccel.c
index 7dedd8dbc..0f05ca5ef 100644
--- a/miext/rootless/accel/rlAccel.c
+++ b/miext/rootless/accel/rlAccel.c
@@ -26,7 +26,14 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XdotOrg: $ */
+/* $XdotOrg: xc/programs/Xserver/miext/rootless/accel/rlAccel.c,v 1.1 2004/09/18 00:38:29 torrey Exp $ */
+
+/*
+ * The accelerated rootless code replaces some GC operations from fb with
+ * versions that call the rootless acceleration functions where appropriate.
+ * To work properly, this must be wrapped directly on top of fb. Nothing
+ * underneath this layer besides fb will get called.
+ */
#include "rootless.h"
#include "rlAccel.h"
@@ -40,6 +47,33 @@ static int rlAccelScreenPrivateIndex = -1;
#define RLACCELREC(pScreen) \
((rlAccelScreenRec *)(pScreen)->devPrivates[rlAccelScreenPrivateIndex].ptr)
+/* This is mostly identical to fbGCOps. */
+static GCOps rlAccelOps = {
+ rlFillSpans,
+ fbSetSpans,
+ fbPutImage,
+ rlCopyArea,
+ fbCopyPlane,
+ fbPolyPoint,
+ fbPolyLine,
+ fbPolySegment,
+ fbPolyRectangle,
+ fbPolyArc,
+ miFillPolygon,
+ rlPolyFillRect,
+ fbPolyFillArc,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ rlImageGlyphBlt,
+ fbPolyGlyphBlt,
+ fbPushPixels
+#ifdef NEED_LINEHELPER
+ ,NULL
+#endif
+};
+
/*
* Screen function to create a graphics context
@@ -55,11 +89,8 @@ rlCreateGC(GCPtr pGC)
pScreen->CreateGC = s->CreateGC;
result = s->CreateGC(pGC);
- // Accelerated GC ops replace some ops
- pGC->ops->FillSpans = rlFillSpans;
- pGC->ops->CopyArea = rlCopyArea;
- pGC->ops->PolyFillRect = rlPolyFillRect;
- pGC->ops->ImageGlyphBlt = rlImageGlyphBlt;
+ // Accelerated GC ops replace some fb GC ops
+ pGC->ops = &rlAccelOps;
// Rewrap
s->CreateGC = pScreen->CreateGC;