2004-07-31 10:24:14 +02:00
|
|
|
|
/*
|
|
|
|
|
* Copyright <EFBFBD> 2004 Eric Anholt
|
|
|
|
|
*
|
|
|
|
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
|
* documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
|
* the above copyright notice appear in all copies and that both that
|
|
|
|
|
* copyright notice and this permission notice appear in supporting
|
|
|
|
|
* documentation, and that the name of Eric Anholt not be used in
|
|
|
|
|
* advertising or publicity pertaining to distribution of the software without
|
|
|
|
|
* specific, written prior permission. Eric Anholt makes no
|
|
|
|
|
* representations about the suitability of this software for any purpose. It
|
|
|
|
|
* is provided "as is" without express or implied warranty.
|
|
|
|
|
*
|
|
|
|
|
* ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
|
|
|
|
* EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
|
|
|
|
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
|
|
|
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
|
|
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
*/
|
|
|
|
|
/* $Header$ */
|
|
|
|
|
|
|
|
|
|
#include "picturestr.h"
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* One of these structures is allocated per GC that gets used with a window with
|
|
|
|
|
* backing pixmap.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
GCPtr pBackingGC; /* Copy of the GC but with graphicsExposures
|
|
|
|
|
* set FALSE and the clientClip set to
|
|
|
|
|
* clip output to the valid regions of the
|
|
|
|
|
* backing pixmap. */
|
|
|
|
|
unsigned long serialNumber; /* clientClip computed time */
|
|
|
|
|
unsigned long stateChanges; /* changes in parent gc since last copy */
|
|
|
|
|
GCOps *wrapOps; /* wrapped ops */
|
|
|
|
|
GCFuncs *wrapFuncs; /* wrapped funcs */
|
|
|
|
|
} cwGCRec, *cwGCPtr;
|
|
|
|
|
|
|
|
|
|
extern int cwGCIndex;
|
|
|
|
|
|
|
|
|
|
#define getCwGC(pGC) ((cwGCPtr)(pGC)->devPrivates[cwGCIndex].ptr)
|
|
|
|
|
#define setCwGC(pGC,p) ((pGC)->devPrivates[cwGCIndex].ptr = (pointer) (p))
|
|
|
|
|
|
|
|
|
|
extern int cwPictureIndex;
|
|
|
|
|
|
2004-08-03 07:49:48 +02:00
|
|
|
|
#define cwDrawableIsRedirWindow(pDraw) \
|
|
|
|
|
((pDraw)->type == DRAWABLE_WINDOW && \
|
|
|
|
|
((*(pDraw)->pScreen->GetWindowPixmap)((WindowPtr)(pDraw)) != \
|
|
|
|
|
(*(pDraw)->pScreen->GetScreenPixmap)((pDraw)->pScreen)))
|
2004-07-31 10:24:14 +02:00
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
/*
|
|
|
|
|
* screen func wrappers
|
|
|
|
|
*/
|
2004-08-03 07:49:48 +02:00
|
|
|
|
CloseScreenProcPtr CloseScreen;
|
|
|
|
|
GetImageProcPtr GetImage;
|
|
|
|
|
GetSpansProcPtr GetSpans;
|
|
|
|
|
CreateGCProcPtr CreateGC;
|
2004-07-31 10:24:14 +02:00
|
|
|
|
|
2004-08-03 07:49:48 +02:00
|
|
|
|
PaintWindowBackgroundProcPtr PaintWindowBackground;
|
|
|
|
|
PaintWindowBorderProcPtr PaintWindowBorder;
|
2004-07-31 10:24:14 +02:00
|
|
|
|
|
|
|
|
|
#ifdef RENDER
|
|
|
|
|
CreatePictureProcPtr CreatePicture;
|
|
|
|
|
DestroyPictureProcPtr DestroyPicture;
|
|
|
|
|
ChangePictureClipProcPtr ChangePictureClip;
|
|
|
|
|
DestroyPictureClipProcPtr DestroyPictureClip;
|
|
|
|
|
|
|
|
|
|
ChangePictureProcPtr ChangePicture;
|
|
|
|
|
ValidatePictureProcPtr ValidatePicture;
|
|
|
|
|
|
|
|
|
|
CompositeProcPtr Composite;
|
|
|
|
|
GlyphsProcPtr Glyphs;
|
|
|
|
|
CompositeRectsProcPtr CompositeRects;
|
|
|
|
|
|
|
|
|
|
TrapezoidsProcPtr Trapezoids;
|
|
|
|
|
TrianglesProcPtr Triangles;
|
|
|
|
|
TriStripProcPtr TriStrip;
|
|
|
|
|
TriFanProcPtr TriFan;
|
|
|
|
|
|
|
|
|
|
RasterizeTrapezoidProcPtr RasterizeTrapezoid;
|
|
|
|
|
#if 0
|
|
|
|
|
AddTrapsProcPtr AddTraps;
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
} cwScreenRec, *cwScreenPtr;
|
|
|
|
|
|
|
|
|
|
extern int cwScreenIndex;
|
|
|
|
|
|
|
|
|
|
#define getCwScreen(pScreen) ((cwScreenPtr)(pScreen)->devPrivates[cwScreenIndex].ptr)
|
|
|
|
|
#define setCwScreen(pScreen,p) ((cwScreenPtr)(pScreen)->devPrivates[cwScreenIndex].ptr = (p))
|
|
|
|
|
|
2004-08-03 07:49:48 +02:00
|
|
|
|
#define CW_OFFSET_XYPOINTS(ppt, npt) do { \
|
|
|
|
|
DDXPointPtr _ppt = (DDXPointPtr)(ppt); \
|
2004-07-31 10:24:14 +02:00
|
|
|
|
int _i; \
|
|
|
|
|
for (_i = 0; _i < npt; _i++) { \
|
2004-08-03 07:49:48 +02:00
|
|
|
|
_ppt[_i].x += dst_off_x; \
|
|
|
|
|
_ppt[_i].y += dst_off_y; \
|
2004-07-31 10:24:14 +02:00
|
|
|
|
} \
|
|
|
|
|
} while (0)
|
|
|
|
|
|
2004-08-03 07:49:48 +02:00
|
|
|
|
#define CW_OFFSET_RECTS(prect, nrect) do { \
|
2004-07-31 10:24:14 +02:00
|
|
|
|
int _i; \
|
|
|
|
|
for (_i = 0; _i < nrect; _i++) { \
|
2004-08-03 07:49:48 +02:00
|
|
|
|
(prect)[_i].x += dst_off_x; \
|
|
|
|
|
(prect)[_i].y += dst_off_y; \
|
2004-07-31 10:24:14 +02:00
|
|
|
|
} \
|
|
|
|
|
} while (0)
|
|
|
|
|
|
2004-08-03 07:49:48 +02:00
|
|
|
|
#define CW_OFFSET_ARCS(parc, narc) do { \
|
2004-07-31 10:24:14 +02:00
|
|
|
|
int _i; \
|
|
|
|
|
for (_i = 0; _i < narc; _i++) { \
|
2004-08-03 07:49:48 +02:00
|
|
|
|
(parc)[_i].x += dst_off_x; \
|
|
|
|
|
(parc)[_i].y += dst_off_y; \
|
2004-07-31 10:24:14 +02:00
|
|
|
|
} \
|
|
|
|
|
} while (0)
|
|
|
|
|
|
2004-08-03 07:49:48 +02:00
|
|
|
|
#define CW_OFFSET_XY_DST(x, y) do { \
|
|
|
|
|
(x) = (x) + dst_off_x; \
|
|
|
|
|
(y) = (y) + dst_off_y; \
|
2004-07-31 10:24:14 +02:00
|
|
|
|
} while (0)
|
|
|
|
|
|
2004-08-03 07:49:48 +02:00
|
|
|
|
#define CW_OFFSET_XY_SRC(x, y) do { \
|
|
|
|
|
(x) = (x) + src_off_x; \
|
|
|
|
|
(y) = (y) + src_off_y; \
|
2004-07-31 10:24:14 +02:00
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
/* cw.c */
|
|
|
|
|
DrawablePtr
|
|
|
|
|
cwGetBackingDrawable(DrawablePtr pDrawable, int *x_off, int *y_off);
|
|
|
|
|
|
|
|
|
|
/* cw_render.c */
|
|
|
|
|
|
2004-08-05 20:24:58 +02:00
|
|
|
|
void
|
2004-07-31 10:24:14 +02:00
|
|
|
|
cwInitializeRender (ScreenPtr pScreen);
|
|
|
|
|
|
2004-08-06 02:31:28 +02:00
|
|
|
|
void
|
|
|
|
|
cwFiniRender (ScreenPtr pScreen);
|
|
|
|
|
|
2004-07-31 10:24:14 +02:00
|
|
|
|
/* cw.c */
|
|
|
|
|
void
|
|
|
|
|
miInitializeCompositeWrapper(ScreenPtr pScreen);
|