/* Impedance layer for GC ops This provides an impedance layer between drawables and pixmaps it reworks the operations */ #ifdef HAVE_DIX_CONFIG_H #include #endif #include #include "gcstruct.h" #include "drv_gcstruct.h" #include "drv_pixmapstr.h" #include "gc.h" #include "migc.h" #include "mi.h" #include "windowstr.h" #include "drv_scrnintstr.h" #include "drv_imped.h" static void SyncDrvGC(GCPtr pGC, DrvGCPtr pDrvGC, int index) { pDrvGC->tileIsPixel = pGC->tileIsPixel; if (!pGC->tileIsPixel) { impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pGC->tile.pixmap); pDrvGC->tile.pixmap = imped_pixmap->gpu[index]; } pDrvGC->lineStyle = pGC->lineStyle; pDrvGC->alu = pGC->alu; pDrvGC->fgPixel = pGC->fgPixel; pDrvGC->bgPixel = pGC->bgPixel; pDrvGC->pCompositeClip = pGC->pCompositeClip; pDrvGC->freeCompClip = 0; pDrvGC->arcMode = pGC->arcMode; pDrvGC->fillStyle = pGC->fillStyle; pDrvGC->fillRule = pGC->fillRule; pDrvGC->planemask = pGC->planemask; pDrvGC->joinStyle = pGC->joinStyle; pDrvGC->capStyle = pGC->capStyle; pDrvGC->lineWidth = pGC->lineWidth; pDrvGC->font = pGC->font; if (pGC->stipple) { impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pGC->stipple); pDrvGC->stipple = imped_pixmap->gpu[index]; } } static void setup_shatter_clip(RegionPtr orig_region, DrvGCPtr pDrvGC, DrvPixmapPtr pDrvPixmap) { BoxRec pixbox; RegionRec pixclip; pixbox.x1 = pDrvPixmap->shattered_x; pixbox.x2 = pDrvPixmap->shattered_x + pDrvPixmap->width; pixbox.y1 = pDrvPixmap->shattered_y; pixbox.y2 = pDrvPixmap->shattered_y + pDrvPixmap->height; /* adjust the composite clip */ RegionInit(&pixclip, &pixbox, 1); RegionNull(orig_region); RegionCopy(orig_region, pDrvGC->pCompositeClip); RegionIntersect(pDrvGC->pCompositeClip, orig_region, &pixclip); } static void finish_shatter_clip(RegionPtr orig_region, DrvGCPtr pDrvGC) { RegionCopy(pDrvGC->pCompositeClip, orig_region); } #define FOR_EACH_PIXMAP(op) for (int _i = 0; _i < imped_screen->num_gpu; _i++) { \ DrvGCPtr _pDrvGC = imped_gc->gpu[_i]; \ DrvPixmapPtr _pDrvPixmap = imped_pixmap->gpu[_i]; \ RegionRec orig_region; \ while (_pDrvPixmap) { \ if (imped_pixmap->shattered) setup_shatter_clip(&orig_region, _pDrvGC, _pDrvPixmap); \ op; \ if (imped_pixmap->shattered) finish_shatter_clip(&orig_region, _pDrvGC); \ _pDrvPixmap = _pDrvPixmap->shatter_next; \ } \ } void impedValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { PixmapPtr pPixmap = GetDrawablePixmap(pDrawable); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedGCPrivPtr imped_gc = impedGetGC(pGC); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); DrvGCPtr pDrvGC; int i; if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) || (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS)) ) { miComputeCompositeClip (pGC, pDrawable); } for (i = 0; i < imped_screen->num_gpu; i++) { pDrvGC = imped_gc->gpu[i]; SyncDrvGC(pGC, pDrvGC, 0); pDrvGC->ops->GPUValidateGC(pDrvGC, changes, imped_pixmap->gpu[i]); } } const GCFuncs impedGCFuncs = { impedValidateGC, miChangeGC, miCopyGC, miDestroyGC, miChangeClip, miDestroyClip, miCopyClip, }; static void impedFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nInit, DDXPointPtr pptInit, int *pwidthInit, int fSorted) { int i; int x_off, y_off; PixmapPtr pPixmap = GetDrawablePixmap(pDrawable); impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); for (i = 0; i < nInit; i++) { pptInit[i].x += x_off; pptInit[i].y += y_off; } FOR_EACH_PIXMAP(_pDrvGC->ops->FillSpans(_pDrvPixmap, _pDrvGC, nInit, pptInit, pwidthInit, fSorted)); } static void impedSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *src, DDXPointPtr ppt, int *pwidth, int nspans, int fSorted) { int i; int x_off, y_off; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); for (i = 0; i < nspans; i++) { ppt[i].x += x_off; ppt[i].y += y_off; } FOR_EACH_PIXMAP(_pDrvGC->ops->SetSpans(_pDrvPixmap, _pDrvGC, src, ppt, pwidth, nspans, fSorted)); } static void impedPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pImage) { int x_off, y_off; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); x += x_off; y += y_off; FOR_EACH_PIXMAP(_pDrvGC->ops->PutImage(_pDrvPixmap, _pDrvGC, depth, x, y, w, h, leftPad, format, pImage)); } static void impedPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, xPoint *pptInit) { int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); if (mode == CoordModePrevious) { pptInit[0].x += x_off; pptInit[0].y += y_off; } else { for (i = 0; i < npt; i++) { pptInit[i].x += x_off; pptInit[i].y += y_off; } } FOR_EACH_PIXMAP(_pDrvGC->ops->PolyPoint(_pDrvPixmap, _pDrvGC, mode, npt, pptInit)); } static void impedPolyLines (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt) { int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); fprintf(stderr,"poly lines %d %d\n", x_off, y_off); if (mode == CoordModePrevious) { ppt[0].x += x_off; ppt[0].y += y_off; } else { for (i = 0; i < npt; i++) { ppt[i].x += x_off; ppt[i].y += y_off; } } FOR_EACH_PIXMAP(_pDrvGC->ops->Polylines(_pDrvPixmap, _pDrvGC, mode, npt, ppt)); } static void impedPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs) { int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); for (i = 0; i < nseg; i++) { pSegs[i].x1 += x_off; pSegs[i].x2 += x_off; pSegs[i].y1 += y_off; pSegs[i].y2 += y_off; } FOR_EACH_PIXMAP(_pDrvGC->ops->PolySegment(_pDrvPixmap, _pDrvGC, nseg, pSegs)); } static void impedPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, xRectangle *pRects) { int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); for (i = 0; i < nrects; i++) { pRects[i].x += x_off; pRects[i].y += y_off; } FOR_EACH_PIXMAP(_pDrvGC->ops->PolyRectangle(_pDrvPixmap, _pDrvGC, nrects, pRects)); } static void impedPolyArc (DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) { int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); /* impedance match with fb layer */ for (i = 0; i < narcs; i++) { parcs[i].x += x_off; parcs[i].y += y_off; } FOR_EACH_PIXMAP(_pDrvGC->ops->PolyArc(_pDrvPixmap, _pDrvGC, narcs, parcs)); } static void impedFillPolygon( DrawablePtr pDrawable, GCPtr pGC, int shape, int mode, int count, DDXPointPtr pPts) { int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); for (i = 0; i < count; i++) { pPts[i].x += x_off; pPts[i].y += y_off; } FOR_EACH_PIXMAP(_pDrvGC->ops->FillPolygon(_pDrvPixmap, _pDrvGC, shape, mode, count, pPts)); } static void impedPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *prectInit) { int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); for (i = 0; i < nrectFill; i++) { prectInit[i].x += x_off; prectInit[i].y += y_off; } FOR_EACH_PIXMAP(_pDrvGC->ops->PolyFillRect(_pDrvPixmap, _pDrvGC, nrectFill, prectInit)); } static void impedPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) { int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); for (i = 0; i < narcs; i++) { parcs[i].x += x_off; parcs[i].y += y_off; } FOR_EACH_PIXMAP(_pDrvGC->ops->PolyFillArc(_pDrvPixmap, _pDrvGC, narcs, parcs)); } static int impedPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars) { int i, ret = 0; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); for (i = 0; i < imped_screen->num_gpu; i++) { pDrvGC = imped_gc->gpu[i]; ret = pDrvGC->ops->PolyText8(imped_pixmap->gpu[i], pDrvGC, x, y, count, chars); } return ret; } static int impedPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars) { int i; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); int ret = 0; impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); for (i = 0; i < imped_screen->num_gpu; i++) { pDrvGC = imped_gc->gpu[i]; ret = pDrvGC->ops->PolyText16(imped_pixmap->gpu[i], pDrvGC, x, y, count, chars); if (ret) return ret; } return ret; } static void impedImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars) { PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); FOR_EACH_PIXMAP(_pDrvGC->ops->ImageText8(_pDrvPixmap, _pDrvGC, x, y, count, chars)); } static void impedImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars) { PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); int x_off, y_off; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); FOR_EACH_PIXMAP(_pDrvGC->ops->ImageText16(_pDrvPixmap, _pDrvGC, x, y, count, chars)); } static void impedPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, pointer pglyphBase) { int x_off, y_off; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); x += x_off; y += y_off; FOR_EACH_PIXMAP(_pDrvGC->ops->PolyGlyphBlt(_pDrvPixmap, _pDrvGC, x, y, nglyph, ppci, pglyphBase)); } static void impedImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppciInit, pointer pglyphBase) { int x_off, y_off; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); x += x_off; y += y_off; FOR_EACH_PIXMAP(_pDrvGC->ops->ImageGlyphBlt(_pDrvPixmap, _pDrvGC, x, y, nglyph, ppciInit, pglyphBase)); } void impedCopyNtoN (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { drvCopyProc copy; int src_x_off, src_y_off; int dst_x_off, dst_y_off; PixmapPtr pSrcPixmap = (PixmapPtr)GetDrawablePixmap(pSrcDrawable); PixmapPtr pDstPixmap = (PixmapPtr)GetDrawablePixmap(pDstDrawable); int i; DrvGCPtr pDrvGC = NULL; impedPixmapPrivPtr imped_src_pixmap = impedGetPixmap(pSrcPixmap); impedPixmapPrivPtr imped_dst_pixmap = impedGetPixmap(pDstPixmap); impedScreenPrivPtr imped_src_screen = impedGetScreen(pSrcPixmap->drawable.pScreen); /* copy already takes care of the pixmap clipping */ dx += pDstPixmap->screen_x - pSrcPixmap->screen_x; dy += pDstPixmap->screen_y - pSrcPixmap->screen_y; if (pDstPixmap->screen_x || pDstPixmap->screen_y) { for (i = 0; i < nbox; i++) { pbox[i].x1 -= pDstPixmap->screen_x; pbox[i].x2 -= pDstPixmap->screen_x; pbox[i].y1 -= pDstPixmap->screen_y; pbox[i].y2 -= pDstPixmap->screen_y; } } for (i = 0; i < imped_src_screen->num_gpu; i++) { copy = imped_src_screen->gpu[i]->GetCopyAreaFunction(imped_src_pixmap->gpu[i], imped_dst_pixmap->gpu[i]); if (pGC) { impedGCPrivPtr imped_gc = impedGetGC(pGC); pDrvGC = imped_gc->gpu[i]; } copy(imped_src_pixmap->gpu[i], imped_dst_pixmap->gpu[i], pDrvGC, pbox, nbox, dx, dy, reverse, upsidedown, bitplane, closure); } } static RegionPtr impedCopyArea (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut) { return miDoCopy(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut, impedCopyNtoN, 0, 0); } static void impedCopyPlaneNtoN (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) { drvCopyProc copy; PixmapPtr pSrcPixmap, pDstPixmap; DrvGCPtr pDrvGC = NULL; impedGCPrivPtr imped_gc; impedPixmapPrivPtr imped_src_pixmap; impedPixmapPrivPtr imped_dst_pixmap; impedScreenPrivPtr imped_src_screen; int i; pSrcPixmap = GetDrawablePixmap(pSrcDrawable); pDstPixmap = GetDrawablePixmap(pDstDrawable); imped_src_pixmap = impedGetPixmap(pSrcPixmap); imped_dst_pixmap = impedGetPixmap(pDstPixmap); imped_src_screen = impedGetScreen(pSrcPixmap->drawable.pScreen); for (i = 0; i < imped_src_screen->num_gpu; i++) { copy = imped_src_screen->gpu[i]->GetCopyPlaneFunction(imped_src_pixmap->gpu[i], imped_dst_pixmap->gpu[i], bitplane); if (pGC) { imped_gc = impedGetGC(pGC); pDrvGC = imped_gc->gpu[i]; } copy(imped_src_pixmap->gpu[i], imped_dst_pixmap->gpu[i], pDrvGC, pbox, nbox, dx, dy, reverse, upsidedown, bitplane, closure); } } static RegionPtr impedCopyPlane (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut, unsigned long bitplane) { drvCopyProc copy; PixmapPtr pSrcPixmap, pDstPixmap; impedPixmapPrivPtr imped_src_pixmap; impedPixmapPrivPtr imped_dst_pixmap; impedScreenPrivPtr imped_src_screen; pSrcPixmap = GetDrawablePixmap(pSrcDrawable); pDstPixmap = GetDrawablePixmap(pDstDrawable); imped_src_pixmap = impedGetPixmap(pSrcPixmap); imped_dst_pixmap = impedGetPixmap(pDstPixmap); imped_src_screen = impedGetScreen(pSrcPixmap->drawable.pScreen); copy = imped_src_screen->gpu[0]->GetCopyPlaneFunction(imped_src_pixmap->gpu[0], imped_dst_pixmap->gpu[0], bitplane); if (copy) return miDoCopy(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut, impedCopyPlaneNtoN, (Pixel)bitplane, 0); else return miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut, bitplane); } static void impedPushPixels (GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int dx, int dy, int xOrg, int yOrg) { int x_off, y_off; PixmapPtr pPixmap = (PixmapPtr)GetDrawablePixmap(pDrawable); impedGCPrivPtr imped_gc = impedGetGC(pGC); impedPixmapPrivPtr imped_pixmap = impedGetPixmap(pPixmap); impedPixmapPrivPtr imped_bitmap = impedGetPixmap(pBitmap); impedScreenPrivPtr imped_screen = impedGetScreen(pDrawable->pScreen); impedGetDrawableDeltas(pDrawable, pPixmap, &x_off, &y_off); xOrg += x_off; yOrg += y_off; FOR_EACH_PIXMAP(_pDrvGC->ops->PushPixels(_pDrvGC, imped_bitmap->gpu[_i], _pDrvPixmap, dx, dy, xOrg, yOrg)); } const GCOps impedGCOps = { impedFillSpans, impedSetSpans, impedPutImage, impedCopyArea, impedCopyPlane, impedPolyPoint, impedPolyLines, impedPolySegment, impedPolyRectangle, impedPolyArc, impedFillPolygon, impedPolyFillRect, impedPolyFillArc, impedPolyText8, impedPolyText16, impedImageText8, impedImageText16, impedImageGlyphBlt, impedPolyGlyphBlt, impedPushPixels, }; void impedSetGCOps(GCPtr pGC) { } Bool impedCreateGC(GCPtr pGC) { DrvGCPtr pDrvGC; impedGCPrivPtr imped_gc = impedGetGC(pGC); impedScreenPrivPtr imped_screen = impedGetScreen(pGC->pScreen); int i; pGC->ops = (GCOps *)&impedGCOps; pGC->funcs = &impedGCFuncs; /* imped wants to translate before scan conversion */ pGC->miTranslate = 1; pGC->fExpose = 1; for (i = 0; i < imped_screen->num_gpu; i++) { pDrvGC = DrvCreateGC(imped_screen->gpu[i], pGC->depth); imped_gc->gpu[i] = pDrvGC; } return TRUE; }