2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_XORG_CONFIG_H
|
|
|
|
#include <xorg-config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "misc.h"
|
|
|
|
#include "xf86.h"
|
|
|
|
#include "xf86_OSproc.h"
|
|
|
|
|
|
|
|
#include <X11/X.h>
|
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "xf86str.h"
|
|
|
|
#include "xaa.h"
|
|
|
|
#include "xaalocal.h"
|
|
|
|
#include "gcstruct.h"
|
|
|
|
#include "pixmapstr.h"
|
|
|
|
#include "xaawrap.h"
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAFillSpansFallback(DrawablePtr pDraw,
|
|
|
|
GC * pGC,
|
|
|
|
int nInit,
|
|
|
|
DDXPointPtr pptInit, int *pwidthInit, int fSorted)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->FillSpans) (pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAASetSpansFallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC,
|
|
|
|
char *pcharsrc,
|
|
|
|
register DDXPointPtr ppt,
|
|
|
|
int *pwidth, int nspans, int fSorted)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->SetSpans) (pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAPutImageFallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC,
|
|
|
|
int depth,
|
|
|
|
int x, int y, int w, int h,
|
|
|
|
int leftPad, int format, char *pImage)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->PutImage) (pDraw, pGC, depth, x, y, w, h,
|
|
|
|
leftPad, format, pImage);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static RegionPtr
|
2012-06-10 07:21:05 -06:00
|
|
|
XAACopyAreaFallback(DrawablePtr pSrc,
|
|
|
|
DrawablePtr pDst,
|
|
|
|
GC * pGC,
|
|
|
|
int srcx, int srcy,
|
|
|
|
int width, int height, int dstx, int dsty)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
RegionPtr ret;
|
|
|
|
|
|
|
|
XAA_GC_OP_PROLOGUE(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
if ((pSrc->type == DRAWABLE_WINDOW) || (pDst->type == DRAWABLE_WINDOW) ||
|
|
|
|
IS_OFFSCREEN_PIXMAP(pSrc) || IS_OFFSCREEN_PIXMAP(pDst)) {
|
|
|
|
SYNC_CHECK(pGC);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2012-06-10 07:21:05 -06:00
|
|
|
ret = (*pGC->ops->CopyArea) (pSrc, pDst,
|
|
|
|
pGC, srcx, srcy, width, height, dstx, dsty);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static RegionPtr
|
2012-06-10 07:21:05 -06:00
|
|
|
XAACopyPlaneFallback(DrawablePtr pSrc,
|
|
|
|
DrawablePtr pDst,
|
|
|
|
GCPtr pGC,
|
|
|
|
int srcx, int srcy,
|
|
|
|
int width, int height,
|
|
|
|
int dstx, int dsty, unsigned long bitPlane)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
RegionPtr ret;
|
|
|
|
|
|
|
|
XAA_GC_OP_PROLOGUE(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
if ((pSrc->type == DRAWABLE_WINDOW) || (pDst->type == DRAWABLE_WINDOW) ||
|
|
|
|
IS_OFFSCREEN_PIXMAP(pSrc) || IS_OFFSCREEN_PIXMAP(pDst)) {
|
|
|
|
SYNC_CHECK(pGC);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2012-06-10 07:21:05 -06:00
|
|
|
ret = (*pGC->ops->CopyPlane) (pSrc, pDst,
|
|
|
|
pGC, srcx, srcy, width, height, dstx, dsty,
|
|
|
|
bitPlane);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAPolyPointFallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC, int mode, int npt, xPoint * pptInit)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->PolyPoint) (pDraw, pGC, mode, npt, pptInit);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAPolylinesFallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC, int mode, int npt, DDXPointPtr pptInit)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->Polylines) (pDraw, pGC, mode, npt, pptInit);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static void
|
|
|
|
XAAPolySegmentFallback(DrawablePtr pDraw, GCPtr pGC, int nseg, xSegment * pSeg)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->PolySegment) (pDraw, pGC, nseg, pSeg);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAPolyRectangleFallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC, int nRectsInit, xRectangle *pRectsInit)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->PolyRectangle) (pDraw, pGC, nRectsInit, pRectsInit);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAPolyArcFallback(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->PolyArc) (pDraw, pGC, narcs, parcs);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAFillPolygonFallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC,
|
|
|
|
int shape, int mode, int count, DDXPointPtr ptsIn)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->FillPolygon) (pDraw, pGC, shape, mode, count, ptsIn);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static void
|
|
|
|
XAAPolyFillRectFallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC, int nrectFill, xRectangle *prectInit)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->PolyFillRect) (pDraw, pGC, nrectFill, prectInit);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAPolyFillArcFallback(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, parcs);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAPolyText8Fallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC, int x, int y, int count, char *chars)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
XAA_GC_OP_PROLOGUE(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
ret = (*pGC->ops->PolyText8) (pDraw, pGC, x, y, count, chars);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAPolyText16Fallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC, int x, int y, int count, unsigned short *chars)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
XAA_GC_OP_PROLOGUE(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
ret = (*pGC->ops->PolyText16) (pDraw, pGC, x, y, count, chars);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAImageText8Fallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC, int x, int y, int count, char *chars)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->ImageText8) (pDraw, pGC, x, y, count, chars);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAImageText16Fallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC,
|
|
|
|
int x, int y, int count, unsigned short *chars)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->ImageText16) (pDraw, pGC, x, y, count, chars);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAImageGlyphBltFallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC,
|
|
|
|
int xInit, int yInit,
|
|
|
|
unsigned int nglyph,
|
|
|
|
CharInfoPtr * ppci, pointer pglyphBase)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->ImageGlyphBlt) (pDraw, pGC, xInit, yInit, nglyph, ppci,
|
|
|
|
pglyphBase);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAPolyGlyphBltFallback(DrawablePtr pDraw,
|
|
|
|
GCPtr pGC,
|
|
|
|
int xInit, int yInit,
|
|
|
|
unsigned int nglyph,
|
|
|
|
CharInfoPtr * ppci, pointer pglyphBase)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->PolyGlyphBlt) (pDraw, pGC, xInit, yInit, nglyph, ppci,
|
|
|
|
pglyphBase);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAPushPixelsFallback(GCPtr pGC,
|
|
|
|
PixmapPtr pBitMap,
|
|
|
|
DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
|
|
|
|
SYNC_CHECK(pGC);
|
2012-06-10 07:21:05 -06:00
|
|
|
(*pGC->ops->PushPixels) (pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
|
2006-11-26 11:13:41 -07:00
|
|
|
XAA_GC_OP_EPILOGUE(pGC);
|
|
|
|
}
|
|
|
|
|
|
|
|
GCOps XAAFallbackOps = {
|
2012-06-10 07:21:05 -06:00
|
|
|
XAAFillSpansFallback, XAASetSpansFallback,
|
|
|
|
XAAPutImageFallback, XAACopyAreaFallback,
|
|
|
|
XAACopyPlaneFallback, XAAPolyPointFallback,
|
|
|
|
XAAPolylinesFallback, XAAPolySegmentFallback,
|
|
|
|
XAAPolyRectangleFallback, XAAPolyArcFallback,
|
|
|
|
XAAFillPolygonFallback, XAAPolyFillRectFallback,
|
|
|
|
XAAPolyFillArcFallback, XAAPolyText8Fallback,
|
|
|
|
XAAPolyText16Fallback, XAAImageText8Fallback,
|
|
|
|
XAAImageText16Fallback, XAAImageGlyphBltFallback,
|
2006-11-26 11:13:41 -07:00
|
|
|
XAAPolyGlyphBltFallback, XAAPushPixelsFallback,
|
|
|
|
};
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
GCOps *
|
|
|
|
XAAGetFallbackOps(void)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
return &XAAFallbackOps;
|
|
|
|
}
|