mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
376
render/animcur.c
376
render/animcur.c
@@ -48,35 +48,36 @@
|
||||
#include "xace.h"
|
||||
|
||||
typedef struct _AnimCurElt {
|
||||
CursorPtr pCursor; /* cursor to show */
|
||||
CARD32 delay; /* in ms */
|
||||
CursorPtr pCursor; /* cursor to show */
|
||||
CARD32 delay; /* in ms */
|
||||
} AnimCurElt;
|
||||
|
||||
typedef struct _AnimCur {
|
||||
int nelt; /* number of elements in the elts array */
|
||||
AnimCurElt *elts; /* actually allocated right after the structure */
|
||||
int nelt; /* number of elements in the elts array */
|
||||
AnimCurElt *elts; /* actually allocated right after the structure */
|
||||
} AnimCurRec, *AnimCurPtr;
|
||||
|
||||
typedef struct _AnimScrPriv {
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
|
||||
ScreenBlockHandlerProcPtr BlockHandler;
|
||||
ScreenBlockHandlerProcPtr BlockHandler;
|
||||
|
||||
CursorLimitsProcPtr CursorLimits;
|
||||
DisplayCursorProcPtr DisplayCursor;
|
||||
SetCursorPositionProcPtr SetCursorPosition;
|
||||
RealizeCursorProcPtr RealizeCursor;
|
||||
UnrealizeCursorProcPtr UnrealizeCursor;
|
||||
RecolorCursorProcPtr RecolorCursor;
|
||||
CursorLimitsProcPtr CursorLimits;
|
||||
DisplayCursorProcPtr DisplayCursor;
|
||||
SetCursorPositionProcPtr SetCursorPosition;
|
||||
RealizeCursorProcPtr RealizeCursor;
|
||||
UnrealizeCursorProcPtr UnrealizeCursor;
|
||||
RecolorCursorProcPtr RecolorCursor;
|
||||
} AnimCurScreenRec, *AnimCurScreenPtr;
|
||||
|
||||
static unsigned char empty[4];
|
||||
|
||||
static CursorBits animCursorBits = {
|
||||
static CursorBits animCursorBits = {
|
||||
empty, empty, 2, 1, 1, 0, 0, 1
|
||||
};
|
||||
|
||||
static DevPrivateKeyRec AnimCurScreenPrivateKeyRec;
|
||||
|
||||
#define AnimCurScreenPrivateKey (&AnimCurScreenPrivateKeyRec)
|
||||
|
||||
#define IsAnimCur(c) ((c) && ((c)->bits == &animCursorBits))
|
||||
@@ -87,12 +88,11 @@ static DevPrivateKeyRec AnimCurScreenPrivateKeyRec;
|
||||
#define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func)
|
||||
#define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
|
||||
|
||||
|
||||
static Bool
|
||||
AnimCurCloseScreen (int index, ScreenPtr pScreen)
|
||||
AnimCurCloseScreen(int index, ScreenPtr pScreen)
|
||||
{
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
Bool ret;
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
Bool ret;
|
||||
|
||||
Unwrap(as, pScreen, CloseScreen);
|
||||
|
||||
@@ -102,35 +102,30 @@ AnimCurCloseScreen (int index, ScreenPtr pScreen)
|
||||
Unwrap(as, pScreen, RealizeCursor);
|
||||
Unwrap(as, pScreen, UnrealizeCursor);
|
||||
Unwrap(as, pScreen, RecolorCursor);
|
||||
SetAnimCurScreen(pScreen,0);
|
||||
SetAnimCurScreen(pScreen, 0);
|
||||
ret = (*pScreen->CloseScreen) (index, pScreen);
|
||||
free(as);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
AnimCurCursorLimits (DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen,
|
||||
CursorPtr pCursor,
|
||||
BoxPtr pHotBox,
|
||||
BoxPtr pTopLeftBox)
|
||||
static void
|
||||
AnimCurCursorLimits(DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen,
|
||||
CursorPtr pCursor, BoxPtr pHotBox, BoxPtr pTopLeftBox)
|
||||
{
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
|
||||
Unwrap (as, pScreen, CursorLimits);
|
||||
if (IsAnimCur(pCursor))
|
||||
{
|
||||
AnimCurPtr ac = GetAnimCur(pCursor);
|
||||
Unwrap(as, pScreen, CursorLimits);
|
||||
if (IsAnimCur(pCursor)) {
|
||||
AnimCurPtr ac = GetAnimCur(pCursor);
|
||||
|
||||
(*pScreen->CursorLimits) (pDev, pScreen, ac->elts[0].pCursor,
|
||||
pHotBox, pTopLeftBox);
|
||||
(*pScreen->CursorLimits) (pDev, pScreen, ac->elts[0].pCursor,
|
||||
pHotBox, pTopLeftBox);
|
||||
}
|
||||
else
|
||||
{
|
||||
(*pScreen->CursorLimits) (pDev, pScreen, pCursor,
|
||||
pHotBox, pTopLeftBox);
|
||||
else {
|
||||
(*pScreen->CursorLimits) (pDev, pScreen, pCursor, pHotBox, pTopLeftBox);
|
||||
}
|
||||
Wrap (as, pScreen, CursorLimits, AnimCurCursorLimits);
|
||||
Wrap(as, pScreen, CursorLimits, AnimCurCursorLimits);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -140,209 +135,188 @@ AnimCurCursorLimits (DeviceIntPtr pDev,
|
||||
*/
|
||||
|
||||
static void
|
||||
AnimCurScreenBlockHandler (int screenNum,
|
||||
pointer blockData,
|
||||
pointer pTimeout,
|
||||
pointer pReadmask)
|
||||
AnimCurScreenBlockHandler(int screenNum,
|
||||
pointer blockData,
|
||||
pointer pTimeout, pointer pReadmask)
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[screenNum];
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
DeviceIntPtr dev;
|
||||
Bool activeDevice = FALSE;
|
||||
CARD32 now = 0,
|
||||
soonest = ~0; /* earliest time to wakeup again */
|
||||
ScreenPtr pScreen = screenInfo.screens[screenNum];
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
DeviceIntPtr dev;
|
||||
Bool activeDevice = FALSE;
|
||||
CARD32 now = 0, soonest = ~0; /* earliest time to wakeup again */
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next)
|
||||
{
|
||||
if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen)
|
||||
{
|
||||
if (!activeDevice) {
|
||||
now = GetTimeInMillis ();
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) {
|
||||
if (!activeDevice) {
|
||||
now = GetTimeInMillis();
|
||||
activeDevice = TRUE;
|
||||
}
|
||||
|
||||
if ((INT32) (now - dev->spriteInfo->anim.time) >= 0)
|
||||
{
|
||||
AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor);
|
||||
int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt;
|
||||
DisplayCursorProcPtr DisplayCursor;
|
||||
if ((INT32) (now - dev->spriteInfo->anim.time) >= 0) {
|
||||
AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor);
|
||||
int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt;
|
||||
DisplayCursorProcPtr DisplayCursor;
|
||||
|
||||
/*
|
||||
* Not a simple Unwrap/Wrap as this
|
||||
* isn't called along the DisplayCursor
|
||||
* wrapper chain.
|
||||
*/
|
||||
DisplayCursor = pScreen->DisplayCursor;
|
||||
pScreen->DisplayCursor = as->DisplayCursor;
|
||||
(void) (*pScreen->DisplayCursor) (dev,
|
||||
pScreen,
|
||||
ac->elts[elt].pCursor);
|
||||
as->DisplayCursor = pScreen->DisplayCursor;
|
||||
pScreen->DisplayCursor = DisplayCursor;
|
||||
/*
|
||||
* Not a simple Unwrap/Wrap as this
|
||||
* isn't called along the DisplayCursor
|
||||
* wrapper chain.
|
||||
*/
|
||||
DisplayCursor = pScreen->DisplayCursor;
|
||||
pScreen->DisplayCursor = as->DisplayCursor;
|
||||
(void) (*pScreen->DisplayCursor) (dev,
|
||||
pScreen,
|
||||
ac->elts[elt].pCursor);
|
||||
as->DisplayCursor = pScreen->DisplayCursor;
|
||||
pScreen->DisplayCursor = DisplayCursor;
|
||||
|
||||
dev->spriteInfo->anim.elt = elt;
|
||||
dev->spriteInfo->anim.time = now + ac->elts[elt].delay;
|
||||
}
|
||||
dev->spriteInfo->anim.elt = elt;
|
||||
dev->spriteInfo->anim.time = now + ac->elts[elt].delay;
|
||||
}
|
||||
|
||||
if (soonest > dev->spriteInfo->anim.time)
|
||||
soonest = dev->spriteInfo->anim.time;
|
||||
}
|
||||
if (soonest > dev->spriteInfo->anim.time)
|
||||
soonest = dev->spriteInfo->anim.time;
|
||||
}
|
||||
}
|
||||
|
||||
if (activeDevice)
|
||||
AdjustWaitForDelay (pTimeout, soonest - now);
|
||||
AdjustWaitForDelay(pTimeout, soonest - now);
|
||||
|
||||
Unwrap (as, pScreen, BlockHandler);
|
||||
Unwrap(as, pScreen, BlockHandler);
|
||||
(*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
|
||||
if (activeDevice)
|
||||
Wrap (as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
|
||||
Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
|
||||
else
|
||||
as->BlockHandler = NULL;
|
||||
}
|
||||
|
||||
static Bool
|
||||
AnimCurDisplayCursor (DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen,
|
||||
CursorPtr pCursor)
|
||||
AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
||||
{
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
Bool ret;
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
Bool ret;
|
||||
|
||||
if (IsFloating(pDev))
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
|
||||
Unwrap (as, pScreen, DisplayCursor);
|
||||
if (IsAnimCur(pCursor))
|
||||
{
|
||||
if (pCursor != pDev->spriteInfo->anim.pCursor)
|
||||
{
|
||||
AnimCurPtr ac = GetAnimCur(pCursor);
|
||||
Unwrap(as, pScreen, DisplayCursor);
|
||||
if (IsAnimCur(pCursor)) {
|
||||
if (pCursor != pDev->spriteInfo->anim.pCursor) {
|
||||
AnimCurPtr ac = GetAnimCur(pCursor);
|
||||
|
||||
ret = (*pScreen->DisplayCursor)
|
||||
ret = (*pScreen->DisplayCursor)
|
||||
(pDev, pScreen, ac->elts[0].pCursor);
|
||||
if (ret)
|
||||
{
|
||||
pDev->spriteInfo->anim.elt = 0;
|
||||
pDev->spriteInfo->anim.time = GetTimeInMillis () + ac->elts[0].delay;
|
||||
pDev->spriteInfo->anim.pCursor = pCursor;
|
||||
pDev->spriteInfo->anim.pScreen = pScreen;
|
||||
if (ret) {
|
||||
pDev->spriteInfo->anim.elt = 0;
|
||||
pDev->spriteInfo->anim.time =
|
||||
GetTimeInMillis() + ac->elts[0].delay;
|
||||
pDev->spriteInfo->anim.pCursor = pCursor;
|
||||
pDev->spriteInfo->anim.pScreen = pScreen;
|
||||
|
||||
if (!as->BlockHandler)
|
||||
Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
|
||||
}
|
||||
}
|
||||
else
|
||||
ret = TRUE;
|
||||
if (!as->BlockHandler)
|
||||
Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
|
||||
}
|
||||
}
|
||||
else
|
||||
ret = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
pDev->spriteInfo->anim.pCursor = 0;
|
||||
pDev->spriteInfo->anim.pScreen = 0;
|
||||
ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
|
||||
else {
|
||||
pDev->spriteInfo->anim.pCursor = 0;
|
||||
pDev->spriteInfo->anim.pScreen = 0;
|
||||
ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
|
||||
}
|
||||
Wrap (as, pScreen, DisplayCursor, AnimCurDisplayCursor);
|
||||
Wrap(as, pScreen, DisplayCursor, AnimCurDisplayCursor);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static Bool
|
||||
AnimCurSetCursorPosition (DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen,
|
||||
int x,
|
||||
int y,
|
||||
Bool generateEvent)
|
||||
AnimCurSetCursorPosition(DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen, int x, int y, Bool generateEvent)
|
||||
{
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
Bool ret;
|
||||
|
||||
Unwrap (as, pScreen, SetCursorPosition);
|
||||
if (pDev->spriteInfo->anim.pCursor) {
|
||||
pDev->spriteInfo->anim.pScreen = pScreen;
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
Bool ret;
|
||||
|
||||
if (!as->BlockHandler)
|
||||
Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
|
||||
Unwrap(as, pScreen, SetCursorPosition);
|
||||
if (pDev->spriteInfo->anim.pCursor) {
|
||||
pDev->spriteInfo->anim.pScreen = pScreen;
|
||||
|
||||
if (!as->BlockHandler)
|
||||
Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
|
||||
}
|
||||
ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent);
|
||||
Wrap (as, pScreen, SetCursorPosition, AnimCurSetCursorPosition);
|
||||
Wrap(as, pScreen, SetCursorPosition, AnimCurSetCursorPosition);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static Bool
|
||||
AnimCurRealizeCursor (DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen,
|
||||
CursorPtr pCursor)
|
||||
static Bool
|
||||
AnimCurRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
||||
{
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
Bool ret;
|
||||
|
||||
Unwrap (as, pScreen, RealizeCursor);
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
Bool ret;
|
||||
|
||||
Unwrap(as, pScreen, RealizeCursor);
|
||||
if (IsAnimCur(pCursor))
|
||||
ret = TRUE;
|
||||
ret = TRUE;
|
||||
else
|
||||
ret = (*pScreen->RealizeCursor) (pDev, pScreen, pCursor);
|
||||
Wrap (as, pScreen, RealizeCursor, AnimCurRealizeCursor);
|
||||
ret = (*pScreen->RealizeCursor) (pDev, pScreen, pCursor);
|
||||
Wrap(as, pScreen, RealizeCursor, AnimCurRealizeCursor);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static Bool
|
||||
AnimCurUnrealizeCursor (DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen,
|
||||
CursorPtr pCursor)
|
||||
static Bool
|
||||
AnimCurUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
||||
{
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
Bool ret;
|
||||
|
||||
Unwrap (as, pScreen, UnrealizeCursor);
|
||||
if (IsAnimCur(pCursor))
|
||||
{
|
||||
AnimCurPtr ac = GetAnimCur(pCursor);
|
||||
int i;
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
Bool ret;
|
||||
|
||||
if (pScreen->myNum == 0)
|
||||
for (i = 0; i < ac->nelt; i++)
|
||||
FreeCursor (ac->elts[i].pCursor, 0);
|
||||
ret = TRUE;
|
||||
Unwrap(as, pScreen, UnrealizeCursor);
|
||||
if (IsAnimCur(pCursor)) {
|
||||
AnimCurPtr ac = GetAnimCur(pCursor);
|
||||
int i;
|
||||
|
||||
if (pScreen->myNum == 0)
|
||||
for (i = 0; i < ac->nelt; i++)
|
||||
FreeCursor(ac->elts[i].pCursor, 0);
|
||||
ret = TRUE;
|
||||
}
|
||||
else
|
||||
ret = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor);
|
||||
Wrap (as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
|
||||
ret = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor);
|
||||
Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
AnimCurRecolorCursor (DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen,
|
||||
CursorPtr pCursor,
|
||||
Bool displayed)
|
||||
AnimCurRecolorCursor(DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen, CursorPtr pCursor, Bool displayed)
|
||||
{
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
|
||||
Unwrap (as, pScreen, RecolorCursor);
|
||||
if (IsAnimCur(pCursor))
|
||||
{
|
||||
AnimCurPtr ac = GetAnimCur(pCursor);
|
||||
int i;
|
||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||
|
||||
Unwrap(as, pScreen, RecolorCursor);
|
||||
if (IsAnimCur(pCursor)) {
|
||||
AnimCurPtr ac = GetAnimCur(pCursor);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ac->nelt; i++)
|
||||
(*pScreen->RecolorCursor) (pDev, pScreen, ac->elts[i].pCursor,
|
||||
displayed &&
|
||||
pDev->spriteInfo->anim.elt == i);
|
||||
(*pScreen->RecolorCursor) (pDev, pScreen, ac->elts[i].pCursor,
|
||||
displayed &&
|
||||
pDev->spriteInfo->anim.elt == i);
|
||||
}
|
||||
else
|
||||
(*pScreen->RecolorCursor) (pDev, pScreen, pCursor, displayed);
|
||||
Wrap (as, pScreen, RecolorCursor, AnimCurRecolorCursor);
|
||||
(*pScreen->RecolorCursor) (pDev, pScreen, pCursor, displayed);
|
||||
Wrap(as, pScreen, RecolorCursor, AnimCurRecolorCursor);
|
||||
}
|
||||
|
||||
Bool
|
||||
AnimCurInit (ScreenPtr pScreen)
|
||||
AnimCurInit(ScreenPtr pScreen)
|
||||
{
|
||||
AnimCurScreenPtr as;
|
||||
AnimCurScreenPtr as;
|
||||
|
||||
if (!dixRegisterPrivateKey(&AnimCurScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
|
||||
as = (AnimCurScreenPtr) malloc(sizeof (AnimCurScreenRec));
|
||||
as = (AnimCurScreenPtr) malloc(sizeof(AnimCurScreenRec));
|
||||
if (!as)
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen);
|
||||
|
||||
as->BlockHandler = NULL;
|
||||
@@ -353,38 +327,39 @@ AnimCurInit (ScreenPtr pScreen)
|
||||
Wrap(as, pScreen, RealizeCursor, AnimCurRealizeCursor);
|
||||
Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
|
||||
Wrap(as, pScreen, RecolorCursor, AnimCurRecolorCursor);
|
||||
SetAnimCurScreen(pScreen,as);
|
||||
SetAnimCurScreen(pScreen, as);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor, ClientPtr client, XID cid)
|
||||
AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
|
||||
CursorPtr *ppCursor, ClientPtr client, XID cid)
|
||||
{
|
||||
CursorPtr pCursor;
|
||||
int rc, i;
|
||||
AnimCurPtr ac;
|
||||
CursorPtr pCursor;
|
||||
int rc, i;
|
||||
AnimCurPtr ac;
|
||||
|
||||
for (i = 0; i < screenInfo.numScreens; i++)
|
||||
if (!GetAnimCurScreen (screenInfo.screens[i]))
|
||||
return BadImplementation;
|
||||
if (!GetAnimCurScreen(screenInfo.screens[i]))
|
||||
return BadImplementation;
|
||||
|
||||
for (i = 0; i < ncursor; i++)
|
||||
if (IsAnimCur (cursors[i]))
|
||||
return BadMatch;
|
||||
|
||||
if (IsAnimCur(cursors[i]))
|
||||
return BadMatch;
|
||||
|
||||
pCursor = (CursorPtr) calloc(CURSOR_REC_SIZE +
|
||||
sizeof (AnimCurRec) +
|
||||
ncursor * sizeof (AnimCurElt), 1);
|
||||
sizeof(AnimCurRec) +
|
||||
ncursor * sizeof(AnimCurElt), 1);
|
||||
if (!pCursor)
|
||||
return BadAlloc;
|
||||
return BadAlloc;
|
||||
dixInitPrivates(pCursor, pCursor + 1, PRIVATE_CURSOR);
|
||||
pCursor->bits = &animCursorBits;
|
||||
pCursor->refcnt = 1;
|
||||
|
||||
|
||||
pCursor->foreRed = cursors[0]->foreRed;
|
||||
pCursor->foreGreen = cursors[0]->foreGreen;
|
||||
pCursor->foreBlue = cursors[0]->foreBlue;
|
||||
|
||||
|
||||
pCursor->backRed = cursors[0]->backRed;
|
||||
pCursor->backGreen = cursors[0]->backGreen;
|
||||
pCursor->backBlue = cursors[0]->backBlue;
|
||||
@@ -393,28 +368,27 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp
|
||||
|
||||
/* security creation/labeling check */
|
||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCursor,
|
||||
RT_NONE, NULL, DixCreateAccess);
|
||||
RT_NONE, NULL, DixCreateAccess);
|
||||
if (rc != Success) {
|
||||
dixFiniPrivates(pCursor, PRIVATE_CURSOR);
|
||||
free(pCursor);
|
||||
return rc;
|
||||
dixFiniPrivates(pCursor, PRIVATE_CURSOR);
|
||||
free(pCursor);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Fill in the AnimCurRec
|
||||
*/
|
||||
animCursorBits.refcnt++;
|
||||
ac = GetAnimCur (pCursor);
|
||||
ac = GetAnimCur(pCursor);
|
||||
ac->nelt = ncursor;
|
||||
ac->elts = (AnimCurElt *) (ac + 1);
|
||||
|
||||
for (i = 0; i < ncursor; i++)
|
||||
{
|
||||
cursors[i]->refcnt++;
|
||||
ac->elts[i].pCursor = cursors[i];
|
||||
ac->elts[i].delay = deltas[i];
|
||||
|
||||
for (i = 0; i < ncursor; i++) {
|
||||
cursors[i]->refcnt++;
|
||||
ac->elts[i].pCursor = cursors[i];
|
||||
ac->elts[i].delay = deltas[i];
|
||||
}
|
||||
|
||||
|
||||
*ppCursor = pCursor;
|
||||
return Success;
|
||||
}
|
||||
|
||||
329
render/filter.c
329
render/filter.c
@@ -40,40 +40,39 @@
|
||||
#include "picturestr.h"
|
||||
|
||||
static char **filterNames;
|
||||
static int nfilterNames;
|
||||
static int nfilterNames;
|
||||
|
||||
/*
|
||||
* standard but not required filters don't have constant indices
|
||||
*/
|
||||
|
||||
int
|
||||
PictureGetFilterId (const char *filter, int len, Bool makeit)
|
||||
PictureGetFilterId(const char *filter, int len, Bool makeit)
|
||||
{
|
||||
int i;
|
||||
char *name;
|
||||
char **names;
|
||||
int i;
|
||||
char *name;
|
||||
char **names;
|
||||
|
||||
if (len < 0)
|
||||
len = strlen (filter);
|
||||
len = strlen(filter);
|
||||
for (i = 0; i < nfilterNames; i++)
|
||||
if (!CompareISOLatin1Lowered ((const unsigned char *) filterNames[i], -1,
|
||||
(const unsigned char *) filter, len))
|
||||
return i;
|
||||
if (!CompareISOLatin1Lowered((const unsigned char *) filterNames[i], -1,
|
||||
(const unsigned char *) filter, len))
|
||||
return i;
|
||||
if (!makeit)
|
||||
return -1;
|
||||
return -1;
|
||||
name = malloc(len + 1);
|
||||
if (!name)
|
||||
return -1;
|
||||
memcpy (name, filter, len);
|
||||
return -1;
|
||||
memcpy(name, filter, len);
|
||||
name[len] = '\0';
|
||||
if (filterNames)
|
||||
names = realloc(filterNames, (nfilterNames + 1) * sizeof (char *));
|
||||
names = realloc(filterNames, (nfilterNames + 1) * sizeof(char *));
|
||||
else
|
||||
names = malloc(sizeof (char *));
|
||||
if (!names)
|
||||
{
|
||||
free(name);
|
||||
return -1;
|
||||
names = malloc(sizeof(char *));
|
||||
if (!names) {
|
||||
free(name);
|
||||
return -1;
|
||||
}
|
||||
filterNames = names;
|
||||
i = nfilterNames++;
|
||||
@@ -82,77 +81,78 @@ PictureGetFilterId (const char *filter, int len, Bool makeit)
|
||||
}
|
||||
|
||||
static Bool
|
||||
PictureSetDefaultIds (void)
|
||||
PictureSetDefaultIds(void)
|
||||
{
|
||||
/* careful here -- this list must match the #define values */
|
||||
|
||||
if (PictureGetFilterId (FilterNearest, -1, TRUE) != PictFilterNearest)
|
||||
return FALSE;
|
||||
if (PictureGetFilterId (FilterBilinear, -1, TRUE) != PictFilterBilinear)
|
||||
return FALSE;
|
||||
if (PictureGetFilterId(FilterNearest, -1, TRUE) != PictFilterNearest)
|
||||
return FALSE;
|
||||
if (PictureGetFilterId(FilterBilinear, -1, TRUE) != PictFilterBilinear)
|
||||
return FALSE;
|
||||
|
||||
if (PictureGetFilterId (FilterFast, -1, TRUE) != PictFilterFast)
|
||||
return FALSE;
|
||||
if (PictureGetFilterId (FilterGood, -1, TRUE) != PictFilterGood)
|
||||
return FALSE;
|
||||
if (PictureGetFilterId (FilterBest, -1, TRUE) != PictFilterBest)
|
||||
return FALSE;
|
||||
if (PictureGetFilterId(FilterFast, -1, TRUE) != PictFilterFast)
|
||||
return FALSE;
|
||||
if (PictureGetFilterId(FilterGood, -1, TRUE) != PictFilterGood)
|
||||
return FALSE;
|
||||
if (PictureGetFilterId(FilterBest, -1, TRUE) != PictFilterBest)
|
||||
return FALSE;
|
||||
|
||||
if (PictureGetFilterId (FilterConvolution, -1, TRUE) != PictFilterConvolution)
|
||||
return FALSE;
|
||||
if (PictureGetFilterId(FilterConvolution, -1, TRUE) !=
|
||||
PictFilterConvolution)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
char *
|
||||
PictureGetFilterName (int id)
|
||||
PictureGetFilterName(int id)
|
||||
{
|
||||
if (0 <= id && id < nfilterNames)
|
||||
return filterNames[id];
|
||||
return filterNames[id];
|
||||
else
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
PictureFreeFilterIds (void)
|
||||
PictureFreeFilterIds(void)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nfilterNames; i++)
|
||||
free(filterNames[i]);
|
||||
free(filterNames[i]);
|
||||
free(filterNames);
|
||||
nfilterNames = 0;
|
||||
filterNames = 0;
|
||||
}
|
||||
|
||||
int
|
||||
PictureAddFilter (ScreenPtr pScreen,
|
||||
const char *filter,
|
||||
PictFilterValidateParamsProcPtr ValidateParams,
|
||||
int width,
|
||||
int height)
|
||||
PictureAddFilter(ScreenPtr pScreen,
|
||||
const char *filter,
|
||||
PictFilterValidateParamsProcPtr ValidateParams,
|
||||
int width, int height)
|
||||
{
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
int id = PictureGetFilterId (filter, -1, TRUE);
|
||||
int i;
|
||||
PictFilterPtr filters;
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
int id = PictureGetFilterId(filter, -1, TRUE);
|
||||
int i;
|
||||
PictFilterPtr filters;
|
||||
|
||||
if (id < 0)
|
||||
return -1;
|
||||
return -1;
|
||||
/*
|
||||
* It's an error to attempt to reregister a filter
|
||||
*/
|
||||
for (i = 0; i < ps->nfilters; i++)
|
||||
if (ps->filters[i].id == id)
|
||||
return -1;
|
||||
if (ps->filters[i].id == id)
|
||||
return -1;
|
||||
if (ps->filters)
|
||||
filters = realloc(ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec));
|
||||
filters =
|
||||
realloc(ps->filters, (ps->nfilters + 1) * sizeof(PictFilterRec));
|
||||
else
|
||||
filters = malloc(sizeof (PictFilterRec));
|
||||
filters = malloc(sizeof(PictFilterRec));
|
||||
if (!filters)
|
||||
return -1;
|
||||
return -1;
|
||||
ps->filters = filters;
|
||||
i = ps->nfilters++;
|
||||
ps->filters[i].name = PictureGetFilterName (id);
|
||||
ps->filters[i].name = PictureGetFilterName(id);
|
||||
ps->filters[i].id = id;
|
||||
ps->filters[i].ValidateParams = ValidateParams;
|
||||
ps->filters[i].width = width;
|
||||
@@ -161,79 +161,76 @@ PictureAddFilter (ScreenPtr pScreen,
|
||||
}
|
||||
|
||||
Bool
|
||||
PictureSetFilterAlias (ScreenPtr pScreen, const char *filter, const char *alias)
|
||||
PictureSetFilterAlias(ScreenPtr pScreen, const char *filter, const char *alias)
|
||||
{
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
int filter_id = PictureGetFilterId (filter, -1, FALSE);
|
||||
int alias_id = PictureGetFilterId (alias, -1, TRUE);
|
||||
int i;
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
int filter_id = PictureGetFilterId(filter, -1, FALSE);
|
||||
int alias_id = PictureGetFilterId(alias, -1, TRUE);
|
||||
int i;
|
||||
|
||||
if (filter_id < 0 || alias_id < 0)
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
for (i = 0; i < ps->nfilterAliases; i++)
|
||||
if (ps->filterAliases[i].alias_id == alias_id)
|
||||
break;
|
||||
if (i == ps->nfilterAliases)
|
||||
{
|
||||
PictFilterAliasPtr aliases;
|
||||
if (ps->filterAliases[i].alias_id == alias_id)
|
||||
break;
|
||||
if (i == ps->nfilterAliases) {
|
||||
PictFilterAliasPtr aliases;
|
||||
|
||||
if (ps->filterAliases)
|
||||
aliases = realloc(ps->filterAliases,
|
||||
(ps->nfilterAliases + 1) *
|
||||
sizeof (PictFilterAliasRec));
|
||||
else
|
||||
aliases = malloc(sizeof (PictFilterAliasRec));
|
||||
if (!aliases)
|
||||
return FALSE;
|
||||
ps->filterAliases = aliases;
|
||||
ps->filterAliases[i].alias = PictureGetFilterName (alias_id);
|
||||
ps->filterAliases[i].alias_id = alias_id;
|
||||
ps->nfilterAliases++;
|
||||
if (ps->filterAliases)
|
||||
aliases = realloc(ps->filterAliases,
|
||||
(ps->nfilterAliases + 1) *
|
||||
sizeof(PictFilterAliasRec));
|
||||
else
|
||||
aliases = malloc(sizeof(PictFilterAliasRec));
|
||||
if (!aliases)
|
||||
return FALSE;
|
||||
ps->filterAliases = aliases;
|
||||
ps->filterAliases[i].alias = PictureGetFilterName(alias_id);
|
||||
ps->filterAliases[i].alias_id = alias_id;
|
||||
ps->nfilterAliases++;
|
||||
}
|
||||
ps->filterAliases[i].filter_id = filter_id;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PictFilterPtr
|
||||
PictureFindFilter (ScreenPtr pScreen, char *name, int len)
|
||||
PictureFindFilter(ScreenPtr pScreen, char *name, int len)
|
||||
{
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
int id = PictureGetFilterId (name, len, FALSE);
|
||||
int i;
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
int id = PictureGetFilterId(name, len, FALSE);
|
||||
int i;
|
||||
|
||||
if (id < 0)
|
||||
return 0;
|
||||
return 0;
|
||||
/* Check for an alias, allow them to recurse */
|
||||
for (i = 0; i < ps->nfilterAliases; i++)
|
||||
if (ps->filterAliases[i].alias_id == id)
|
||||
{
|
||||
id = ps->filterAliases[i].filter_id;
|
||||
i = 0;
|
||||
}
|
||||
if (ps->filterAliases[i].alias_id == id) {
|
||||
id = ps->filterAliases[i].filter_id;
|
||||
i = 0;
|
||||
}
|
||||
/* find the filter */
|
||||
for (i = 0; i < ps->nfilters; i++)
|
||||
if (ps->filters[i].id == id)
|
||||
return &ps->filters[i];
|
||||
if (ps->filters[i].id == id)
|
||||
return &ps->filters[i];
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Bool
|
||||
convolutionFilterValidateParams (ScreenPtr pScreen,
|
||||
int filter,
|
||||
xFixed *params,
|
||||
int nparams,
|
||||
int *width,
|
||||
int *height)
|
||||
convolutionFilterValidateParams(ScreenPtr pScreen,
|
||||
int filter,
|
||||
xFixed * params,
|
||||
int nparams, int *width, int *height)
|
||||
{
|
||||
int w, h;
|
||||
int w, h;
|
||||
|
||||
if (nparams < 3)
|
||||
return FALSE;
|
||||
|
||||
if (xFixedFrac (params[0]) || xFixedFrac (params[1]))
|
||||
if (xFixedFrac(params[0]) || xFixedFrac(params[1]))
|
||||
return FALSE;
|
||||
|
||||
w = xFixedToInt (params[0]);
|
||||
h = xFixedToInt (params[1]);
|
||||
w = xFixedToInt(params[0]);
|
||||
h = xFixedToInt(params[1]);
|
||||
|
||||
nparams -= 2;
|
||||
if (w * h > nparams)
|
||||
@@ -244,117 +241,117 @@ convolutionFilterValidateParams (ScreenPtr pScreen,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
Bool
|
||||
PictureSetDefaultFilters (ScreenPtr pScreen)
|
||||
PictureSetDefaultFilters(ScreenPtr pScreen)
|
||||
{
|
||||
if (!filterNames)
|
||||
if (!PictureSetDefaultIds ())
|
||||
return FALSE;
|
||||
if (PictureAddFilter (pScreen, FilterNearest, 0, 1, 1) < 0)
|
||||
return FALSE;
|
||||
if (PictureAddFilter (pScreen, FilterBilinear, 0, 2, 2) < 0)
|
||||
return FALSE;
|
||||
if (!PictureSetDefaultIds())
|
||||
return FALSE;
|
||||
if (PictureAddFilter(pScreen, FilterNearest, 0, 1, 1) < 0)
|
||||
return FALSE;
|
||||
if (PictureAddFilter(pScreen, FilterBilinear, 0, 2, 2) < 0)
|
||||
return FALSE;
|
||||
|
||||
if (!PictureSetFilterAlias (pScreen, FilterNearest, FilterFast))
|
||||
return FALSE;
|
||||
if (!PictureSetFilterAlias (pScreen, FilterBilinear, FilterGood))
|
||||
return FALSE;
|
||||
if (!PictureSetFilterAlias (pScreen, FilterBilinear, FilterBest))
|
||||
return FALSE;
|
||||
if (!PictureSetFilterAlias(pScreen, FilterNearest, FilterFast))
|
||||
return FALSE;
|
||||
if (!PictureSetFilterAlias(pScreen, FilterBilinear, FilterGood))
|
||||
return FALSE;
|
||||
if (!PictureSetFilterAlias(pScreen, FilterBilinear, FilterBest))
|
||||
return FALSE;
|
||||
|
||||
if (PictureAddFilter (pScreen, FilterConvolution, convolutionFilterValidateParams, 0, 0) < 0)
|
||||
if (PictureAddFilter
|
||||
(pScreen, FilterConvolution, convolutionFilterValidateParams, 0, 0) < 0)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
PictureResetFilters (ScreenPtr pScreen)
|
||||
PictureResetFilters(ScreenPtr pScreen)
|
||||
{
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
|
||||
free(ps->filters);
|
||||
free(ps->filterAliases);
|
||||
PictureFreeFilterIds ();
|
||||
PictureFreeFilterIds();
|
||||
}
|
||||
|
||||
int
|
||||
SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams)
|
||||
SetPictureFilter(PicturePtr pPicture, char *name, int len, xFixed * params,
|
||||
int nparams)
|
||||
{
|
||||
PictFilterPtr pFilter;
|
||||
ScreenPtr pScreen;
|
||||
PictFilterPtr pFilter;
|
||||
ScreenPtr pScreen;
|
||||
|
||||
if (pPicture->pDrawable != NULL)
|
||||
pScreen = pPicture->pDrawable->pScreen;
|
||||
pScreen = pPicture->pDrawable->pScreen;
|
||||
else
|
||||
pScreen = screenInfo.screens[0];
|
||||
pScreen = screenInfo.screens[0];
|
||||
|
||||
pFilter = PictureFindFilter (pScreen, name, len);
|
||||
pFilter = PictureFindFilter(pScreen, name, len);
|
||||
|
||||
if (!pFilter)
|
||||
return BadName;
|
||||
return BadName;
|
||||
|
||||
if (pPicture->pDrawable == NULL)
|
||||
{
|
||||
int s;
|
||||
/* For source pictures, the picture isn't tied to a screen. So, ensure
|
||||
* that all screens can handle a filter we set for the picture.
|
||||
*/
|
||||
for (s = 1; s < screenInfo.numScreens; s++)
|
||||
{
|
||||
PictFilterPtr pScreenFilter;
|
||||
pScreenFilter = PictureFindFilter (screenInfo.screens[s],
|
||||
name, len);
|
||||
if (!pScreenFilter || pScreenFilter->id != pFilter->id)
|
||||
return BadMatch;
|
||||
}
|
||||
if (pPicture->pDrawable == NULL) {
|
||||
int s;
|
||||
|
||||
/* For source pictures, the picture isn't tied to a screen. So, ensure
|
||||
* that all screens can handle a filter we set for the picture.
|
||||
*/
|
||||
for (s = 1; s < screenInfo.numScreens; s++) {
|
||||
PictFilterPtr pScreenFilter;
|
||||
|
||||
pScreenFilter = PictureFindFilter(screenInfo.screens[s], name, len);
|
||||
if (!pScreenFilter || pScreenFilter->id != pFilter->id)
|
||||
return BadMatch;
|
||||
}
|
||||
}
|
||||
return SetPicturePictFilter (pPicture, pFilter, params, nparams);
|
||||
return SetPicturePictFilter(pPicture, pFilter, params, nparams);
|
||||
}
|
||||
|
||||
int
|
||||
SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter,
|
||||
xFixed *params, int nparams)
|
||||
SetPicturePictFilter(PicturePtr pPicture, PictFilterPtr pFilter,
|
||||
xFixed * params, int nparams)
|
||||
{
|
||||
ScreenPtr pScreen;
|
||||
int i;
|
||||
ScreenPtr pScreen;
|
||||
int i;
|
||||
|
||||
if (pPicture->pDrawable)
|
||||
pScreen = pPicture->pDrawable->pScreen;
|
||||
pScreen = pPicture->pDrawable->pScreen;
|
||||
else
|
||||
pScreen = screenInfo.screens[0];
|
||||
pScreen = screenInfo.screens[0];
|
||||
|
||||
if (pFilter->ValidateParams)
|
||||
{
|
||||
int width, height;
|
||||
if (!(*pFilter->ValidateParams) (pScreen, pFilter->id, params, nparams, &width, &height))
|
||||
return BadMatch;
|
||||
if (pFilter->ValidateParams) {
|
||||
int width, height;
|
||||
|
||||
if (!(*pFilter->ValidateParams)
|
||||
(pScreen, pFilter->id, params, nparams, &width, &height))
|
||||
return BadMatch;
|
||||
}
|
||||
else if (nparams)
|
||||
return BadMatch;
|
||||
return BadMatch;
|
||||
|
||||
if (nparams != pPicture->filter_nparams)
|
||||
{
|
||||
xFixed *new_params = malloc(nparams * sizeof (xFixed));
|
||||
if (!new_params && nparams)
|
||||
return BadAlloc;
|
||||
free(pPicture->filter_params);
|
||||
pPicture->filter_params = new_params;
|
||||
pPicture->filter_nparams = nparams;
|
||||
if (nparams != pPicture->filter_nparams) {
|
||||
xFixed *new_params = malloc(nparams * sizeof(xFixed));
|
||||
|
||||
if (!new_params && nparams)
|
||||
return BadAlloc;
|
||||
free(pPicture->filter_params);
|
||||
pPicture->filter_params = new_params;
|
||||
pPicture->filter_nparams = nparams;
|
||||
}
|
||||
for (i = 0; i < nparams; i++)
|
||||
pPicture->filter_params[i] = params[i];
|
||||
pPicture->filter_params[i] = params[i];
|
||||
pPicture->filter = pFilter->id;
|
||||
|
||||
if (pPicture->pDrawable)
|
||||
{
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
int result;
|
||||
if (pPicture->pDrawable) {
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
int result;
|
||||
|
||||
result = (*ps->ChangePictureFilter) (pPicture, pPicture->filter,
|
||||
params, nparams);
|
||||
return result;
|
||||
result = (*ps->ChangePictureFilter) (pPicture, pPicture->filter,
|
||||
params, nparams);
|
||||
return result;
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
874
render/glyph.c
874
render/glyph.c
File diff suppressed because it is too large
Load Diff
@@ -40,41 +40,41 @@
|
||||
#define GlyphFormatNum 5
|
||||
|
||||
typedef struct _Glyph {
|
||||
CARD32 refcnt;
|
||||
PrivateRec *devPrivates;
|
||||
unsigned char sha1[20];
|
||||
CARD32 size; /* info + bitmap */
|
||||
xGlyphInfo info;
|
||||
CARD32 refcnt;
|
||||
PrivateRec *devPrivates;
|
||||
unsigned char sha1[20];
|
||||
CARD32 size; /* info + bitmap */
|
||||
xGlyphInfo info;
|
||||
/* per-screen pixmaps follow */
|
||||
} GlyphRec, *GlyphPtr;
|
||||
|
||||
#define GlyphPicture(glyph) ((PicturePtr *) ((glyph) + 1))
|
||||
|
||||
typedef struct _GlyphRef {
|
||||
CARD32 signature;
|
||||
GlyphPtr glyph;
|
||||
CARD32 signature;
|
||||
GlyphPtr glyph;
|
||||
} GlyphRefRec, *GlyphRefPtr;
|
||||
|
||||
#define DeletedGlyph ((GlyphPtr) 1)
|
||||
|
||||
typedef struct _GlyphHashSet {
|
||||
CARD32 entries;
|
||||
CARD32 size;
|
||||
CARD32 rehash;
|
||||
CARD32 entries;
|
||||
CARD32 size;
|
||||
CARD32 rehash;
|
||||
} GlyphHashSetRec, *GlyphHashSetPtr;
|
||||
|
||||
typedef struct _GlyphHash {
|
||||
GlyphRefPtr table;
|
||||
GlyphRefPtr table;
|
||||
GlyphHashSetPtr hashSet;
|
||||
CARD32 tableEntries;
|
||||
CARD32 tableEntries;
|
||||
} GlyphHashRec, *GlyphHashPtr;
|
||||
|
||||
typedef struct _GlyphSet {
|
||||
CARD32 refcnt;
|
||||
int fdepth;
|
||||
PictFormatPtr format;
|
||||
GlyphHashRec hash;
|
||||
PrivateRec *devPrivates;
|
||||
CARD32 refcnt;
|
||||
int fdepth;
|
||||
PictFormatPtr format;
|
||||
GlyphHashRec hash;
|
||||
PrivateRec *devPrivates;
|
||||
} GlyphSetRec, *GlyphSetPtr;
|
||||
|
||||
#define GlyphSetGetPrivate(pGlyphSet,k) \
|
||||
@@ -84,64 +84,53 @@ typedef struct _GlyphSet {
|
||||
dixSetPrivate(&(pGlyphSet)->devPrivates, k, ptr)
|
||||
|
||||
typedef struct _GlyphList {
|
||||
INT16 xOff;
|
||||
INT16 yOff;
|
||||
CARD8 len;
|
||||
PictFormatPtr format;
|
||||
INT16 xOff;
|
||||
INT16 yOff;
|
||||
CARD8 len;
|
||||
PictFormatPtr format;
|
||||
} GlyphListRec, *GlyphListPtr;
|
||||
|
||||
extern _X_EXPORT void
|
||||
GlyphUninit (ScreenPtr pScreen);
|
||||
GlyphUninit(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT GlyphHashSetPtr
|
||||
FindGlyphHashSet (CARD32 filled);
|
||||
extern _X_EXPORT GlyphHashSetPtr FindGlyphHashSet(CARD32 filled);
|
||||
|
||||
extern _X_EXPORT GlyphRefPtr
|
||||
FindGlyphRef (GlyphHashPtr hash,
|
||||
CARD32 signature,
|
||||
Bool match,
|
||||
unsigned char sha1[20]);
|
||||
FindGlyphRef(GlyphHashPtr hash,
|
||||
CARD32 signature, Bool match, unsigned char sha1[20]);
|
||||
|
||||
extern _X_EXPORT GlyphPtr
|
||||
FindGlyphByHash (unsigned char sha1[20], int format);
|
||||
extern _X_EXPORT GlyphPtr FindGlyphByHash(unsigned char sha1[20], int format);
|
||||
|
||||
extern _X_EXPORT int
|
||||
HashGlyph (xGlyphInfo *gi,
|
||||
CARD8 *bits,
|
||||
unsigned long size,
|
||||
unsigned char sha1[20]);
|
||||
|
||||
HashGlyph(xGlyphInfo * gi,
|
||||
CARD8 *bits, unsigned long size, unsigned char sha1[20]);
|
||||
|
||||
extern _X_EXPORT void
|
||||
FreeGlyph (GlyphPtr glyph, int format);
|
||||
FreeGlyph(GlyphPtr glyph, int format);
|
||||
|
||||
extern _X_EXPORT void
|
||||
AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id);
|
||||
AddGlyph(GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
DeleteGlyph (GlyphSetPtr glyphSet, Glyph id);
|
||||
DeleteGlyph(GlyphSetPtr glyphSet, Glyph id);
|
||||
|
||||
extern _X_EXPORT GlyphPtr
|
||||
FindGlyph (GlyphSetPtr glyphSet, Glyph id);
|
||||
extern _X_EXPORT GlyphPtr FindGlyph(GlyphSetPtr glyphSet, Glyph id);
|
||||
|
||||
extern _X_EXPORT GlyphPtr
|
||||
AllocateGlyph (xGlyphInfo *gi, int format);
|
||||
extern _X_EXPORT GlyphPtr AllocateGlyph(xGlyphInfo * gi, int format);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet);
|
||||
AllocateGlyphHash(GlyphHashPtr hash, GlyphHashSetPtr hashSet);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global);
|
||||
ResizeGlyphHash(GlyphHashPtr hash, CARD32 change, Bool global);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change);
|
||||
ResizeGlyphSet(GlyphSetPtr glyphSet, CARD32 change);
|
||||
|
||||
extern _X_EXPORT GlyphSetPtr
|
||||
AllocateGlyphSet (int fdepth, PictFormatPtr format);
|
||||
extern _X_EXPORT GlyphSetPtr AllocateGlyphSet(int fdepth, PictFormatPtr format);
|
||||
|
||||
extern _X_EXPORT int
|
||||
FreeGlyphSet (pointer value,
|
||||
XID gid);
|
||||
FreeGlyphSet(pointer value, XID gid);
|
||||
|
||||
|
||||
|
||||
#endif /* _GLYPHSTR_H_ */
|
||||
#endif /* _GLYPHSTR_H_ */
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
#include "picturestr.h"
|
||||
|
||||
void
|
||||
PictTransform_from_xRenderTransform (PictTransformPtr pict,
|
||||
xRenderTransform *render)
|
||||
PictTransform_from_xRenderTransform(PictTransformPtr pict,
|
||||
xRenderTransform * render)
|
||||
{
|
||||
pict->matrix[0][0] = render->matrix11;
|
||||
pict->matrix[0][1] = render->matrix12;
|
||||
@@ -57,8 +57,8 @@ PictTransform_from_xRenderTransform (PictTransformPtr pict,
|
||||
}
|
||||
|
||||
void
|
||||
xRenderTransform_from_PictTransform (xRenderTransform *render,
|
||||
PictTransformPtr pict)
|
||||
xRenderTransform_from_PictTransform(xRenderTransform * render,
|
||||
PictTransformPtr pict)
|
||||
{
|
||||
render->matrix11 = pict->matrix[0][0];
|
||||
render->matrix12 = pict->matrix[0][1];
|
||||
@@ -74,15 +74,13 @@ xRenderTransform_from_PictTransform (xRenderTransform *render,
|
||||
}
|
||||
|
||||
Bool
|
||||
PictureTransformPoint (PictTransformPtr transform,
|
||||
PictVectorPtr vector)
|
||||
PictureTransformPoint(PictTransformPtr transform, PictVectorPtr vector)
|
||||
{
|
||||
return pixman_transform_point(transform, vector);
|
||||
return pixman_transform_point(transform, vector);
|
||||
}
|
||||
|
||||
Bool
|
||||
PictureTransformPoint3d (PictTransformPtr transform,
|
||||
PictVectorPtr vector)
|
||||
PictureTransformPoint3d(PictTransformPtr transform, PictVectorPtr vector)
|
||||
{
|
||||
return pixman_transform_point_3d(transform, vector);
|
||||
return pixman_transform_point_3d(transform, vector);
|
||||
}
|
||||
|
||||
432
render/miindex.c
432
render/miindex.c
@@ -41,254 +41,240 @@
|
||||
#define NUM_GRAY_LEVELS 13
|
||||
|
||||
static Bool
|
||||
miBuildRenderColormap (ColormapPtr pColormap, Pixel *pixels, int *nump)
|
||||
miBuildRenderColormap(ColormapPtr pColormap, Pixel * pixels, int *nump)
|
||||
{
|
||||
int r, g, b;
|
||||
unsigned short red, green, blue;
|
||||
Pixel pixel;
|
||||
Bool used[MI_MAX_INDEXED];
|
||||
int needed;
|
||||
int policy;
|
||||
int cube, gray;
|
||||
int i, n;
|
||||
|
||||
if (pColormap->mid != pColormap->pScreen->defColormap)
|
||||
{
|
||||
policy = PictureCmapPolicyAll;
|
||||
int r, g, b;
|
||||
unsigned short red, green, blue;
|
||||
Pixel pixel;
|
||||
Bool used[MI_MAX_INDEXED];
|
||||
int needed;
|
||||
int policy;
|
||||
int cube, gray;
|
||||
int i, n;
|
||||
|
||||
if (pColormap->mid != pColormap->pScreen->defColormap) {
|
||||
policy = PictureCmapPolicyAll;
|
||||
}
|
||||
else
|
||||
{
|
||||
int avail = pColormap->pVisual->ColormapEntries;
|
||||
policy = PictureCmapPolicy;
|
||||
if (policy == PictureCmapPolicyDefault)
|
||||
{
|
||||
if (avail >= 256 && (pColormap->pVisual->class|DynamicClass) == PseudoColor)
|
||||
policy = PictureCmapPolicyColor;
|
||||
else if (avail >= 64)
|
||||
policy = PictureCmapPolicyGray;
|
||||
else
|
||||
policy = PictureCmapPolicyMono;
|
||||
}
|
||||
else {
|
||||
int avail = pColormap->pVisual->ColormapEntries;
|
||||
|
||||
policy = PictureCmapPolicy;
|
||||
if (policy == PictureCmapPolicyDefault) {
|
||||
if (avail >= 256 &&
|
||||
(pColormap->pVisual->class | DynamicClass) == PseudoColor)
|
||||
policy = PictureCmapPolicyColor;
|
||||
else if (avail >= 64)
|
||||
policy = PictureCmapPolicyGray;
|
||||
else
|
||||
policy = PictureCmapPolicyMono;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Make sure enough cells are free for the chosen policy
|
||||
*/
|
||||
for (;;)
|
||||
{
|
||||
switch (policy) {
|
||||
case PictureCmapPolicyAll:
|
||||
needed = 0;
|
||||
break;
|
||||
case PictureCmapPolicyColor:
|
||||
needed = 71;
|
||||
break;
|
||||
case PictureCmapPolicyGray:
|
||||
needed = 11;
|
||||
break;
|
||||
case PictureCmapPolicyMono:
|
||||
default:
|
||||
needed = 0;
|
||||
break;
|
||||
}
|
||||
if (needed <= pColormap->freeRed)
|
||||
break;
|
||||
policy--;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
switch (policy) {
|
||||
case PictureCmapPolicyAll:
|
||||
needed = 0;
|
||||
break;
|
||||
case PictureCmapPolicyColor:
|
||||
needed = 71;
|
||||
break;
|
||||
case PictureCmapPolicyGray:
|
||||
needed = 11;
|
||||
break;
|
||||
case PictureCmapPolicyMono:
|
||||
default:
|
||||
needed = 0;
|
||||
break;
|
||||
}
|
||||
if (needed <= pColormap->freeRed)
|
||||
break;
|
||||
policy--;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute size of cube and gray ramps
|
||||
*/
|
||||
cube = gray = 0;
|
||||
switch (policy) {
|
||||
case PictureCmapPolicyAll:
|
||||
/*
|
||||
* Allocate as big a cube as possible
|
||||
*/
|
||||
if ((pColormap->pVisual->class|DynamicClass) == PseudoColor)
|
||||
{
|
||||
for (cube = 1; cube * cube * cube < pColormap->pVisual->ColormapEntries; cube++)
|
||||
;
|
||||
cube--;
|
||||
if (cube == 1)
|
||||
cube = 0;
|
||||
}
|
||||
else
|
||||
cube = 0;
|
||||
/*
|
||||
* Figure out how many gray levels to use so that they
|
||||
* line up neatly with the cube
|
||||
*/
|
||||
if (cube)
|
||||
{
|
||||
needed = pColormap->pVisual->ColormapEntries - (cube*cube*cube);
|
||||
/* levels to fill in with */
|
||||
gray = needed / (cube - 1);
|
||||
/* total levels */
|
||||
gray = (gray + 1) * (cube - 1) + 1;
|
||||
}
|
||||
else
|
||||
gray = pColormap->pVisual->ColormapEntries;
|
||||
break;
|
||||
|
||||
/*
|
||||
* Allocate as big a cube as possible
|
||||
*/
|
||||
if ((pColormap->pVisual->class | DynamicClass) == PseudoColor) {
|
||||
for (cube = 1;
|
||||
cube * cube * cube < pColormap->pVisual->ColormapEntries;
|
||||
cube++);
|
||||
cube--;
|
||||
if (cube == 1)
|
||||
cube = 0;
|
||||
}
|
||||
else
|
||||
cube = 0;
|
||||
/*
|
||||
* Figure out how many gray levels to use so that they
|
||||
* line up neatly with the cube
|
||||
*/
|
||||
if (cube) {
|
||||
needed = pColormap->pVisual->ColormapEntries - (cube * cube * cube);
|
||||
/* levels to fill in with */
|
||||
gray = needed / (cube - 1);
|
||||
/* total levels */
|
||||
gray = (gray + 1) * (cube - 1) + 1;
|
||||
}
|
||||
else
|
||||
gray = pColormap->pVisual->ColormapEntries;
|
||||
break;
|
||||
|
||||
case PictureCmapPolicyColor:
|
||||
cube = NUM_CUBE_LEVELS;
|
||||
/* fall through ... */
|
||||
cube = NUM_CUBE_LEVELS;
|
||||
/* fall through ... */
|
||||
case PictureCmapPolicyGray:
|
||||
gray = NUM_GRAY_LEVELS;
|
||||
break;
|
||||
gray = NUM_GRAY_LEVELS;
|
||||
break;
|
||||
case PictureCmapPolicyMono:
|
||||
default:
|
||||
gray = 2;
|
||||
break;
|
||||
gray = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
memset (used, '\0', pColormap->pVisual->ColormapEntries * sizeof (Bool));
|
||||
|
||||
memset(used, '\0', pColormap->pVisual->ColormapEntries * sizeof(Bool));
|
||||
for (r = 0; r < cube; r++)
|
||||
for (g = 0; g < cube; g++)
|
||||
for (b = 0; b < cube; b++)
|
||||
{
|
||||
pixel = 0;
|
||||
red = (r * 65535 + (cube-1)/2) / (cube - 1);
|
||||
green = (g * 65535 + (cube-1)/2) / (cube - 1);
|
||||
blue = (b * 65535 + (cube-1)/2) / (cube - 1);
|
||||
if (AllocColor (pColormap, &red, &green,
|
||||
&blue, &pixel, 0) != Success)
|
||||
return FALSE;
|
||||
used[pixel] = TRUE;
|
||||
}
|
||||
for (g = 0; g < gray; g++)
|
||||
{
|
||||
pixel = 0;
|
||||
red = green = blue = (g * 65535 + (gray-1)/2) / (gray - 1);
|
||||
if (AllocColor (pColormap, &red, &green, &blue, &pixel, 0) != Success)
|
||||
return FALSE;
|
||||
used[pixel] = TRUE;
|
||||
for (g = 0; g < cube; g++)
|
||||
for (b = 0; b < cube; b++) {
|
||||
pixel = 0;
|
||||
red = (r * 65535 + (cube - 1) / 2) / (cube - 1);
|
||||
green = (g * 65535 + (cube - 1) / 2) / (cube - 1);
|
||||
blue = (b * 65535 + (cube - 1) / 2) / (cube - 1);
|
||||
if (AllocColor(pColormap, &red, &green,
|
||||
&blue, &pixel, 0) != Success)
|
||||
return FALSE;
|
||||
used[pixel] = TRUE;
|
||||
}
|
||||
for (g = 0; g < gray; g++) {
|
||||
pixel = 0;
|
||||
red = green = blue = (g * 65535 + (gray - 1) / 2) / (gray - 1);
|
||||
if (AllocColor(pColormap, &red, &green, &blue, &pixel, 0) != Success)
|
||||
return FALSE;
|
||||
used[pixel] = TRUE;
|
||||
}
|
||||
n = 0;
|
||||
for (i = 0; i < pColormap->pVisual->ColormapEntries; i++)
|
||||
if (used[i])
|
||||
pixels[n++] = i;
|
||||
if (used[i])
|
||||
pixels[n++] = i;
|
||||
|
||||
*nump = n;
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 0 <= red, green, blue < 32 */
|
||||
static Pixel
|
||||
FindBestColor (miIndexedPtr pIndexed, Pixel *pixels, int num,
|
||||
int red, int green, int blue)
|
||||
FindBestColor(miIndexedPtr pIndexed, Pixel * pixels, int num,
|
||||
int red, int green, int blue)
|
||||
{
|
||||
Pixel best = pixels[0];
|
||||
int bestDist = 1 << 30;
|
||||
int dist;
|
||||
int dr, dg, db;
|
||||
while (num--)
|
||||
{
|
||||
Pixel pixel = *pixels++;
|
||||
CARD32 v = pIndexed->rgba[pixel];
|
||||
Pixel best = pixels[0];
|
||||
int bestDist = 1 << 30;
|
||||
int dist;
|
||||
int dr, dg, db;
|
||||
|
||||
dr = ((v >> 19) & 0x1f);
|
||||
dg = ((v >> 11) & 0x1f);
|
||||
db = ((v >> 3) & 0x1f);
|
||||
dr = dr - red;
|
||||
dg = dg - green;
|
||||
db = db - blue;
|
||||
dist = dr * dr + dg * dg + db * db;
|
||||
if (dist < bestDist)
|
||||
{
|
||||
bestDist = dist;
|
||||
best = pixel;
|
||||
}
|
||||
while (num--) {
|
||||
Pixel pixel = *pixels++;
|
||||
CARD32 v = pIndexed->rgba[pixel];
|
||||
|
||||
dr = ((v >> 19) & 0x1f);
|
||||
dg = ((v >> 11) & 0x1f);
|
||||
db = ((v >> 3) & 0x1f);
|
||||
dr = dr - red;
|
||||
dg = dg - green;
|
||||
db = db - blue;
|
||||
dist = dr * dr + dg * dg + db * db;
|
||||
if (dist < bestDist) {
|
||||
bestDist = dist;
|
||||
best = pixel;
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
/* 0 <= gray < 32768 */
|
||||
static Pixel
|
||||
FindBestGray (miIndexedPtr pIndexed, Pixel *pixels, int num, int gray)
|
||||
FindBestGray(miIndexedPtr pIndexed, Pixel * pixels, int num, int gray)
|
||||
{
|
||||
Pixel best = pixels[0];
|
||||
int bestDist = 1 << 30;
|
||||
int dist;
|
||||
int dr;
|
||||
int r;
|
||||
|
||||
while (num--)
|
||||
{
|
||||
Pixel pixel = *pixels++;
|
||||
CARD32 v = pIndexed->rgba[pixel];
|
||||
Pixel best = pixels[0];
|
||||
int bestDist = 1 << 30;
|
||||
int dist;
|
||||
int dr;
|
||||
int r;
|
||||
|
||||
r = v & 0xff;
|
||||
r = r | (r << 8);
|
||||
dr = gray - (r >> 1);
|
||||
dist = dr * dr;
|
||||
if (dist < bestDist)
|
||||
{
|
||||
bestDist = dist;
|
||||
best = pixel;
|
||||
}
|
||||
while (num--) {
|
||||
Pixel pixel = *pixels++;
|
||||
CARD32 v = pIndexed->rgba[pixel];
|
||||
|
||||
r = v & 0xff;
|
||||
r = r | (r << 8);
|
||||
dr = gray - (r >> 1);
|
||||
dist = dr * dr;
|
||||
if (dist < bestDist) {
|
||||
bestDist = dist;
|
||||
best = pixel;
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
Bool
|
||||
miInitIndexed (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat)
|
||||
miInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat)
|
||||
{
|
||||
ColormapPtr pColormap = pFormat->index.pColormap;
|
||||
VisualPtr pVisual = pColormap->pVisual;
|
||||
miIndexedPtr pIndexed;
|
||||
Pixel pixels[MI_MAX_INDEXED];
|
||||
xrgb rgb[MI_MAX_INDEXED];
|
||||
int num;
|
||||
int i;
|
||||
Pixel p, r, g, b;
|
||||
ColormapPtr pColormap = pFormat->index.pColormap;
|
||||
VisualPtr pVisual = pColormap->pVisual;
|
||||
miIndexedPtr pIndexed;
|
||||
Pixel pixels[MI_MAX_INDEXED];
|
||||
xrgb rgb[MI_MAX_INDEXED];
|
||||
int num;
|
||||
int i;
|
||||
Pixel p, r, g, b;
|
||||
|
||||
if (pVisual->ColormapEntries > MI_MAX_INDEXED)
|
||||
return FALSE;
|
||||
|
||||
if (pVisual->class & DynamicClass)
|
||||
{
|
||||
if (!miBuildRenderColormap (pColormap, pixels, &num))
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
|
||||
if (pVisual->class & DynamicClass) {
|
||||
if (!miBuildRenderColormap(pColormap, pixels, &num))
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = pVisual->ColormapEntries;
|
||||
for (p = 0; p < num; p++)
|
||||
pixels[p] = p;
|
||||
else {
|
||||
num = pVisual->ColormapEntries;
|
||||
for (p = 0; p < num; p++)
|
||||
pixels[p] = p;
|
||||
}
|
||||
|
||||
pIndexed = malloc(sizeof (miIndexedRec));
|
||||
|
||||
pIndexed = malloc(sizeof(miIndexedRec));
|
||||
if (!pIndexed)
|
||||
return FALSE;
|
||||
|
||||
return FALSE;
|
||||
|
||||
pFormat->index.nvalues = num;
|
||||
pFormat->index.pValues = malloc(num * sizeof (xIndexValue));
|
||||
if (!pFormat->index.pValues)
|
||||
{
|
||||
free(pIndexed);
|
||||
return FALSE;
|
||||
pFormat->index.pValues = malloc(num * sizeof(xIndexValue));
|
||||
if (!pFormat->index.pValues) {
|
||||
free(pIndexed);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Build mapping from pixel value to ARGB
|
||||
*/
|
||||
QueryColors (pColormap, num, pixels, rgb, serverClient);
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
p = pixels[i];
|
||||
pFormat->index.pValues[i].pixel = p;
|
||||
pFormat->index.pValues[i].red = rgb[i].red;
|
||||
pFormat->index.pValues[i].green = rgb[i].green;
|
||||
pFormat->index.pValues[i].blue = rgb[i].blue;
|
||||
pFormat->index.pValues[i].alpha = 0xffff;
|
||||
pIndexed->rgba[p] = (0xff000000 |
|
||||
((rgb[i].red & 0xff00) << 8) |
|
||||
((rgb[i].green & 0xff00) ) |
|
||||
((rgb[i].blue & 0xff00) >> 8));
|
||||
QueryColors(pColormap, num, pixels, rgb, serverClient);
|
||||
for (i = 0; i < num; i++) {
|
||||
p = pixels[i];
|
||||
pFormat->index.pValues[i].pixel = p;
|
||||
pFormat->index.pValues[i].red = rgb[i].red;
|
||||
pFormat->index.pValues[i].green = rgb[i].green;
|
||||
pFormat->index.pValues[i].blue = rgb[i].blue;
|
||||
pFormat->index.pValues[i].alpha = 0xffff;
|
||||
pIndexed->rgba[p] = (0xff000000 |
|
||||
((rgb[i].red & 0xff00) << 8) |
|
||||
((rgb[i].green & 0xff00)) |
|
||||
((rgb[i].blue & 0xff00) >> 8));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -297,30 +283,28 @@ miInitIndexed (ScreenPtr pScreen,
|
||||
*/
|
||||
switch (pVisual->class | DynamicClass) {
|
||||
case GrayScale:
|
||||
pIndexed->color = FALSE;
|
||||
for (r = 0; r < 32768; r++)
|
||||
pIndexed->ent[r] = FindBestGray (pIndexed, pixels, num, r);
|
||||
break;
|
||||
pIndexed->color = FALSE;
|
||||
for (r = 0; r < 32768; r++)
|
||||
pIndexed->ent[r] = FindBestGray(pIndexed, pixels, num, r);
|
||||
break;
|
||||
case PseudoColor:
|
||||
pIndexed->color = TRUE;
|
||||
p = 0;
|
||||
for (r = 0; r < 32; r++)
|
||||
for (g = 0; g < 32; g++)
|
||||
for (b = 0; b < 32; b++)
|
||||
{
|
||||
pIndexed->ent[p] = FindBestColor (pIndexed, pixels, num,
|
||||
r, g, b);
|
||||
p++;
|
||||
}
|
||||
break;
|
||||
pIndexed->color = TRUE;
|
||||
p = 0;
|
||||
for (r = 0; r < 32; r++)
|
||||
for (g = 0; g < 32; g++)
|
||||
for (b = 0; b < 32; b++) {
|
||||
pIndexed->ent[p] = FindBestColor(pIndexed, pixels, num,
|
||||
r, g, b);
|
||||
p++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
pFormat->index.devPrivate = pIndexed;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
miCloseIndexed (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat)
|
||||
miCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat)
|
||||
{
|
||||
free(pFormat->index.devPrivate);
|
||||
pFormat->index.devPrivate = NULL;
|
||||
@@ -329,24 +313,20 @@ miCloseIndexed (ScreenPtr pScreen,
|
||||
}
|
||||
|
||||
void
|
||||
miUpdateIndexed (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat,
|
||||
int ndef,
|
||||
xColorItem *pdef)
|
||||
miUpdateIndexed(ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat, int ndef, xColorItem * pdef)
|
||||
{
|
||||
miIndexedPtr pIndexed = pFormat->index.devPrivate;
|
||||
|
||||
if (pIndexed)
|
||||
{
|
||||
while (ndef--)
|
||||
{
|
||||
pIndexed->rgba[pdef->pixel] = (0xff000000 |
|
||||
((pdef->red & 0xff00) << 8) |
|
||||
((pdef->green & 0xff00) ) |
|
||||
((pdef->blue & 0xff00) >> 8));
|
||||
pdef++;
|
||||
}
|
||||
if (pIndexed) {
|
||||
while (ndef--) {
|
||||
pIndexed->rgba[pdef->pixel] = (0xff000000 |
|
||||
((pdef->red & 0xff00) << 8) |
|
||||
((pdef->green & 0xff00)) |
|
||||
((pdef->blue & 0xff00) >> 8));
|
||||
pdef++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _MIINDEX_H_ */
|
||||
#endif /* _MIINDEX_H_ */
|
||||
|
||||
764
render/mipict.c
764
render/mipict.c
@@ -34,76 +34,72 @@
|
||||
#include "mipict.h"
|
||||
|
||||
int
|
||||
miCreatePicture (PicturePtr pPicture)
|
||||
miCreatePicture(PicturePtr pPicture)
|
||||
{
|
||||
return Success;
|
||||
}
|
||||
|
||||
void
|
||||
miDestroyPicture (PicturePtr pPicture)
|
||||
miDestroyPicture(PicturePtr pPicture)
|
||||
{
|
||||
if (pPicture->freeCompClip)
|
||||
RegionDestroy(pPicture->pCompositeClip);
|
||||
RegionDestroy(pPicture->pCompositeClip);
|
||||
}
|
||||
|
||||
void
|
||||
miDestroyPictureClip (PicturePtr pPicture)
|
||||
miDestroyPictureClip(PicturePtr pPicture)
|
||||
{
|
||||
switch (pPicture->clientClipType) {
|
||||
case CT_NONE:
|
||||
return;
|
||||
return;
|
||||
case CT_PIXMAP:
|
||||
(*pPicture->pDrawable->pScreen->DestroyPixmap) ((PixmapPtr) (pPicture->clientClip));
|
||||
break;
|
||||
(*pPicture->pDrawable->pScreen->
|
||||
DestroyPixmap) ((PixmapPtr) (pPicture->clientClip));
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
* we know we'll never have a list of rectangles, since ChangeClip
|
||||
* immediately turns them into a region
|
||||
*/
|
||||
RegionDestroy(pPicture->clientClip);
|
||||
break;
|
||||
/*
|
||||
* we know we'll never have a list of rectangles, since ChangeClip
|
||||
* immediately turns them into a region
|
||||
*/
|
||||
RegionDestroy(pPicture->clientClip);
|
||||
break;
|
||||
}
|
||||
pPicture->clientClip = NULL;
|
||||
pPicture->clientClipType = CT_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
miChangePictureClip (PicturePtr pPicture,
|
||||
int type,
|
||||
pointer value,
|
||||
int n)
|
||||
miChangePictureClip(PicturePtr pPicture, int type, pointer value, int n)
|
||||
{
|
||||
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
pointer clientClip;
|
||||
int clientClipType;
|
||||
|
||||
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
pointer clientClip;
|
||||
int clientClipType;
|
||||
|
||||
switch (type) {
|
||||
case CT_PIXMAP:
|
||||
/* convert the pixmap to a region */
|
||||
clientClip = (pointer) BitmapToRegion(pScreen, (PixmapPtr) value);
|
||||
if (!clientClip)
|
||||
return BadAlloc;
|
||||
clientClipType = CT_REGION;
|
||||
(*pScreen->DestroyPixmap) ((PixmapPtr) value);
|
||||
break;
|
||||
/* convert the pixmap to a region */
|
||||
clientClip = (pointer) BitmapToRegion(pScreen, (PixmapPtr) value);
|
||||
if (!clientClip)
|
||||
return BadAlloc;
|
||||
clientClipType = CT_REGION;
|
||||
(*pScreen->DestroyPixmap) ((PixmapPtr) value);
|
||||
break;
|
||||
case CT_REGION:
|
||||
clientClip = value;
|
||||
clientClipType = CT_REGION;
|
||||
break;
|
||||
clientClip = value;
|
||||
clientClipType = CT_REGION;
|
||||
break;
|
||||
case CT_NONE:
|
||||
clientClip = 0;
|
||||
clientClipType = CT_NONE;
|
||||
break;
|
||||
clientClip = 0;
|
||||
clientClipType = CT_NONE;
|
||||
break;
|
||||
default:
|
||||
clientClip = (pointer) RegionFromRects(n,
|
||||
(xRectangle *) value,
|
||||
type);
|
||||
if (!clientClip)
|
||||
return BadAlloc;
|
||||
clientClipType = CT_REGION;
|
||||
free(value);
|
||||
break;
|
||||
clientClip = (pointer) RegionFromRects(n, (xRectangle *) value, type);
|
||||
if (!clientClip)
|
||||
return BadAlloc;
|
||||
clientClipType = CT_REGION;
|
||||
free(value);
|
||||
break;
|
||||
}
|
||||
(*ps->DestroyPictureClip) (pPicture);
|
||||
pPicture->clientClip = clientClip;
|
||||
@@ -113,149 +109,137 @@ miChangePictureClip (PicturePtr pPicture,
|
||||
}
|
||||
|
||||
void
|
||||
miChangePicture (PicturePtr pPicture,
|
||||
Mask mask)
|
||||
miChangePicture(PicturePtr pPicture, Mask mask)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
miValidatePicture (PicturePtr pPicture,
|
||||
Mask mask)
|
||||
miValidatePicture(PicturePtr pPicture, Mask mask)
|
||||
{
|
||||
DrawablePtr pDrawable = pPicture->pDrawable;
|
||||
DrawablePtr pDrawable = pPicture->pDrawable;
|
||||
|
||||
if ((mask & (CPClipXOrigin|CPClipYOrigin|CPClipMask|CPSubwindowMode)) ||
|
||||
(pDrawable->serialNumber != (pPicture->serialNumber & DRAWABLE_SERIAL_BITS)))
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
WindowPtr pWin = (WindowPtr) pDrawable;
|
||||
RegionPtr pregWin;
|
||||
Bool freeTmpClip, freeCompClip;
|
||||
if ((mask & (CPClipXOrigin | CPClipYOrigin | CPClipMask | CPSubwindowMode))
|
||||
|| (pDrawable->serialNumber !=
|
||||
(pPicture->serialNumber & DRAWABLE_SERIAL_BITS))) {
|
||||
if (pDrawable->type == DRAWABLE_WINDOW) {
|
||||
WindowPtr pWin = (WindowPtr) pDrawable;
|
||||
RegionPtr pregWin;
|
||||
Bool freeTmpClip, freeCompClip;
|
||||
|
||||
if (pPicture->subWindowMode == IncludeInferiors)
|
||||
{
|
||||
pregWin = NotClippedByChildren(pWin);
|
||||
freeTmpClip = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
pregWin = &pWin->clipList;
|
||||
freeTmpClip = FALSE;
|
||||
}
|
||||
freeCompClip = pPicture->freeCompClip;
|
||||
if (pPicture->subWindowMode == IncludeInferiors) {
|
||||
pregWin = NotClippedByChildren(pWin);
|
||||
freeTmpClip = TRUE;
|
||||
}
|
||||
else {
|
||||
pregWin = &pWin->clipList;
|
||||
freeTmpClip = FALSE;
|
||||
}
|
||||
freeCompClip = pPicture->freeCompClip;
|
||||
|
||||
/*
|
||||
* if there is no client clip, we can get by with just keeping the
|
||||
* pointer we got, and remembering whether or not should destroy
|
||||
* (or maybe re-use) it later. this way, we avoid unnecessary
|
||||
* copying of regions. (this wins especially if many clients clip
|
||||
* by children and have no client clip.)
|
||||
*/
|
||||
if (pPicture->clientClipType == CT_NONE)
|
||||
{
|
||||
if (freeCompClip)
|
||||
RegionDestroy(pPicture->pCompositeClip);
|
||||
pPicture->pCompositeClip = pregWin;
|
||||
pPicture->freeCompClip = freeTmpClip;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* we need one 'real' region to put into the composite clip. if
|
||||
* pregWin the current composite clip are real, we can get rid of
|
||||
* one. if pregWin is real and the current composite clip isn't,
|
||||
* use pregWin for the composite clip. if the current composite
|
||||
* clip is real and pregWin isn't, use the current composite
|
||||
* clip. if neither is real, create a new region.
|
||||
*/
|
||||
/*
|
||||
* if there is no client clip, we can get by with just keeping the
|
||||
* pointer we got, and remembering whether or not should destroy
|
||||
* (or maybe re-use) it later. this way, we avoid unnecessary
|
||||
* copying of regions. (this wins especially if many clients clip
|
||||
* by children and have no client clip.)
|
||||
*/
|
||||
if (pPicture->clientClipType == CT_NONE) {
|
||||
if (freeCompClip)
|
||||
RegionDestroy(pPicture->pCompositeClip);
|
||||
pPicture->pCompositeClip = pregWin;
|
||||
pPicture->freeCompClip = freeTmpClip;
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* we need one 'real' region to put into the composite clip. if
|
||||
* pregWin the current composite clip are real, we can get rid of
|
||||
* one. if pregWin is real and the current composite clip isn't,
|
||||
* use pregWin for the composite clip. if the current composite
|
||||
* clip is real and pregWin isn't, use the current composite
|
||||
* clip. if neither is real, create a new region.
|
||||
*/
|
||||
|
||||
RegionTranslate(pPicture->clientClip,
|
||||
pDrawable->x + pPicture->clipOrigin.x,
|
||||
pDrawable->y + pPicture->clipOrigin.y);
|
||||
RegionTranslate(pPicture->clientClip,
|
||||
pDrawable->x + pPicture->clipOrigin.x,
|
||||
pDrawable->y + pPicture->clipOrigin.y);
|
||||
|
||||
if (freeCompClip)
|
||||
{
|
||||
RegionIntersect(pPicture->pCompositeClip,
|
||||
pregWin, pPicture->clientClip);
|
||||
if (freeTmpClip)
|
||||
RegionDestroy(pregWin);
|
||||
}
|
||||
else if (freeTmpClip)
|
||||
{
|
||||
RegionIntersect(pregWin, pregWin, pPicture->clientClip);
|
||||
pPicture->pCompositeClip = pregWin;
|
||||
}
|
||||
else
|
||||
{
|
||||
pPicture->pCompositeClip = RegionCreate(NullBox, 0);
|
||||
RegionIntersect(pPicture->pCompositeClip,
|
||||
pregWin, pPicture->clientClip);
|
||||
}
|
||||
pPicture->freeCompClip = TRUE;
|
||||
RegionTranslate(pPicture->clientClip,
|
||||
-(pDrawable->x + pPicture->clipOrigin.x),
|
||||
-(pDrawable->y + pPicture->clipOrigin.y));
|
||||
}
|
||||
} /* end of composite clip for a window */
|
||||
else
|
||||
{
|
||||
BoxRec pixbounds;
|
||||
if (freeCompClip) {
|
||||
RegionIntersect(pPicture->pCompositeClip,
|
||||
pregWin, pPicture->clientClip);
|
||||
if (freeTmpClip)
|
||||
RegionDestroy(pregWin);
|
||||
}
|
||||
else if (freeTmpClip) {
|
||||
RegionIntersect(pregWin, pregWin, pPicture->clientClip);
|
||||
pPicture->pCompositeClip = pregWin;
|
||||
}
|
||||
else {
|
||||
pPicture->pCompositeClip = RegionCreate(NullBox, 0);
|
||||
RegionIntersect(pPicture->pCompositeClip,
|
||||
pregWin, pPicture->clientClip);
|
||||
}
|
||||
pPicture->freeCompClip = TRUE;
|
||||
RegionTranslate(pPicture->clientClip,
|
||||
-(pDrawable->x + pPicture->clipOrigin.x),
|
||||
-(pDrawable->y + pPicture->clipOrigin.y));
|
||||
}
|
||||
} /* end of composite clip for a window */
|
||||
else {
|
||||
BoxRec pixbounds;
|
||||
|
||||
/* XXX should we translate by drawable.x/y here ? */
|
||||
/* If you want pixmaps in offscreen memory, yes */
|
||||
pixbounds.x1 = pDrawable->x;
|
||||
pixbounds.y1 = pDrawable->y;
|
||||
pixbounds.x2 = pDrawable->x + pDrawable->width;
|
||||
pixbounds.y2 = pDrawable->y + pDrawable->height;
|
||||
/* XXX should we translate by drawable.x/y here ? */
|
||||
/* If you want pixmaps in offscreen memory, yes */
|
||||
pixbounds.x1 = pDrawable->x;
|
||||
pixbounds.y1 = pDrawable->y;
|
||||
pixbounds.x2 = pDrawable->x + pDrawable->width;
|
||||
pixbounds.y2 = pDrawable->y + pDrawable->height;
|
||||
|
||||
if (pPicture->freeCompClip)
|
||||
{
|
||||
RegionReset(pPicture->pCompositeClip, &pixbounds);
|
||||
}
|
||||
else
|
||||
{
|
||||
pPicture->freeCompClip = TRUE;
|
||||
pPicture->pCompositeClip = RegionCreate(&pixbounds, 1);
|
||||
}
|
||||
if (pPicture->freeCompClip) {
|
||||
RegionReset(pPicture->pCompositeClip, &pixbounds);
|
||||
}
|
||||
else {
|
||||
pPicture->freeCompClip = TRUE;
|
||||
pPicture->pCompositeClip = RegionCreate(&pixbounds, 1);
|
||||
}
|
||||
|
||||
if (pPicture->clientClipType == CT_REGION)
|
||||
{
|
||||
if(pDrawable->x || pDrawable->y) {
|
||||
RegionTranslate(pPicture->clientClip,
|
||||
pDrawable->x + pPicture->clipOrigin.x,
|
||||
pDrawable->y + pPicture->clipOrigin.y);
|
||||
RegionIntersect(pPicture->pCompositeClip,
|
||||
pPicture->pCompositeClip, pPicture->clientClip);
|
||||
RegionTranslate(pPicture->clientClip,
|
||||
-(pDrawable->x + pPicture->clipOrigin.x),
|
||||
-(pDrawable->y + pPicture->clipOrigin.y));
|
||||
} else {
|
||||
RegionTranslate(pPicture->pCompositeClip,
|
||||
-pPicture->clipOrigin.x, -pPicture->clipOrigin.y);
|
||||
RegionIntersect(pPicture->pCompositeClip,
|
||||
pPicture->pCompositeClip, pPicture->clientClip);
|
||||
RegionTranslate(pPicture->pCompositeClip,
|
||||
pPicture->clipOrigin.x, pPicture->clipOrigin.y);
|
||||
}
|
||||
}
|
||||
} /* end of composite clip for pixmap */
|
||||
if (pPicture->clientClipType == CT_REGION) {
|
||||
if (pDrawable->x || pDrawable->y) {
|
||||
RegionTranslate(pPicture->clientClip,
|
||||
pDrawable->x + pPicture->clipOrigin.x,
|
||||
pDrawable->y + pPicture->clipOrigin.y);
|
||||
RegionIntersect(pPicture->pCompositeClip,
|
||||
pPicture->pCompositeClip,
|
||||
pPicture->clientClip);
|
||||
RegionTranslate(pPicture->clientClip,
|
||||
-(pDrawable->x + pPicture->clipOrigin.x),
|
||||
-(pDrawable->y + pPicture->clipOrigin.y));
|
||||
}
|
||||
else {
|
||||
RegionTranslate(pPicture->pCompositeClip,
|
||||
-pPicture->clipOrigin.x,
|
||||
-pPicture->clipOrigin.y);
|
||||
RegionIntersect(pPicture->pCompositeClip,
|
||||
pPicture->pCompositeClip,
|
||||
pPicture->clientClip);
|
||||
RegionTranslate(pPicture->pCompositeClip,
|
||||
pPicture->clipOrigin.x,
|
||||
pPicture->clipOrigin.y);
|
||||
}
|
||||
}
|
||||
} /* end of composite clip for pixmap */
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
miChangePictureTransform (PicturePtr pPicture,
|
||||
PictTransform *transform)
|
||||
miChangePictureTransform(PicturePtr pPicture, PictTransform * transform)
|
||||
{
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
miChangePictureFilter (PicturePtr pPicture,
|
||||
int filter,
|
||||
xFixed *params,
|
||||
int nparams)
|
||||
miChangePictureFilter(PicturePtr pPicture,
|
||||
int filter, xFixed * params, int nparams)
|
||||
{
|
||||
return Success;
|
||||
}
|
||||
@@ -263,96 +247,85 @@ miChangePictureFilter (PicturePtr pPicture,
|
||||
#define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
|
||||
|
||||
static inline pixman_bool_t
|
||||
miClipPictureReg (pixman_region16_t * pRegion,
|
||||
pixman_region16_t * pClip,
|
||||
int dx,
|
||||
int dy)
|
||||
miClipPictureReg(pixman_region16_t * pRegion,
|
||||
pixman_region16_t * pClip, int dx, int dy)
|
||||
{
|
||||
if (pixman_region_n_rects(pRegion) == 1 &&
|
||||
pixman_region_n_rects(pClip) == 1)
|
||||
{
|
||||
pixman_box16_t * pRbox = pixman_region_rectangles(pRegion, NULL);
|
||||
pixman_box16_t * pCbox = pixman_region_rectangles(pClip, NULL);
|
||||
int v;
|
||||
|
||||
if (pRbox->x1 < (v = pCbox->x1 + dx))
|
||||
pRbox->x1 = BOUND(v);
|
||||
if (pRbox->x2 > (v = pCbox->x2 + dx))
|
||||
pRbox->x2 = BOUND(v);
|
||||
if (pRbox->y1 < (v = pCbox->y1 + dy))
|
||||
pRbox->y1 = BOUND(v);
|
||||
if (pRbox->y2 > (v = pCbox->y2 + dy))
|
||||
pRbox->y2 = BOUND(v);
|
||||
if (pRbox->x1 >= pRbox->x2 ||
|
||||
pRbox->y1 >= pRbox->y2)
|
||||
{
|
||||
pixman_region_init (pRegion);
|
||||
}
|
||||
pixman_region_n_rects(pClip) == 1) {
|
||||
pixman_box16_t *pRbox = pixman_region_rectangles(pRegion, NULL);
|
||||
pixman_box16_t *pCbox = pixman_region_rectangles(pClip, NULL);
|
||||
int v;
|
||||
|
||||
if (pRbox->x1 < (v = pCbox->x1 + dx))
|
||||
pRbox->x1 = BOUND(v);
|
||||
if (pRbox->x2 > (v = pCbox->x2 + dx))
|
||||
pRbox->x2 = BOUND(v);
|
||||
if (pRbox->y1 < (v = pCbox->y1 + dy))
|
||||
pRbox->y1 = BOUND(v);
|
||||
if (pRbox->y2 > (v = pCbox->y2 + dy))
|
||||
pRbox->y2 = BOUND(v);
|
||||
if (pRbox->x1 >= pRbox->x2 || pRbox->y1 >= pRbox->y2) {
|
||||
pixman_region_init(pRegion);
|
||||
}
|
||||
}
|
||||
else if (!pixman_region_not_empty (pClip))
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
if (dx || dy)
|
||||
pixman_region_translate (pRegion, -dx, -dy);
|
||||
if (!pixman_region_intersect (pRegion, pRegion, pClip))
|
||||
return FALSE;
|
||||
if (dx || dy)
|
||||
pixman_region_translate(pRegion, dx, dy);
|
||||
else if (!pixman_region_not_empty(pClip))
|
||||
return FALSE;
|
||||
else {
|
||||
if (dx || dy)
|
||||
pixman_region_translate(pRegion, -dx, -dy);
|
||||
if (!pixman_region_intersect(pRegion, pRegion, pClip))
|
||||
return FALSE;
|
||||
if (dx || dy)
|
||||
pixman_region_translate(pRegion, dx, dy);
|
||||
}
|
||||
return pixman_region_not_empty(pRegion);
|
||||
}
|
||||
|
||||
static inline Bool
|
||||
miClipPictureSrc (RegionPtr pRegion,
|
||||
PicturePtr pPicture,
|
||||
int dx,
|
||||
int dy)
|
||||
miClipPictureSrc(RegionPtr pRegion, PicturePtr pPicture, int dx, int dy)
|
||||
{
|
||||
if (pPicture->clientClipType != CT_NONE)
|
||||
{
|
||||
Bool result;
|
||||
|
||||
pixman_region_translate ( pPicture->clientClip,
|
||||
pPicture->clipOrigin.x + dx,
|
||||
pPicture->clipOrigin.y + dy);
|
||||
if (pPicture->clientClipType != CT_NONE) {
|
||||
Bool result;
|
||||
|
||||
result = RegionIntersect(pRegion, pRegion, pPicture->clientClip);
|
||||
|
||||
pixman_region_translate ( pPicture->clientClip,
|
||||
- (pPicture->clipOrigin.x + dx),
|
||||
- (pPicture->clipOrigin.y + dy));
|
||||
pixman_region_translate(pPicture->clientClip,
|
||||
pPicture->clipOrigin.x + dx,
|
||||
pPicture->clipOrigin.y + dy);
|
||||
|
||||
if (!result)
|
||||
return FALSE;
|
||||
result = RegionIntersect(pRegion, pRegion, pPicture->clientClip);
|
||||
|
||||
pixman_region_translate(pPicture->clientClip,
|
||||
-(pPicture->clipOrigin.x + dx),
|
||||
-(pPicture->clipOrigin.y + dy));
|
||||
|
||||
if (!result)
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
SourceValidateOnePicture (PicturePtr pPicture)
|
||||
SourceValidateOnePicture(PicturePtr pPicture)
|
||||
{
|
||||
DrawablePtr pDrawable = pPicture->pDrawable;
|
||||
ScreenPtr pScreen;
|
||||
DrawablePtr pDrawable = pPicture->pDrawable;
|
||||
ScreenPtr pScreen;
|
||||
|
||||
if (!pDrawable)
|
||||
return;
|
||||
|
||||
pScreen = pDrawable->pScreen;
|
||||
|
||||
if (pScreen->SourceValidate)
|
||||
{
|
||||
pScreen->SourceValidate (
|
||||
pDrawable, 0, 0, pDrawable->width, pDrawable->height, pPicture->subWindowMode);
|
||||
if (pScreen->SourceValidate) {
|
||||
pScreen->SourceValidate(pDrawable, 0, 0, pDrawable->width,
|
||||
pDrawable->height, pPicture->subWindowMode);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
miCompositeSourceValidate (PicturePtr pPicture)
|
||||
miCompositeSourceValidate(PicturePtr pPicture)
|
||||
{
|
||||
SourceValidateOnePicture (pPicture);
|
||||
SourceValidateOnePicture(pPicture);
|
||||
if (pPicture->alphaMap)
|
||||
SourceValidateOnePicture (pPicture->alphaMap);
|
||||
SourceValidateOnePicture(pPicture->alphaMap);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -361,21 +334,18 @@ miCompositeSourceValidate (PicturePtr pPicture)
|
||||
*/
|
||||
|
||||
Bool
|
||||
miComputeCompositeRegion (RegionPtr pRegion,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height)
|
||||
miComputeCompositeRegion(RegionPtr pRegion,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
|
||||
{
|
||||
|
||||
int v;
|
||||
|
||||
int v;
|
||||
|
||||
pRegion->extents.x1 = xDst;
|
||||
v = xDst + width;
|
||||
@@ -386,254 +356,226 @@ miComputeCompositeRegion (RegionPtr pRegion,
|
||||
pRegion->data = 0;
|
||||
/* Check for empty operation */
|
||||
if (pRegion->extents.x1 >= pRegion->extents.x2 ||
|
||||
pRegion->extents.y1 >= pRegion->extents.y2)
|
||||
{
|
||||
pixman_region_init (pRegion);
|
||||
return FALSE;
|
||||
pRegion->extents.y1 >= pRegion->extents.y2) {
|
||||
pixman_region_init(pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
/* clip against dst */
|
||||
if (!miClipPictureReg (pRegion, pDst->pCompositeClip, 0, 0))
|
||||
{
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
if (!miClipPictureReg(pRegion, pDst->pCompositeClip, 0, 0)) {
|
||||
pixman_region_fini(pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
if (pDst->alphaMap)
|
||||
{
|
||||
if (!miClipPictureReg (pRegion, pDst->alphaMap->pCompositeClip,
|
||||
-pDst->alphaOrigin.x,
|
||||
-pDst->alphaOrigin.y))
|
||||
{
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
if (pDst->alphaMap) {
|
||||
if (!miClipPictureReg(pRegion, pDst->alphaMap->pCompositeClip,
|
||||
-pDst->alphaOrigin.x, -pDst->alphaOrigin.y)) {
|
||||
pixman_region_fini(pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
/* clip against src */
|
||||
if (!miClipPictureSrc (pRegion, pSrc, xDst - xSrc, yDst - ySrc))
|
||||
{
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
if (!miClipPictureSrc(pRegion, pSrc, xDst - xSrc, yDst - ySrc)) {
|
||||
pixman_region_fini(pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
if (pSrc->alphaMap)
|
||||
{
|
||||
if (!miClipPictureSrc (pRegion, pSrc->alphaMap,
|
||||
xDst - (xSrc - pSrc->alphaOrigin.x),
|
||||
yDst - (ySrc - pSrc->alphaOrigin.y)))
|
||||
{
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
if (pSrc->alphaMap) {
|
||||
if (!miClipPictureSrc(pRegion, pSrc->alphaMap,
|
||||
xDst - (xSrc - pSrc->alphaOrigin.x),
|
||||
yDst - (ySrc - pSrc->alphaOrigin.y))) {
|
||||
pixman_region_fini(pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
/* clip against mask */
|
||||
if (pMask)
|
||||
{
|
||||
if (!miClipPictureSrc (pRegion, pMask, xDst - xMask, yDst - yMask))
|
||||
{
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
if (pMask->alphaMap)
|
||||
{
|
||||
if (!miClipPictureSrc (pRegion, pMask->alphaMap,
|
||||
xDst - (xMask - pMask->alphaOrigin.x),
|
||||
yDst - (yMask - pMask->alphaOrigin.y)))
|
||||
{
|
||||
pixman_region_fini (pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (pMask) {
|
||||
if (!miClipPictureSrc(pRegion, pMask, xDst - xMask, yDst - yMask)) {
|
||||
pixman_region_fini(pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
if (pMask->alphaMap) {
|
||||
if (!miClipPictureSrc(pRegion, pMask->alphaMap,
|
||||
xDst - (xMask - pMask->alphaOrigin.x),
|
||||
yDst - (yMask - pMask->alphaOrigin.y))) {
|
||||
pixman_region_fini(pRegion);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
miCompositeSourceValidate (pSrc);
|
||||
miCompositeSourceValidate(pSrc);
|
||||
if (pMask)
|
||||
miCompositeSourceValidate (pMask);
|
||||
miCompositeSourceValidate(pMask);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
miRenderColorToPixel (PictFormatPtr format,
|
||||
xRenderColor *color,
|
||||
CARD32 *pixel)
|
||||
miRenderColorToPixel(PictFormatPtr format, xRenderColor * color, CARD32 *pixel)
|
||||
{
|
||||
CARD32 r, g, b, a;
|
||||
miIndexedPtr pIndexed;
|
||||
CARD32 r, g, b, a;
|
||||
miIndexedPtr pIndexed;
|
||||
|
||||
switch (format->type) {
|
||||
case PictTypeDirect:
|
||||
r = color->red >> (16 - Ones (format->direct.redMask));
|
||||
g = color->green >> (16 - Ones (format->direct.greenMask));
|
||||
b = color->blue >> (16 - Ones (format->direct.blueMask));
|
||||
a = color->alpha >> (16 - Ones (format->direct.alphaMask));
|
||||
r = r << format->direct.red;
|
||||
g = g << format->direct.green;
|
||||
b = b << format->direct.blue;
|
||||
a = a << format->direct.alpha;
|
||||
*pixel = r|g|b|a;
|
||||
break;
|
||||
r = color->red >> (16 - Ones(format->direct.redMask));
|
||||
g = color->green >> (16 - Ones(format->direct.greenMask));
|
||||
b = color->blue >> (16 - Ones(format->direct.blueMask));
|
||||
a = color->alpha >> (16 - Ones(format->direct.alphaMask));
|
||||
r = r << format->direct.red;
|
||||
g = g << format->direct.green;
|
||||
b = b << format->direct.blue;
|
||||
a = a << format->direct.alpha;
|
||||
*pixel = r | g | b | a;
|
||||
break;
|
||||
case PictTypeIndexed:
|
||||
pIndexed = (miIndexedPtr) (format->index.devPrivate);
|
||||
if (pIndexed->color)
|
||||
{
|
||||
r = color->red >> 11;
|
||||
g = color->green >> 11;
|
||||
b = color->blue >> 11;
|
||||
*pixel = miIndexToEnt15 (pIndexed, (r << 10) | (g << 5) | b);
|
||||
}
|
||||
else
|
||||
{
|
||||
r = color->red >> 8;
|
||||
g = color->green >> 8;
|
||||
b = color->blue >> 8;
|
||||
*pixel = miIndexToEntY24 (pIndexed, (r << 16) | (g << 8) | b);
|
||||
}
|
||||
break;
|
||||
pIndexed = (miIndexedPtr) (format->index.devPrivate);
|
||||
if (pIndexed->color) {
|
||||
r = color->red >> 11;
|
||||
g = color->green >> 11;
|
||||
b = color->blue >> 11;
|
||||
*pixel = miIndexToEnt15(pIndexed, (r << 10) | (g << 5) | b);
|
||||
}
|
||||
else {
|
||||
r = color->red >> 8;
|
||||
g = color->green >> 8;
|
||||
b = color->blue >> 8;
|
||||
*pixel = miIndexToEntY24(pIndexed, (r << 16) | (g << 8) | b);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static CARD16
|
||||
miFillColor (CARD32 pixel, int bits)
|
||||
miFillColor(CARD32 pixel, int bits)
|
||||
{
|
||||
while (bits < 16)
|
||||
{
|
||||
pixel |= pixel << bits;
|
||||
bits <<= 1;
|
||||
while (bits < 16) {
|
||||
pixel |= pixel << bits;
|
||||
bits <<= 1;
|
||||
}
|
||||
return (CARD16) pixel;
|
||||
}
|
||||
|
||||
Bool
|
||||
miIsSolidAlpha (PicturePtr pSrc)
|
||||
miIsSolidAlpha(PicturePtr pSrc)
|
||||
{
|
||||
ScreenPtr pScreen;
|
||||
char line[1];
|
||||
ScreenPtr pScreen;
|
||||
char line[1];
|
||||
|
||||
if (!pSrc->pDrawable)
|
||||
return FALSE;
|
||||
|
||||
pScreen = pSrc->pDrawable->pScreen;
|
||||
|
||||
|
||||
/* Alpha-only */
|
||||
if (PICT_FORMAT_TYPE (pSrc->format) != PICT_TYPE_A)
|
||||
return FALSE;
|
||||
if (PICT_FORMAT_TYPE(pSrc->format) != PICT_TYPE_A)
|
||||
return FALSE;
|
||||
/* repeat */
|
||||
if (!pSrc->repeat)
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
/* 1x1 */
|
||||
if (pSrc->pDrawable->width != 1 || pSrc->pDrawable->height != 1)
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
line[0] = 1;
|
||||
(*pScreen->GetImage) (pSrc->pDrawable, 0, 0, 1, 1, ZPixmap, ~0L, line);
|
||||
switch (pSrc->pDrawable->bitsPerPixel) {
|
||||
case 1:
|
||||
return (CARD8) line[0] == 1 || (CARD8) line[0] == 0x80;
|
||||
return (CARD8) line[0] == 1 || (CARD8) line[0] == 0x80;
|
||||
case 4:
|
||||
return (CARD8) line[0] == 0xf || (CARD8) line[0] == 0xf0;
|
||||
return (CARD8) line[0] == 0xf || (CARD8) line[0] == 0xf0;
|
||||
case 8:
|
||||
return (CARD8) line[0] == 0xff;
|
||||
return (CARD8) line[0] == 0xff;
|
||||
default:
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
miRenderPixelToColor (PictFormatPtr format,
|
||||
CARD32 pixel,
|
||||
xRenderColor *color)
|
||||
miRenderPixelToColor(PictFormatPtr format, CARD32 pixel, xRenderColor * color)
|
||||
{
|
||||
CARD32 r, g, b, a;
|
||||
miIndexedPtr pIndexed;
|
||||
|
||||
CARD32 r, g, b, a;
|
||||
miIndexedPtr pIndexed;
|
||||
|
||||
switch (format->type) {
|
||||
case PictTypeDirect:
|
||||
r = (pixel >> format->direct.red) & format->direct.redMask;
|
||||
g = (pixel >> format->direct.green) & format->direct.greenMask;
|
||||
b = (pixel >> format->direct.blue) & format->direct.blueMask;
|
||||
a = (pixel >> format->direct.alpha) & format->direct.alphaMask;
|
||||
color->red = miFillColor (r, Ones (format->direct.redMask));
|
||||
color->green = miFillColor (g, Ones (format->direct.greenMask));
|
||||
color->blue = miFillColor (b, Ones (format->direct.blueMask));
|
||||
color->alpha = miFillColor (a, Ones (format->direct.alphaMask));
|
||||
break;
|
||||
r = (pixel >> format->direct.red) & format->direct.redMask;
|
||||
g = (pixel >> format->direct.green) & format->direct.greenMask;
|
||||
b = (pixel >> format->direct.blue) & format->direct.blueMask;
|
||||
a = (pixel >> format->direct.alpha) & format->direct.alphaMask;
|
||||
color->red = miFillColor(r, Ones(format->direct.redMask));
|
||||
color->green = miFillColor(g, Ones(format->direct.greenMask));
|
||||
color->blue = miFillColor(b, Ones(format->direct.blueMask));
|
||||
color->alpha = miFillColor(a, Ones(format->direct.alphaMask));
|
||||
break;
|
||||
case PictTypeIndexed:
|
||||
pIndexed = (miIndexedPtr) (format->index.devPrivate);
|
||||
pixel = pIndexed->rgba[pixel & (MI_MAX_INDEXED-1)];
|
||||
r = (pixel >> 16) & 0xff;
|
||||
g = (pixel >> 8) & 0xff;
|
||||
b = (pixel ) & 0xff;
|
||||
color->red = miFillColor (r, 8);
|
||||
color->green = miFillColor (g, 8);
|
||||
color->blue = miFillColor (b, 8);
|
||||
color->alpha = 0xffff;
|
||||
break;
|
||||
pIndexed = (miIndexedPtr) (format->index.devPrivate);
|
||||
pixel = pIndexed->rgba[pixel & (MI_MAX_INDEXED - 1)];
|
||||
r = (pixel >> 16) & 0xff;
|
||||
g = (pixel >> 8) & 0xff;
|
||||
b = (pixel) & 0xff;
|
||||
color->red = miFillColor(r, 8);
|
||||
color->green = miFillColor(g, 8);
|
||||
color->blue = miFillColor(b, 8);
|
||||
color->alpha = 0xffff;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
miTriStrip (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int npoints,
|
||||
xPointFixed *points)
|
||||
miTriStrip(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points)
|
||||
{
|
||||
xTriangle *tris, *tri;
|
||||
int ntri;
|
||||
xTriangle *tris, *tri;
|
||||
int ntri;
|
||||
|
||||
ntri = npoints - 2;
|
||||
tris = malloc(ntri * sizeof (xTriangle));
|
||||
tris = malloc(ntri * sizeof(xTriangle));
|
||||
if (!tris)
|
||||
return;
|
||||
|
||||
for (tri = tris; npoints >= 3; npoints--, points++, tri++)
|
||||
{
|
||||
for (tri = tris; npoints >= 3; npoints--, points++, tri++) {
|
||||
tri->p1 = points[0];
|
||||
tri->p2 = points[1];
|
||||
tri->p3 = points[2];
|
||||
}
|
||||
CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
|
||||
CompositeTriangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
|
||||
free(tris);
|
||||
}
|
||||
|
||||
void
|
||||
miTriFan (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int npoints,
|
||||
xPointFixed *points)
|
||||
miTriFan(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points)
|
||||
{
|
||||
xTriangle *tris, *tri;
|
||||
xPointFixed *first;
|
||||
int ntri;
|
||||
xTriangle *tris, *tri;
|
||||
xPointFixed *first;
|
||||
int ntri;
|
||||
|
||||
ntri = npoints - 2;
|
||||
tris = malloc(ntri * sizeof (xTriangle));
|
||||
tris = malloc(ntri * sizeof(xTriangle));
|
||||
if (!tris)
|
||||
return;
|
||||
return;
|
||||
|
||||
first = points++;
|
||||
for (tri = tris; npoints >= 3; npoints--, points++, tri++)
|
||||
{
|
||||
tri->p1 = *first;
|
||||
tri->p2 = points[0];
|
||||
tri->p3 = points[1];
|
||||
for (tri = tris; npoints >= 3; npoints--, points++, tri++) {
|
||||
tri->p1 = *first;
|
||||
tri->p2 = points[0];
|
||||
tri->p3 = points[1];
|
||||
}
|
||||
CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
|
||||
CompositeTriangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
|
||||
free(tris);
|
||||
}
|
||||
|
||||
Bool
|
||||
miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
|
||||
miPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
|
||||
{
|
||||
PictureScreenPtr ps;
|
||||
|
||||
if (!PictureInit (pScreen, formats, nformats))
|
||||
return FALSE;
|
||||
PictureScreenPtr ps;
|
||||
|
||||
if (!PictureInit(pScreen, formats, nformats))
|
||||
return FALSE;
|
||||
ps = GetPictureScreen(pScreen);
|
||||
ps->CreatePicture = miCreatePicture;
|
||||
ps->DestroyPicture = miDestroyPicture;
|
||||
@@ -650,18 +592,18 @@ miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
|
||||
ps->UnrealizeGlyph = miUnrealizeGlyph;
|
||||
|
||||
/* MI rendering routines */
|
||||
ps->Composite = 0; /* requires DDX support */
|
||||
ps->Glyphs = miGlyphs;
|
||||
ps->CompositeRects = miCompositeRects;
|
||||
ps->Trapezoids = 0;
|
||||
ps->Triangles = 0;
|
||||
|
||||
ps->RasterizeTrapezoid = 0; /* requires DDX support */
|
||||
ps->AddTraps = 0; /* requires DDX support */
|
||||
ps->AddTriangles = 0; /* requires DDX support */
|
||||
ps->Composite = 0; /* requires DDX support */
|
||||
ps->Glyphs = miGlyphs;
|
||||
ps->CompositeRects = miCompositeRects;
|
||||
ps->Trapezoids = 0;
|
||||
ps->Triangles = 0;
|
||||
|
||||
ps->TriStrip = miTriStrip; /* converts call to CompositeTriangles */
|
||||
ps->TriFan = miTriFan;
|
||||
ps->RasterizeTrapezoid = 0; /* requires DDX support */
|
||||
ps->AddTraps = 0; /* requires DDX support */
|
||||
ps->AddTriangles = 0; /* requires DDX support */
|
||||
|
||||
ps->TriStrip = miTriStrip; /* converts call to CompositeTriangles */
|
||||
ps->TriFan = miTriFan;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
153
render/mipict.h
153
render/mipict.h
@@ -27,16 +27,16 @@
|
||||
|
||||
#include "picturestr.h"
|
||||
|
||||
#define MI_MAX_INDEXED 256 /* XXX depth must be <= 8 */
|
||||
#define MI_MAX_INDEXED 256 /* XXX depth must be <= 8 */
|
||||
|
||||
#if MI_MAX_INDEXED <= 256
|
||||
typedef CARD8 miIndexType;
|
||||
#endif
|
||||
|
||||
typedef struct _miIndexed {
|
||||
Bool color;
|
||||
CARD32 rgba[MI_MAX_INDEXED];
|
||||
miIndexType ent[32768];
|
||||
Bool color;
|
||||
CARD32 rgba[MI_MAX_INDEXED];
|
||||
miIndexType ent[32768];
|
||||
} miIndexedRec, *miIndexedPtr;
|
||||
|
||||
#define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \
|
||||
@@ -48,138 +48,113 @@ typedef struct _miIndexed {
|
||||
#define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)])
|
||||
|
||||
extern _X_EXPORT int
|
||||
miCreatePicture (PicturePtr pPicture);
|
||||
miCreatePicture(PicturePtr pPicture);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miDestroyPicture (PicturePtr pPicture);
|
||||
miDestroyPicture(PicturePtr pPicture);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miDestroyPictureClip (PicturePtr pPicture);
|
||||
miDestroyPictureClip(PicturePtr pPicture);
|
||||
|
||||
extern _X_EXPORT int
|
||||
miChangePictureClip (PicturePtr pPicture,
|
||||
int type,
|
||||
pointer value,
|
||||
int n);
|
||||
miChangePictureClip(PicturePtr pPicture, int type, pointer value, int n);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miChangePicture (PicturePtr pPicture,
|
||||
Mask mask);
|
||||
miChangePicture(PicturePtr pPicture, Mask mask);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miValidatePicture (PicturePtr pPicture,
|
||||
Mask mask);
|
||||
miValidatePicture(PicturePtr pPicture, Mask mask);
|
||||
|
||||
extern _X_EXPORT int
|
||||
miChangePictureTransform (PicturePtr pPicture,
|
||||
PictTransform *transform);
|
||||
miChangePictureTransform(PicturePtr pPicture, PictTransform * transform);
|
||||
|
||||
extern _X_EXPORT int
|
||||
miChangePictureFilter (PicturePtr pPicture,
|
||||
int filter,
|
||||
xFixed *params,
|
||||
int nparams);
|
||||
|
||||
miChangePictureFilter(PicturePtr pPicture,
|
||||
int filter, xFixed * params, int nparams);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miCompositeSourceValidate (PicturePtr pPicture);
|
||||
miCompositeSourceValidate(PicturePtr pPicture);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
miComputeCompositeRegion (RegionPtr pRegion,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
miComputeCompositeRegion(RegionPtr pRegion,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
|
||||
miPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
miRealizeGlyph (ScreenPtr pScreen,
|
||||
GlyphPtr glyph);
|
||||
miRealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miUnrealizeGlyph (ScreenPtr pScreen,
|
||||
GlyphPtr glyph);
|
||||
miUnrealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miGlyphs (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int nlist,
|
||||
GlyphListPtr list,
|
||||
GlyphPtr *glyphs);
|
||||
|
||||
miGlyphs(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miRenderColorToPixel (PictFormatPtr pPict,
|
||||
xRenderColor *color,
|
||||
CARD32 *pixel);
|
||||
miRenderColorToPixel(PictFormatPtr pPict, xRenderColor * color, CARD32 *pixel);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miRenderPixelToColor (PictFormatPtr pPict,
|
||||
CARD32 pixel,
|
||||
xRenderColor *color);
|
||||
miRenderPixelToColor(PictFormatPtr pPict, CARD32 pixel, xRenderColor * color);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
miIsSolidAlpha (PicturePtr pSrc);
|
||||
miIsSolidAlpha(PicturePtr pSrc);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miCompositeRects (CARD8 op,
|
||||
PicturePtr pDst,
|
||||
xRenderColor *color,
|
||||
int nRect,
|
||||
xRectangle *rects);
|
||||
|
||||
miCompositeRects(CARD8 op,
|
||||
PicturePtr pDst,
|
||||
xRenderColor * color, int nRect, xRectangle *rects);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miTriStrip (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int npoints,
|
||||
xPointFixed *points);
|
||||
|
||||
miTriStrip(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miTriFan (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int npoints,
|
||||
xPointFixed *points);
|
||||
|
||||
miTriFan(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box);
|
||||
miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds);
|
||||
|
||||
miPointFixedBounds(int npoint, xPointFixed * points, BoxPtr bounds);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds);
|
||||
miTriangleBounds(int ntri, xTriangle * tris, BoxPtr bounds);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
miInitIndexed (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat);
|
||||
miInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miCloseIndexed (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat);
|
||||
miCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miUpdateIndexed (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat,
|
||||
int ndef,
|
||||
xColorItem *pdef);
|
||||
|
||||
#endif /* _MIPICT_H_ */
|
||||
miUpdateIndexed(ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat, int ndef, xColorItem * pdef);
|
||||
|
||||
#endif /* _MIPICT_H_ */
|
||||
|
||||
227
render/mirect.c
227
render/mirect.c
@@ -34,152 +34,135 @@
|
||||
#include "mipict.h"
|
||||
|
||||
static void
|
||||
miColorRects (PicturePtr pDst,
|
||||
PicturePtr pClipPict,
|
||||
xRenderColor *color,
|
||||
int nRect,
|
||||
xRectangle *rects,
|
||||
int xoff,
|
||||
int yoff)
|
||||
miColorRects(PicturePtr pDst,
|
||||
PicturePtr pClipPict,
|
||||
xRenderColor * color,
|
||||
int nRect, xRectangle *rects, int xoff, int yoff)
|
||||
{
|
||||
CARD32 pixel;
|
||||
GCPtr pGC;
|
||||
ChangeGCVal tmpval[5];
|
||||
RegionPtr pClip;
|
||||
unsigned long mask;
|
||||
CARD32 pixel;
|
||||
GCPtr pGC;
|
||||
ChangeGCVal tmpval[5];
|
||||
RegionPtr pClip;
|
||||
unsigned long mask;
|
||||
|
||||
miRenderColorToPixel (pDst->pFormat, color, &pixel);
|
||||
miRenderColorToPixel(pDst->pFormat, color, &pixel);
|
||||
|
||||
pGC = GetScratchGC (pDst->pDrawable->depth, pDst->pDrawable->pScreen);
|
||||
pGC = GetScratchGC(pDst->pDrawable->depth, pDst->pDrawable->pScreen);
|
||||
if (!pGC)
|
||||
return;
|
||||
return;
|
||||
tmpval[0].val = GXcopy;
|
||||
tmpval[1].val = pixel;
|
||||
tmpval[2].val = pDst->subWindowMode;
|
||||
mask = GCFunction | GCForeground | GCSubwindowMode;
|
||||
if (pClipPict->clientClipType == CT_REGION)
|
||||
{
|
||||
tmpval[3].val = pDst->clipOrigin.x - xoff;
|
||||
tmpval[4].val = pDst->clipOrigin.y - yoff;
|
||||
mask |= GCClipXOrigin|GCClipYOrigin;
|
||||
|
||||
pClip = RegionCreate(NULL, 1);
|
||||
RegionCopy(pClip,
|
||||
(RegionPtr) pClipPict->clientClip);
|
||||
(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
|
||||
if (pClipPict->clientClipType == CT_REGION) {
|
||||
tmpval[3].val = pDst->clipOrigin.x - xoff;
|
||||
tmpval[4].val = pDst->clipOrigin.y - yoff;
|
||||
mask |= GCClipXOrigin | GCClipYOrigin;
|
||||
|
||||
pClip = RegionCreate(NULL, 1);
|
||||
RegionCopy(pClip, (RegionPtr) pClipPict->clientClip);
|
||||
(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
|
||||
}
|
||||
|
||||
ChangeGC (NullClient, pGC, mask, tmpval);
|
||||
ValidateGC (pDst->pDrawable, pGC);
|
||||
if (xoff || yoff)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < nRect; i++)
|
||||
{
|
||||
rects[i].x -= xoff;
|
||||
rects[i].y -= yoff;
|
||||
}
|
||||
ChangeGC(NullClient, pGC, mask, tmpval);
|
||||
ValidateGC(pDst->pDrawable, pGC);
|
||||
if (xoff || yoff) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nRect; i++) {
|
||||
rects[i].x -= xoff;
|
||||
rects[i].y -= yoff;
|
||||
}
|
||||
}
|
||||
(*pGC->ops->PolyFillRect) (pDst->pDrawable, pGC, nRect, rects);
|
||||
if (xoff || yoff)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < nRect; i++)
|
||||
{
|
||||
rects[i].x += xoff;
|
||||
rects[i].y += yoff;
|
||||
}
|
||||
if (xoff || yoff) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nRect; i++) {
|
||||
rects[i].x += xoff;
|
||||
rects[i].y += yoff;
|
||||
}
|
||||
}
|
||||
FreeScratchGC (pGC);
|
||||
FreeScratchGC(pGC);
|
||||
}
|
||||
|
||||
void
|
||||
miCompositeRects (CARD8 op,
|
||||
PicturePtr pDst,
|
||||
xRenderColor *color,
|
||||
int nRect,
|
||||
xRectangle *rects)
|
||||
miCompositeRects(CARD8 op,
|
||||
PicturePtr pDst,
|
||||
xRenderColor * color, int nRect, xRectangle *rects)
|
||||
{
|
||||
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
||||
|
||||
if (color->alpha == 0xffff)
|
||||
{
|
||||
if (op == PictOpOver)
|
||||
op = PictOpSrc;
|
||||
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
||||
|
||||
if (color->alpha == 0xffff) {
|
||||
if (op == PictOpOver)
|
||||
op = PictOpSrc;
|
||||
}
|
||||
if (op == PictOpClear)
|
||||
color->red = color->green = color->blue = color->alpha = 0;
|
||||
|
||||
if (op == PictOpSrc || op == PictOpClear)
|
||||
{
|
||||
miColorRects (pDst, pDst, color, nRect, rects, 0, 0);
|
||||
if (pDst->alphaMap)
|
||||
miColorRects (pDst->alphaMap, pDst,
|
||||
color, nRect, rects,
|
||||
pDst->alphaOrigin.x,
|
||||
pDst->alphaOrigin.y);
|
||||
color->red = color->green = color->blue = color->alpha = 0;
|
||||
|
||||
if (op == PictOpSrc || op == PictOpClear) {
|
||||
miColorRects(pDst, pDst, color, nRect, rects, 0, 0);
|
||||
if (pDst->alphaMap)
|
||||
miColorRects(pDst->alphaMap, pDst,
|
||||
color, nRect, rects,
|
||||
pDst->alphaOrigin.x, pDst->alphaOrigin.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
PictFormatPtr rgbaFormat;
|
||||
PixmapPtr pPixmap;
|
||||
PicturePtr pSrc;
|
||||
xRectangle one;
|
||||
int error;
|
||||
Pixel pixel;
|
||||
GCPtr pGC;
|
||||
ChangeGCVal gcvals[2];
|
||||
XID tmpval[1];
|
||||
else {
|
||||
PictFormatPtr rgbaFormat;
|
||||
PixmapPtr pPixmap;
|
||||
PicturePtr pSrc;
|
||||
xRectangle one;
|
||||
int error;
|
||||
Pixel pixel;
|
||||
GCPtr pGC;
|
||||
ChangeGCVal gcvals[2];
|
||||
XID tmpval[1];
|
||||
|
||||
rgbaFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
|
||||
if (!rgbaFormat)
|
||||
goto bail1;
|
||||
|
||||
pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, rgbaFormat->depth,
|
||||
CREATE_PIXMAP_USAGE_SCRATCH);
|
||||
if (!pPixmap)
|
||||
goto bail2;
|
||||
|
||||
miRenderColorToPixel (rgbaFormat, color, &pixel);
|
||||
rgbaFormat = PictureMatchFormat(pScreen, 32, PICT_a8r8g8b8);
|
||||
if (!rgbaFormat)
|
||||
goto bail1;
|
||||
|
||||
pGC = GetScratchGC (rgbaFormat->depth, pScreen);
|
||||
if (!pGC)
|
||||
goto bail3;
|
||||
gcvals[0].val = GXcopy;
|
||||
gcvals[1].val = pixel;
|
||||
pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, rgbaFormat->depth,
|
||||
CREATE_PIXMAP_USAGE_SCRATCH);
|
||||
if (!pPixmap)
|
||||
goto bail2;
|
||||
|
||||
ChangeGC (NullClient, pGC, GCFunction | GCForeground, gcvals);
|
||||
ValidateGC (&pPixmap->drawable, pGC);
|
||||
one.x = 0;
|
||||
one.y = 0;
|
||||
one.width = 1;
|
||||
one.height = 1;
|
||||
(*pGC->ops->PolyFillRect) (&pPixmap->drawable, pGC, 1, &one);
|
||||
|
||||
tmpval[0] = xTrue;
|
||||
pSrc = CreatePicture (0, &pPixmap->drawable, rgbaFormat,
|
||||
CPRepeat, tmpval, serverClient, &error);
|
||||
|
||||
if (!pSrc)
|
||||
goto bail4;
|
||||
miRenderColorToPixel(rgbaFormat, color, &pixel);
|
||||
|
||||
while (nRect--)
|
||||
{
|
||||
CompositePicture (op, pSrc, 0, pDst, 0, 0, 0, 0,
|
||||
rects->x,
|
||||
rects->y,
|
||||
rects->width,
|
||||
rects->height);
|
||||
rects++;
|
||||
}
|
||||
pGC = GetScratchGC(rgbaFormat->depth, pScreen);
|
||||
if (!pGC)
|
||||
goto bail3;
|
||||
gcvals[0].val = GXcopy;
|
||||
gcvals[1].val = pixel;
|
||||
|
||||
FreePicture ((pointer) pSrc, 0);
|
||||
bail4:
|
||||
FreeScratchGC (pGC);
|
||||
bail3:
|
||||
(*pScreen->DestroyPixmap) (pPixmap);
|
||||
bail2:
|
||||
bail1:
|
||||
;
|
||||
ChangeGC(NullClient, pGC, GCFunction | GCForeground, gcvals);
|
||||
ValidateGC(&pPixmap->drawable, pGC);
|
||||
one.x = 0;
|
||||
one.y = 0;
|
||||
one.width = 1;
|
||||
one.height = 1;
|
||||
(*pGC->ops->PolyFillRect) (&pPixmap->drawable, pGC, 1, &one);
|
||||
|
||||
tmpval[0] = xTrue;
|
||||
pSrc = CreatePicture(0, &pPixmap->drawable, rgbaFormat,
|
||||
CPRepeat, tmpval, serverClient, &error);
|
||||
|
||||
if (!pSrc)
|
||||
goto bail4;
|
||||
|
||||
while (nRect--) {
|
||||
CompositePicture(op, pSrc, 0, pDst, 0, 0, 0, 0,
|
||||
rects->x, rects->y, rects->width, rects->height);
|
||||
rects++;
|
||||
}
|
||||
|
||||
FreePicture((pointer) pSrc, 0);
|
||||
bail4:
|
||||
FreeScratchGC(pGC);
|
||||
bail3:
|
||||
(*pScreen->DestroyPixmap) (pPixmap);
|
||||
bail2:
|
||||
bail1:
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,45 +35,47 @@
|
||||
#include "mipict.h"
|
||||
|
||||
static xFixed
|
||||
miLineFixedX (xLineFixed *l, xFixed y, Bool ceil)
|
||||
miLineFixedX(xLineFixed * l, xFixed y, Bool ceil)
|
||||
{
|
||||
xFixed dx = l->p2.x - l->p1.x;
|
||||
xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx;
|
||||
xFixed dy = l->p2.y - l->p1.y;
|
||||
xFixed dx = l->p2.x - l->p1.x;
|
||||
xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx;
|
||||
xFixed dy = l->p2.y - l->p1.y;
|
||||
|
||||
if (ceil)
|
||||
ex += (dy - 1);
|
||||
ex += (dy - 1);
|
||||
return l->p1.x + (xFixed) (ex / dy);
|
||||
}
|
||||
|
||||
void
|
||||
miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box)
|
||||
miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box)
|
||||
{
|
||||
box->y1 = MAXSHORT;
|
||||
box->y2 = MINSHORT;
|
||||
box->x1 = MAXSHORT;
|
||||
box->x2 = MINSHORT;
|
||||
for (; ntrap; ntrap--, traps++)
|
||||
{
|
||||
INT16 x1, y1, x2, y2;
|
||||
for (; ntrap; ntrap--, traps++) {
|
||||
INT16 x1, y1, x2, y2;
|
||||
|
||||
if (!xTrapezoidValid(traps))
|
||||
continue;
|
||||
y1 = xFixedToInt (traps->top);
|
||||
if (y1 < box->y1)
|
||||
box->y1 = y1;
|
||||
|
||||
y2 = xFixedToInt (xFixedCeil (traps->bottom));
|
||||
if (y2 > box->y2)
|
||||
box->y2 = y2;
|
||||
|
||||
x1 = xFixedToInt (min (miLineFixedX (&traps->left, traps->top, FALSE),
|
||||
miLineFixedX (&traps->left, traps->bottom, FALSE)));
|
||||
if (x1 < box->x1)
|
||||
box->x1 = x1;
|
||||
|
||||
x2 = xFixedToInt (xFixedCeil (max (miLineFixedX (&traps->right, traps->top, TRUE),
|
||||
miLineFixedX (&traps->right, traps->bottom, TRUE))));
|
||||
if (x2 > box->x2)
|
||||
box->x2 = x2;
|
||||
if (!xTrapezoidValid(traps))
|
||||
continue;
|
||||
y1 = xFixedToInt(traps->top);
|
||||
if (y1 < box->y1)
|
||||
box->y1 = y1;
|
||||
|
||||
y2 = xFixedToInt(xFixedCeil(traps->bottom));
|
||||
if (y2 > box->y2)
|
||||
box->y2 = y2;
|
||||
|
||||
x1 = xFixedToInt(min(miLineFixedX(&traps->left, traps->top, FALSE),
|
||||
miLineFixedX(&traps->left, traps->bottom, FALSE)));
|
||||
if (x1 < box->x1)
|
||||
box->x1 = x1;
|
||||
|
||||
x2 = xFixedToInt(xFixedCeil
|
||||
(max
|
||||
(miLineFixedX(&traps->right, traps->top, TRUE),
|
||||
miLineFixedX(&traps->right, traps->bottom, TRUE))));
|
||||
if (x2 > box->x2)
|
||||
box->x2 = x2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,35 +34,34 @@
|
||||
#include "mipict.h"
|
||||
|
||||
void
|
||||
miPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds)
|
||||
miPointFixedBounds(int npoint, xPointFixed * points, BoxPtr bounds)
|
||||
{
|
||||
bounds->x1 = xFixedToInt (points->x);
|
||||
bounds->x2 = xFixedToInt (xFixedCeil (points->x));
|
||||
bounds->y1 = xFixedToInt (points->y);
|
||||
bounds->y2 = xFixedToInt (xFixedCeil (points->y));
|
||||
bounds->x1 = xFixedToInt(points->x);
|
||||
bounds->x2 = xFixedToInt(xFixedCeil(points->x));
|
||||
bounds->y1 = xFixedToInt(points->y);
|
||||
bounds->y2 = xFixedToInt(xFixedCeil(points->y));
|
||||
points++;
|
||||
npoint--;
|
||||
while (npoint-- > 0)
|
||||
{
|
||||
INT16 x1 = xFixedToInt (points->x);
|
||||
INT16 x2 = xFixedToInt (xFixedCeil (points->x));
|
||||
INT16 y1 = xFixedToInt (points->y);
|
||||
INT16 y2 = xFixedToInt (xFixedCeil (points->y));
|
||||
while (npoint-- > 0) {
|
||||
INT16 x1 = xFixedToInt(points->x);
|
||||
INT16 x2 = xFixedToInt(xFixedCeil(points->x));
|
||||
INT16 y1 = xFixedToInt(points->y);
|
||||
INT16 y2 = xFixedToInt(xFixedCeil(points->y));
|
||||
|
||||
if (x1 < bounds->x1)
|
||||
bounds->x1 = x1;
|
||||
else if (x2 > bounds->x2)
|
||||
bounds->x2 = x2;
|
||||
if (y1 < bounds->y1)
|
||||
bounds->y1 = y1;
|
||||
else if (y2 > bounds->y2)
|
||||
bounds->y2 = y2;
|
||||
points++;
|
||||
if (x1 < bounds->x1)
|
||||
bounds->x1 = x1;
|
||||
else if (x2 > bounds->x2)
|
||||
bounds->x2 = x2;
|
||||
if (y1 < bounds->y1)
|
||||
bounds->y1 = y1;
|
||||
else if (y2 > bounds->y2)
|
||||
bounds->y2 = y2;
|
||||
points++;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds)
|
||||
miTriangleBounds(int ntri, xTriangle * tris, BoxPtr bounds)
|
||||
{
|
||||
miPointFixedBounds (ntri * 3, (xPointFixed *) tris, bounds);
|
||||
miPointFixedBounds(ntri * 3, (xPointFixed *) tris, bounds);
|
||||
}
|
||||
|
||||
1987
render/picture.c
1987
render/picture.c
File diff suppressed because it is too large
Load Diff
111
render/picture.h
111
render/picture.h
@@ -29,9 +29,9 @@
|
||||
|
||||
#include <pixman.h>
|
||||
|
||||
typedef struct _DirectFormat *DirectFormatPtr;
|
||||
typedef struct _PictFormat *PictFormatPtr;
|
||||
typedef struct _Picture *PicturePtr;
|
||||
typedef struct _DirectFormat *DirectFormatPtr;
|
||||
typedef struct _PictFormat *PictFormatPtr;
|
||||
typedef struct _Picture *PicturePtr;
|
||||
|
||||
/*
|
||||
* While the protocol is generous in format support, the
|
||||
@@ -68,64 +68,64 @@ typedef struct _Picture *PicturePtr;
|
||||
|
||||
/* 32bpp formats */
|
||||
typedef enum _PictFormatShort {
|
||||
PICT_a2r10g10b10 = PIXMAN_a2r10g10b10,
|
||||
PICT_x2r10g10b10 = PIXMAN_x2r10g10b10,
|
||||
PICT_a2b10g10r10 = PIXMAN_a2b10g10r10,
|
||||
PICT_x2b10g10r10 = PIXMAN_x2b10g10r10,
|
||||
PICT_a2r10g10b10 = PIXMAN_a2r10g10b10,
|
||||
PICT_x2r10g10b10 = PIXMAN_x2r10g10b10,
|
||||
PICT_a2b10g10r10 = PIXMAN_a2b10g10r10,
|
||||
PICT_x2b10g10r10 = PIXMAN_x2b10g10r10,
|
||||
|
||||
PICT_a8r8g8b8 = PIXMAN_a8r8g8b8,
|
||||
PICT_x8r8g8b8 = PIXMAN_x8r8g8b8,
|
||||
PICT_a8b8g8r8 = PIXMAN_a8b8g8r8,
|
||||
PICT_x8b8g8r8 = PIXMAN_x8b8g8r8,
|
||||
PICT_b8g8r8a8 = PIXMAN_b8g8r8a8,
|
||||
PICT_b8g8r8x8 = PIXMAN_b8g8r8x8,
|
||||
PICT_a8r8g8b8 = PIXMAN_a8r8g8b8,
|
||||
PICT_x8r8g8b8 = PIXMAN_x8r8g8b8,
|
||||
PICT_a8b8g8r8 = PIXMAN_a8b8g8r8,
|
||||
PICT_x8b8g8r8 = PIXMAN_x8b8g8r8,
|
||||
PICT_b8g8r8a8 = PIXMAN_b8g8r8a8,
|
||||
PICT_b8g8r8x8 = PIXMAN_b8g8r8x8,
|
||||
|
||||
/* 24bpp formats */
|
||||
PICT_r8g8b8 = PIXMAN_r8g8b8,
|
||||
PICT_b8g8r8 = PIXMAN_b8g8r8,
|
||||
PICT_r8g8b8 = PIXMAN_r8g8b8,
|
||||
PICT_b8g8r8 = PIXMAN_b8g8r8,
|
||||
|
||||
/* 16bpp formats */
|
||||
PICT_r5g6b5 = PIXMAN_r5g6b5,
|
||||
PICT_b5g6r5 = PIXMAN_b5g6r5,
|
||||
PICT_r5g6b5 = PIXMAN_r5g6b5,
|
||||
PICT_b5g6r5 = PIXMAN_b5g6r5,
|
||||
|
||||
PICT_a1r5g5b5 = PIXMAN_a1r5g5b5,
|
||||
PICT_x1r5g5b5 = PIXMAN_x1r5g5b5,
|
||||
PICT_a1b5g5r5 = PIXMAN_a1b5g5r5,
|
||||
PICT_x1b5g5r5 = PIXMAN_x1b5g5r5,
|
||||
PICT_a4r4g4b4 = PIXMAN_a4r4g4b4,
|
||||
PICT_x4r4g4b4 = PIXMAN_x4r4g4b4,
|
||||
PICT_a4b4g4r4 = PIXMAN_a4b4g4r4,
|
||||
PICT_x4b4g4r4 = PIXMAN_x4b4g4r4,
|
||||
PICT_a1r5g5b5 = PIXMAN_a1r5g5b5,
|
||||
PICT_x1r5g5b5 = PIXMAN_x1r5g5b5,
|
||||
PICT_a1b5g5r5 = PIXMAN_a1b5g5r5,
|
||||
PICT_x1b5g5r5 = PIXMAN_x1b5g5r5,
|
||||
PICT_a4r4g4b4 = PIXMAN_a4r4g4b4,
|
||||
PICT_x4r4g4b4 = PIXMAN_x4r4g4b4,
|
||||
PICT_a4b4g4r4 = PIXMAN_a4b4g4r4,
|
||||
PICT_x4b4g4r4 = PIXMAN_x4b4g4r4,
|
||||
|
||||
/* 8bpp formats */
|
||||
PICT_a8 = PIXMAN_a8,
|
||||
PICT_r3g3b2 = PIXMAN_r3g3b2,
|
||||
PICT_b2g3r3 = PIXMAN_b2g3r3,
|
||||
PICT_a2r2g2b2 = PIXMAN_a2r2g2b2,
|
||||
PICT_a2b2g2r2 = PIXMAN_a2b2g2r2,
|
||||
PICT_a8 = PIXMAN_a8,
|
||||
PICT_r3g3b2 = PIXMAN_r3g3b2,
|
||||
PICT_b2g3r3 = PIXMAN_b2g3r3,
|
||||
PICT_a2r2g2b2 = PIXMAN_a2r2g2b2,
|
||||
PICT_a2b2g2r2 = PIXMAN_a2b2g2r2,
|
||||
|
||||
PICT_c8 = PIXMAN_c8,
|
||||
PICT_g8 = PIXMAN_g8,
|
||||
PICT_c8 = PIXMAN_c8,
|
||||
PICT_g8 = PIXMAN_g8,
|
||||
|
||||
PICT_x4a4 = PIXMAN_x4a4,
|
||||
|
||||
PICT_x4c4 = PIXMAN_x4c4,
|
||||
PICT_x4g4 = PIXMAN_x4g4,
|
||||
PICT_x4a4 = PIXMAN_x4a4,
|
||||
|
||||
PICT_x4c4 = PIXMAN_x4c4,
|
||||
PICT_x4g4 = PIXMAN_x4g4,
|
||||
|
||||
/* 4bpp formats */
|
||||
PICT_a4 = PIXMAN_a4,
|
||||
PICT_r1g2b1 = PIXMAN_r1g2b1,
|
||||
PICT_b1g2r1 = PIXMAN_b1g2r1,
|
||||
PICT_a1r1g1b1 = PIXMAN_a1r1g1b1,
|
||||
PICT_a1b1g1r1 = PIXMAN_a1b1g1r1,
|
||||
|
||||
PICT_c4 = PIXMAN_c4,
|
||||
PICT_g4 = PIXMAN_g4,
|
||||
PICT_a4 = PIXMAN_a4,
|
||||
PICT_r1g2b1 = PIXMAN_r1g2b1,
|
||||
PICT_b1g2r1 = PIXMAN_b1g2r1,
|
||||
PICT_a1r1g1b1 = PIXMAN_a1r1g1b1,
|
||||
PICT_a1b1g1r1 = PIXMAN_a1b1g1r1,
|
||||
|
||||
PICT_c4 = PIXMAN_c4,
|
||||
PICT_g4 = PIXMAN_g4,
|
||||
|
||||
/* 1bpp formats */
|
||||
PICT_a1 = PIXMAN_a1,
|
||||
PICT_a1 = PIXMAN_a1,
|
||||
|
||||
PICT_g1 = PIXMAN_g1
|
||||
PICT_g1 = PIXMAN_g1
|
||||
} PictFormatShort;
|
||||
|
||||
/*
|
||||
@@ -160,7 +160,7 @@ typedef enum _PictFormatShort {
|
||||
* 4x4x4 cube allocates another two and nine more are allocated to fill
|
||||
* in the 13 levels. When the 4x4x4 cube is not allocated, a total of
|
||||
* 11 cells are allocated.
|
||||
*/
|
||||
*/
|
||||
|
||||
#define PictureCmapPolicyInvalid -1
|
||||
#define PictureCmapPolicyDefault 0
|
||||
@@ -171,28 +171,29 @@ typedef enum _PictFormatShort {
|
||||
|
||||
extern _X_EXPORT int PictureCmapPolicy;
|
||||
|
||||
extern _X_EXPORT int PictureParseCmapPolicy (const char *name);
|
||||
extern _X_EXPORT int PictureParseCmapPolicy(const char *name);
|
||||
|
||||
extern _X_EXPORT int RenderErrBase;
|
||||
|
||||
/* Fixed point updates from Carl Worth, USC, Information Sciences Institute */
|
||||
|
||||
typedef pixman_fixed_32_32_t xFixed_32_32;
|
||||
typedef pixman_fixed_32_32_t xFixed_32_32;
|
||||
|
||||
typedef pixman_fixed_48_16_t xFixed_48_16;
|
||||
typedef pixman_fixed_48_16_t xFixed_48_16;
|
||||
|
||||
#define MAX_FIXED_48_16 pixman_max_fixed_48_16
|
||||
#define MIN_FIXED_48_16 pixman_min_fixed_48_16
|
||||
|
||||
typedef pixman_fixed_1_31_t xFixed_1_31;
|
||||
typedef pixman_fixed_1_16_t xFixed_1_16;
|
||||
typedef pixman_fixed_16_16_t xFixed_16_16;
|
||||
typedef pixman_fixed_1_31_t xFixed_1_31;
|
||||
typedef pixman_fixed_1_16_t xFixed_1_16;
|
||||
typedef pixman_fixed_16_16_t xFixed_16_16;
|
||||
|
||||
/*
|
||||
* An unadorned "xFixed" is the same as xFixed_16_16,
|
||||
* (since it's quite common in the code)
|
||||
*/
|
||||
typedef pixman_fixed_t xFixed;
|
||||
typedef pixman_fixed_t xFixed;
|
||||
|
||||
#define XFIXED_BITS 16
|
||||
|
||||
#define xFixedToInt(f) pixman_fixed_to_int(f)
|
||||
@@ -228,4 +229,4 @@ typedef pixman_fixed_t xFixed;
|
||||
(((s) >> 8) & 0xff) * 301 + \
|
||||
(((s) ) & 0xff) * 58) >> 2)
|
||||
|
||||
#endif /* _PICTURE_H_ */
|
||||
#endif /* _PICTURE_H_ */
|
||||
|
||||
@@ -30,27 +30,27 @@
|
||||
#include "privates.h"
|
||||
|
||||
typedef struct _DirectFormat {
|
||||
CARD16 red, redMask;
|
||||
CARD16 green, greenMask;
|
||||
CARD16 blue, blueMask;
|
||||
CARD16 alpha, alphaMask;
|
||||
CARD16 red, redMask;
|
||||
CARD16 green, greenMask;
|
||||
CARD16 blue, blueMask;
|
||||
CARD16 alpha, alphaMask;
|
||||
} DirectFormatRec;
|
||||
|
||||
typedef struct _IndexFormat {
|
||||
VisualID vid;
|
||||
ColormapPtr pColormap;
|
||||
int nvalues;
|
||||
xIndexValue *pValues;
|
||||
void *devPrivate;
|
||||
VisualID vid;
|
||||
ColormapPtr pColormap;
|
||||
int nvalues;
|
||||
xIndexValue *pValues;
|
||||
void *devPrivate;
|
||||
} IndexFormatRec;
|
||||
|
||||
typedef struct _PictFormat {
|
||||
CARD32 id;
|
||||
CARD32 format; /* except bpp */
|
||||
unsigned char type;
|
||||
unsigned char depth;
|
||||
CARD32 id;
|
||||
CARD32 format; /* except bpp */
|
||||
unsigned char type;
|
||||
unsigned char depth;
|
||||
DirectFormatRec direct;
|
||||
IndexFormatRec index;
|
||||
IndexFormatRec index;
|
||||
} PictFormatRec;
|
||||
|
||||
typedef struct pixman_vector PictVector, *PictVectorPtr;
|
||||
@@ -121,53 +121,53 @@ typedef union _SourcePict {
|
||||
} SourcePict, *SourcePictPtr;
|
||||
|
||||
typedef struct _Picture {
|
||||
DrawablePtr pDrawable;
|
||||
PictFormatPtr pFormat;
|
||||
PictFormatShort format; /* PICT_FORMAT */
|
||||
int refcnt;
|
||||
CARD32 id;
|
||||
unsigned int repeat : 1;
|
||||
unsigned int graphicsExposures : 1;
|
||||
unsigned int subWindowMode : 1;
|
||||
unsigned int polyEdge : 1;
|
||||
unsigned int polyMode : 1;
|
||||
unsigned int freeCompClip : 1;
|
||||
unsigned int clientClipType : 2;
|
||||
unsigned int componentAlpha : 1;
|
||||
unsigned int repeatType : 2;
|
||||
unsigned int filter : 3;
|
||||
unsigned int stateChanges : CPLastBit;
|
||||
unsigned int unused : 18 - CPLastBit;
|
||||
DrawablePtr pDrawable;
|
||||
PictFormatPtr pFormat;
|
||||
PictFormatShort format; /* PICT_FORMAT */
|
||||
int refcnt;
|
||||
CARD32 id;
|
||||
unsigned int repeat:1;
|
||||
unsigned int graphicsExposures:1;
|
||||
unsigned int subWindowMode:1;
|
||||
unsigned int polyEdge:1;
|
||||
unsigned int polyMode:1;
|
||||
unsigned int freeCompClip:1;
|
||||
unsigned int clientClipType:2;
|
||||
unsigned int componentAlpha:1;
|
||||
unsigned int repeatType:2;
|
||||
unsigned int filter:3;
|
||||
unsigned int stateChanges:CPLastBit;
|
||||
unsigned int unused:18 - CPLastBit;
|
||||
|
||||
PicturePtr pNext; /* chain on same drawable */
|
||||
PicturePtr pNext; /* chain on same drawable */
|
||||
|
||||
PicturePtr alphaMap;
|
||||
DDXPointRec alphaOrigin;
|
||||
PicturePtr alphaMap;
|
||||
DDXPointRec alphaOrigin;
|
||||
|
||||
DDXPointRec clipOrigin;
|
||||
pointer clientClip;
|
||||
DDXPointRec clipOrigin;
|
||||
pointer clientClip;
|
||||
|
||||
unsigned long serialNumber;
|
||||
unsigned long serialNumber;
|
||||
|
||||
RegionPtr pCompositeClip;
|
||||
RegionPtr pCompositeClip;
|
||||
|
||||
PrivateRec *devPrivates;
|
||||
PrivateRec *devPrivates;
|
||||
|
||||
PictTransform *transform;
|
||||
PictTransform *transform;
|
||||
|
||||
SourcePictPtr pSourcePict;
|
||||
xFixed *filter_params;
|
||||
int filter_nparams;
|
||||
SourcePictPtr pSourcePict;
|
||||
xFixed *filter_params;
|
||||
int filter_nparams;
|
||||
} PictureRec;
|
||||
|
||||
typedef Bool (*PictFilterValidateParamsProcPtr) (ScreenPtr pScreen, int id,
|
||||
xFixed *params, int nparams,
|
||||
int *width, int *height);
|
||||
xFixed * params, int nparams,
|
||||
int *width, int *height);
|
||||
typedef struct {
|
||||
char *name;
|
||||
int id;
|
||||
char *name;
|
||||
int id;
|
||||
PictFilterValidateParamsProcPtr ValidateParams;
|
||||
int width, height;
|
||||
int width, height;
|
||||
} PictFilterRec, *PictFilterPtr;
|
||||
|
||||
#define PictFilterNearest 0
|
||||
@@ -181,205 +181,180 @@ typedef struct {
|
||||
/* if you add an 8th filter, expand the filter bitfield above */
|
||||
|
||||
typedef struct {
|
||||
char *alias;
|
||||
int alias_id;
|
||||
int filter_id;
|
||||
char *alias;
|
||||
int alias_id;
|
||||
int filter_id;
|
||||
} PictFilterAliasRec, *PictFilterAliasPtr;
|
||||
|
||||
typedef int (*CreatePictureProcPtr) (PicturePtr pPicture);
|
||||
typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture);
|
||||
typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture,
|
||||
int clipType,
|
||||
pointer value,
|
||||
int n);
|
||||
typedef void (*DestroyPictureClipProcPtr)(PicturePtr pPicture);
|
||||
typedef int (*CreatePictureProcPtr) (PicturePtr pPicture);
|
||||
typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture);
|
||||
typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture,
|
||||
int clipType, pointer value, int n);
|
||||
typedef void (*DestroyPictureClipProcPtr) (PicturePtr pPicture);
|
||||
|
||||
typedef int (*ChangePictureTransformProcPtr) (PicturePtr pPicture,
|
||||
PictTransform *transform);
|
||||
typedef int (*ChangePictureTransformProcPtr) (PicturePtr pPicture,
|
||||
PictTransform * transform);
|
||||
|
||||
typedef int (*ChangePictureFilterProcPtr) (PicturePtr pPicture,
|
||||
int filter,
|
||||
xFixed *params,
|
||||
int nparams);
|
||||
typedef int (*ChangePictureFilterProcPtr) (PicturePtr pPicture,
|
||||
int filter,
|
||||
xFixed * params, int nparams);
|
||||
|
||||
typedef void (*DestroyPictureFilterProcPtr) (PicturePtr pPicture);
|
||||
typedef void (*DestroyPictureFilterProcPtr) (PicturePtr pPicture);
|
||||
|
||||
typedef void (*ChangePictureProcPtr) (PicturePtr pPicture,
|
||||
Mask mask);
|
||||
typedef void (*ValidatePictureProcPtr) (PicturePtr pPicture,
|
||||
Mask mask);
|
||||
typedef void (*CompositeProcPtr) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
typedef void (*ChangePictureProcPtr) (PicturePtr pPicture, Mask mask);
|
||||
typedef void (*ValidatePictureProcPtr) (PicturePtr pPicture, Mask mask);
|
||||
typedef void (*CompositeProcPtr) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst, CARD16 width, CARD16 height);
|
||||
|
||||
typedef void (*GlyphsProcPtr) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int nlists,
|
||||
GlyphListPtr lists,
|
||||
GlyphPtr *glyphs);
|
||||
typedef void (*GlyphsProcPtr) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int nlists,
|
||||
GlyphListPtr lists, GlyphPtr * glyphs);
|
||||
|
||||
typedef void (*CompositeRectsProcPtr) (CARD8 op,
|
||||
PicturePtr pDst,
|
||||
xRenderColor *color,
|
||||
int nRect,
|
||||
xRectangle *rects);
|
||||
typedef void (*CompositeRectsProcPtr) (CARD8 op,
|
||||
PicturePtr pDst,
|
||||
xRenderColor * color,
|
||||
int nRect, xRectangle *rects);
|
||||
|
||||
typedef void (*RasterizeTrapezoidProcPtr)(PicturePtr pMask,
|
||||
xTrapezoid *trap,
|
||||
int x_off,
|
||||
int y_off);
|
||||
typedef void (*RasterizeTrapezoidProcPtr) (PicturePtr pMask,
|
||||
xTrapezoid * trap,
|
||||
int x_off, int y_off);
|
||||
|
||||
typedef void (*TrapezoidsProcPtr) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int ntrap,
|
||||
xTrapezoid *traps);
|
||||
typedef void (*TrapezoidsProcPtr) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc, int ntrap, xTrapezoid * traps);
|
||||
|
||||
typedef void (*TrianglesProcPtr) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int ntri,
|
||||
xTriangle *tris);
|
||||
typedef void (*TrianglesProcPtr) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc, int ntri, xTriangle * tris);
|
||||
|
||||
typedef void (*TriStripProcPtr) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int npoint,
|
||||
xPointFixed *points);
|
||||
typedef void (*TriStripProcPtr) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc, int npoint, xPointFixed * points);
|
||||
|
||||
typedef void (*TriFanProcPtr) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int npoint,
|
||||
xPointFixed *points);
|
||||
typedef void (*TriFanProcPtr) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc, int npoint, xPointFixed * points);
|
||||
|
||||
typedef Bool (*InitIndexedProcPtr) (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat);
|
||||
typedef Bool (*InitIndexedProcPtr) (ScreenPtr pScreen, PictFormatPtr pFormat);
|
||||
|
||||
typedef void (*CloseIndexedProcPtr) (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat);
|
||||
typedef void (*CloseIndexedProcPtr) (ScreenPtr pScreen, PictFormatPtr pFormat);
|
||||
|
||||
typedef void (*UpdateIndexedProcPtr) (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat,
|
||||
int ndef,
|
||||
xColorItem *pdef);
|
||||
typedef void (*UpdateIndexedProcPtr) (ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat,
|
||||
int ndef, xColorItem * pdef);
|
||||
|
||||
typedef void (*AddTrapsProcPtr) (PicturePtr pPicture,
|
||||
INT16 xOff,
|
||||
INT16 yOff,
|
||||
int ntrap,
|
||||
xTrap *traps);
|
||||
typedef void (*AddTrapsProcPtr) (PicturePtr pPicture,
|
||||
INT16 xOff,
|
||||
INT16 yOff, int ntrap, xTrap * traps);
|
||||
|
||||
typedef void (*AddTrianglesProcPtr) (PicturePtr pPicture,
|
||||
INT16 xOff,
|
||||
INT16 yOff,
|
||||
int ntri,
|
||||
xTriangle *tris);
|
||||
typedef void (*AddTrianglesProcPtr) (PicturePtr pPicture,
|
||||
INT16 xOff,
|
||||
INT16 yOff, int ntri, xTriangle * tris);
|
||||
|
||||
typedef Bool (*RealizeGlyphProcPtr) (ScreenPtr pScreen,
|
||||
GlyphPtr glyph);
|
||||
typedef Bool (*RealizeGlyphProcPtr) (ScreenPtr pScreen, GlyphPtr glyph);
|
||||
|
||||
typedef void (*UnrealizeGlyphProcPtr) (ScreenPtr pScreen,
|
||||
GlyphPtr glyph);
|
||||
typedef void (*UnrealizeGlyphProcPtr) (ScreenPtr pScreen, GlyphPtr glyph);
|
||||
|
||||
typedef struct _PictureScreen {
|
||||
PictFormatPtr formats;
|
||||
PictFormatPtr fallback;
|
||||
int nformats;
|
||||
PictFormatPtr formats;
|
||||
PictFormatPtr fallback;
|
||||
int nformats;
|
||||
|
||||
CreatePictureProcPtr CreatePicture;
|
||||
DestroyPictureProcPtr DestroyPicture;
|
||||
ChangePictureClipProcPtr ChangePictureClip;
|
||||
DestroyPictureClipProcPtr DestroyPictureClip;
|
||||
CreatePictureProcPtr CreatePicture;
|
||||
DestroyPictureProcPtr DestroyPicture;
|
||||
ChangePictureClipProcPtr ChangePictureClip;
|
||||
DestroyPictureClipProcPtr DestroyPictureClip;
|
||||
|
||||
ChangePictureProcPtr ChangePicture;
|
||||
ValidatePictureProcPtr ValidatePicture;
|
||||
ChangePictureProcPtr ChangePicture;
|
||||
ValidatePictureProcPtr ValidatePicture;
|
||||
|
||||
CompositeProcPtr Composite;
|
||||
GlyphsProcPtr Glyphs; /* unused */
|
||||
CompositeRectsProcPtr CompositeRects;
|
||||
CompositeProcPtr Composite;
|
||||
GlyphsProcPtr Glyphs; /* unused */
|
||||
CompositeRectsProcPtr CompositeRects;
|
||||
|
||||
DestroyWindowProcPtr DestroyWindow;
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
DestroyWindowProcPtr DestroyWindow;
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
|
||||
StoreColorsProcPtr StoreColors;
|
||||
StoreColorsProcPtr StoreColors;
|
||||
|
||||
InitIndexedProcPtr InitIndexed;
|
||||
CloseIndexedProcPtr CloseIndexed;
|
||||
UpdateIndexedProcPtr UpdateIndexed;
|
||||
InitIndexedProcPtr InitIndexed;
|
||||
CloseIndexedProcPtr CloseIndexed;
|
||||
UpdateIndexedProcPtr UpdateIndexed;
|
||||
|
||||
int subpixel;
|
||||
int subpixel;
|
||||
|
||||
PictFilterPtr filters;
|
||||
int nfilters;
|
||||
PictFilterAliasPtr filterAliases;
|
||||
int nfilterAliases;
|
||||
PictFilterPtr filters;
|
||||
int nfilters;
|
||||
PictFilterAliasPtr filterAliases;
|
||||
int nfilterAliases;
|
||||
|
||||
/**
|
||||
* Called immediately after a picture's transform is changed through the
|
||||
* SetPictureTransform request. Not called for source-only pictures.
|
||||
*/
|
||||
ChangePictureTransformProcPtr ChangePictureTransform;
|
||||
ChangePictureTransformProcPtr ChangePictureTransform;
|
||||
|
||||
/**
|
||||
* Called immediately after a picture's transform is changed through the
|
||||
* SetPictureFilter request. Not called for source-only pictures.
|
||||
*/
|
||||
ChangePictureFilterProcPtr ChangePictureFilter;
|
||||
ChangePictureFilterProcPtr ChangePictureFilter;
|
||||
|
||||
DestroyPictureFilterProcPtr DestroyPictureFilter;
|
||||
DestroyPictureFilterProcPtr DestroyPictureFilter;
|
||||
|
||||
TrapezoidsProcPtr Trapezoids;
|
||||
TrianglesProcPtr Triangles;
|
||||
TrapezoidsProcPtr Trapezoids;
|
||||
TrianglesProcPtr Triangles;
|
||||
|
||||
RasterizeTrapezoidProcPtr RasterizeTrapezoid;
|
||||
RasterizeTrapezoidProcPtr RasterizeTrapezoid;
|
||||
|
||||
AddTrianglesProcPtr AddTriangles;
|
||||
AddTrianglesProcPtr AddTriangles;
|
||||
|
||||
AddTrapsProcPtr AddTraps;
|
||||
AddTrapsProcPtr AddTraps;
|
||||
|
||||
RealizeGlyphProcPtr RealizeGlyph;
|
||||
UnrealizeGlyphProcPtr UnrealizeGlyph;
|
||||
RealizeGlyphProcPtr RealizeGlyph;
|
||||
UnrealizeGlyphProcPtr UnrealizeGlyph;
|
||||
|
||||
#define PICTURE_SCREEN_VERSION 2
|
||||
TriStripProcPtr TriStrip;
|
||||
TriFanProcPtr TriFan;
|
||||
TriStripProcPtr TriStrip;
|
||||
TriFanProcPtr TriFan;
|
||||
} PictureScreenRec, *PictureScreenPtr;
|
||||
|
||||
extern _X_EXPORT DevPrivateKeyRec PictureScreenPrivateKeyRec;
|
||||
|
||||
#define PictureScreenPrivateKey (&PictureScreenPrivateKeyRec)
|
||||
|
||||
extern _X_EXPORT DevPrivateKeyRec PictureWindowPrivateKeyRec;
|
||||
|
||||
#define PictureWindowPrivateKey (&PictureWindowPrivateKeyRec)
|
||||
|
||||
extern _X_EXPORT RESTYPE PictureType;
|
||||
extern _X_EXPORT RESTYPE PictFormatType;
|
||||
extern _X_EXPORT RESTYPE GlyphSetType;
|
||||
extern _X_EXPORT RESTYPE PictureType;
|
||||
extern _X_EXPORT RESTYPE PictFormatType;
|
||||
extern _X_EXPORT RESTYPE GlyphSetType;
|
||||
|
||||
#define GetPictureScreen(s) ((PictureScreenPtr)dixLookupPrivate(&(s)->devPrivates, PictureScreenPrivateKey))
|
||||
#define GetPictureScreenIfSet(s) (dixPrivateKeyRegistered(PictureScreenPrivateKey) ? GetPictureScreen(s) : NULL)
|
||||
@@ -403,247 +378,216 @@ extern _X_EXPORT RESTYPE GlyphSetType;
|
||||
} \
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
PictureDestroyWindow (WindowPtr pWindow);
|
||||
PictureDestroyWindow(WindowPtr pWindow);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
PictureCloseScreen (int Index, ScreenPtr pScreen);
|
||||
PictureCloseScreen(int Index, ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT void
|
||||
PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef);
|
||||
PictureStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
PictureInitIndexedFormat (ScreenPtr pScreen, PictFormatPtr format);
|
||||
PictureInitIndexedFormat(ScreenPtr pScreen, PictFormatPtr format);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel);
|
||||
PictureSetSubpixelOrder(ScreenPtr pScreen, int subpixel);
|
||||
|
||||
extern _X_EXPORT int
|
||||
PictureGetSubpixelOrder (ScreenPtr pScreen);
|
||||
PictureGetSubpixelOrder(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT PictFormatPtr
|
||||
PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp);
|
||||
PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp);
|
||||
|
||||
extern _X_EXPORT PictFormatPtr
|
||||
PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual);
|
||||
PictureMatchVisual(ScreenPtr pScreen, int depth, VisualPtr pVisual);
|
||||
|
||||
extern _X_EXPORT PictFormatPtr
|
||||
PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 format);
|
||||
PictureMatchFormat(ScreenPtr pScreen, int depth, CARD32 format);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
|
||||
PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats);
|
||||
|
||||
extern _X_EXPORT int
|
||||
PictureGetFilterId (const char *filter, int len, Bool makeit);
|
||||
PictureGetFilterId(const char *filter, int len, Bool makeit);
|
||||
|
||||
extern _X_EXPORT char *
|
||||
PictureGetFilterName (int id);
|
||||
extern _X_EXPORT char *PictureGetFilterName(int id);
|
||||
|
||||
extern _X_EXPORT int
|
||||
PictureAddFilter (ScreenPtr pScreen,
|
||||
const char *filter,
|
||||
PictFilterValidateParamsProcPtr ValidateParams,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
PictureAddFilter(ScreenPtr pScreen,
|
||||
const char *filter,
|
||||
PictFilterValidateParamsProcPtr ValidateParams,
|
||||
int width, int height);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
PictureSetFilterAlias (ScreenPtr pScreen, const char *filter, const char *alias);
|
||||
|
||||
PictureSetFilterAlias(ScreenPtr pScreen, const char *filter, const char *alias);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
PictureSetDefaultFilters (ScreenPtr pScreen);
|
||||
PictureSetDefaultFilters(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT void
|
||||
PictureResetFilters (ScreenPtr pScreen);
|
||||
PictureResetFilters(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT PictFilterPtr
|
||||
PictureFindFilter (ScreenPtr pScreen, char *name, int len);
|
||||
PictureFindFilter(ScreenPtr pScreen, char *name, int len);
|
||||
|
||||
extern _X_EXPORT int
|
||||
SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter,
|
||||
xFixed *params, int nparams);
|
||||
|
||||
SetPicturePictFilter(PicturePtr pPicture, PictFilterPtr pFilter,
|
||||
xFixed * params, int nparams);
|
||||
|
||||
extern _X_EXPORT int
|
||||
SetPictureFilter (PicturePtr pPicture, char *name, int len,
|
||||
xFixed *params, int nparams);
|
||||
|
||||
SetPictureFilter(PicturePtr pPicture, char *name, int len,
|
||||
xFixed * params, int nparams);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
PictureFinishInit (void);
|
||||
PictureFinishInit(void);
|
||||
|
||||
extern _X_EXPORT void
|
||||
SetPictureToDefaults (PicturePtr pPicture);
|
||||
SetPictureToDefaults(PicturePtr pPicture);
|
||||
|
||||
extern _X_EXPORT PicturePtr
|
||||
CreatePicture (Picture pid,
|
||||
DrawablePtr pDrawable,
|
||||
PictFormatPtr pFormat,
|
||||
Mask mask,
|
||||
XID *list,
|
||||
ClientPtr client,
|
||||
int *error);
|
||||
CreatePicture(Picture pid,
|
||||
DrawablePtr pDrawable,
|
||||
PictFormatPtr pFormat,
|
||||
Mask mask, XID *list, ClientPtr client, int *error);
|
||||
|
||||
extern _X_EXPORT int
|
||||
ChangePicture (PicturePtr pPicture,
|
||||
Mask vmask,
|
||||
XID *vlist,
|
||||
DevUnion *ulist,
|
||||
ClientPtr client);
|
||||
|
||||
ChangePicture(PicturePtr pPicture,
|
||||
Mask vmask, XID *vlist, DevUnion *ulist, ClientPtr client);
|
||||
|
||||
extern _X_EXPORT int
|
||||
SetPictureClipRects (PicturePtr pPicture,
|
||||
int xOrigin,
|
||||
int yOrigin,
|
||||
int nRect,
|
||||
xRectangle *rects);
|
||||
|
||||
SetPictureClipRects(PicturePtr pPicture,
|
||||
int xOrigin, int yOrigin, int nRect, xRectangle *rects);
|
||||
|
||||
extern _X_EXPORT int
|
||||
SetPictureClipRegion (PicturePtr pPicture,
|
||||
int xOrigin,
|
||||
int yOrigin,
|
||||
RegionPtr pRegion);
|
||||
|
||||
SetPictureClipRegion(PicturePtr pPicture,
|
||||
int xOrigin, int yOrigin, RegionPtr pRegion);
|
||||
|
||||
extern _X_EXPORT int
|
||||
SetPictureTransform (PicturePtr pPicture,
|
||||
PictTransform *transform);
|
||||
SetPictureTransform(PicturePtr pPicture, PictTransform * transform);
|
||||
|
||||
extern _X_EXPORT void
|
||||
CopyPicture (PicturePtr pSrc,
|
||||
Mask mask,
|
||||
PicturePtr pDst);
|
||||
CopyPicture(PicturePtr pSrc, Mask mask, PicturePtr pDst);
|
||||
|
||||
extern _X_EXPORT void
|
||||
ValidatePicture(PicturePtr pPicture);
|
||||
ValidatePicture(PicturePtr pPicture);
|
||||
|
||||
extern _X_EXPORT int
|
||||
FreePicture (pointer pPicture,
|
||||
XID pid);
|
||||
FreePicture(pointer pPicture, XID pid);
|
||||
|
||||
extern _X_EXPORT int
|
||||
FreePictFormat (pointer pPictFormat,
|
||||
XID pid);
|
||||
FreePictFormat(pointer pPictFormat, XID pid);
|
||||
|
||||
extern _X_EXPORT void
|
||||
CompositePicture (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
CompositePicture(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
|
||||
|
||||
extern _X_EXPORT void
|
||||
CompositeGlyphs (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int nlist,
|
||||
GlyphListPtr lists,
|
||||
GlyphPtr *glyphs);
|
||||
|
||||
CompositeGlyphs(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc, int nlist, GlyphListPtr lists, GlyphPtr * glyphs);
|
||||
|
||||
extern _X_EXPORT void
|
||||
CompositeRects (CARD8 op,
|
||||
PicturePtr pDst,
|
||||
xRenderColor *color,
|
||||
int nRect,
|
||||
xRectangle *rects);
|
||||
|
||||
CompositeRects(CARD8 op,
|
||||
PicturePtr pDst,
|
||||
xRenderColor * color, int nRect, xRectangle *rects);
|
||||
|
||||
extern _X_EXPORT void
|
||||
CompositeTrapezoids (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int ntrap,
|
||||
xTrapezoid *traps);
|
||||
|
||||
CompositeTrapezoids(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps);
|
||||
|
||||
extern _X_EXPORT void
|
||||
CompositeTriangles (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int ntriangles,
|
||||
xTriangle *triangles);
|
||||
|
||||
CompositeTriangles(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc, int ntriangles, xTriangle * triangles);
|
||||
|
||||
extern _X_EXPORT void
|
||||
CompositeTriStrip (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int npoints,
|
||||
xPointFixed *points);
|
||||
|
||||
CompositeTriStrip(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points);
|
||||
|
||||
extern _X_EXPORT void
|
||||
CompositeTriFan (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
int npoints,
|
||||
xPointFixed *points);
|
||||
|
||||
extern _X_EXPORT void RenderExtensionInit (void);
|
||||
CompositeTriFan(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points);
|
||||
|
||||
extern _X_EXPORT void RenderExtensionInit(void);
|
||||
|
||||
Bool
|
||||
AnimCurInit (ScreenPtr pScreen);
|
||||
AnimCurInit(ScreenPtr pScreen);
|
||||
|
||||
int
|
||||
AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor, ClientPtr client, XID cid);
|
||||
|
||||
AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
|
||||
CursorPtr *ppCursor, ClientPtr client, XID cid);
|
||||
|
||||
extern _X_EXPORT void
|
||||
AddTraps (PicturePtr pPicture,
|
||||
INT16 xOff,
|
||||
INT16 yOff,
|
||||
int ntraps,
|
||||
xTrap *traps);
|
||||
|
||||
AddTraps(PicturePtr pPicture,
|
||||
INT16 xOff, INT16 yOff, int ntraps, xTrap * traps);
|
||||
|
||||
extern _X_EXPORT PicturePtr
|
||||
CreateSolidPicture (Picture pid,
|
||||
xRenderColor *color,
|
||||
int *error);
|
||||
CreateSolidPicture(Picture pid, xRenderColor * color, int *error);
|
||||
|
||||
extern _X_EXPORT PicturePtr
|
||||
CreateLinearGradientPicture (Picture pid,
|
||||
xPointFixed *p1,
|
||||
xPointFixed *p2,
|
||||
CreateLinearGradientPicture(Picture pid,
|
||||
xPointFixed * p1,
|
||||
xPointFixed * p2,
|
||||
int nStops,
|
||||
xFixed * stops, xRenderColor * colors, int *error);
|
||||
|
||||
extern _X_EXPORT PicturePtr
|
||||
CreateRadialGradientPicture(Picture pid,
|
||||
xPointFixed * inner,
|
||||
xPointFixed * outer,
|
||||
xFixed innerRadius,
|
||||
xFixed outerRadius,
|
||||
int nStops,
|
||||
xFixed * stops, xRenderColor * colors, int *error);
|
||||
|
||||
extern _X_EXPORT PicturePtr
|
||||
CreateConicalGradientPicture(Picture pid,
|
||||
xPointFixed * center,
|
||||
xFixed angle,
|
||||
int nStops,
|
||||
xFixed *stops,
|
||||
xRenderColor *colors,
|
||||
int *error);
|
||||
|
||||
extern _X_EXPORT PicturePtr
|
||||
CreateRadialGradientPicture (Picture pid,
|
||||
xPointFixed *inner,
|
||||
xPointFixed *outer,
|
||||
xFixed innerRadius,
|
||||
xFixed outerRadius,
|
||||
int nStops,
|
||||
xFixed *stops,
|
||||
xRenderColor *colors,
|
||||
int *error);
|
||||
|
||||
extern _X_EXPORT PicturePtr
|
||||
CreateConicalGradientPicture (Picture pid,
|
||||
xPointFixed *center,
|
||||
xFixed angle,
|
||||
int nStops,
|
||||
xFixed *stops,
|
||||
xRenderColor *colors,
|
||||
int *error);
|
||||
xFixed * stops, xRenderColor * colors, int *error);
|
||||
|
||||
#ifdef PANORAMIX
|
||||
extern _X_EXPORT void PanoramiXRenderInit (void);
|
||||
extern _X_EXPORT void PanoramiXRenderReset (void);
|
||||
extern _X_EXPORT void PanoramiXRenderInit(void);
|
||||
extern _X_EXPORT void PanoramiXRenderReset(void);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -651,19 +595,19 @@ extern _X_EXPORT void PanoramiXRenderReset (void);
|
||||
*/
|
||||
|
||||
extern _X_EXPORT void
|
||||
PictTransform_from_xRenderTransform (PictTransformPtr pict,
|
||||
xRenderTransform *render);
|
||||
|
||||
PictTransform_from_xRenderTransform(PictTransformPtr pict,
|
||||
xRenderTransform * render);
|
||||
|
||||
extern _X_EXPORT void
|
||||
xRenderTransform_from_PictTransform (xRenderTransform *render,
|
||||
PictTransformPtr pict);
|
||||
|
||||
xRenderTransform_from_PictTransform(xRenderTransform * render,
|
||||
PictTransformPtr pict);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
PictureTransformPoint (PictTransformPtr transform,
|
||||
PictVectorPtr vector);
|
||||
PictureTransformPoint(PictTransformPtr transform, PictVectorPtr vector);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
PictureTransformPoint3d (PictTransformPtr transform,
|
||||
PictVectorPtr vector);
|
||||
PictureTransformPoint3d(PictTransformPtr transform, PictVectorPtr vector);
|
||||
|
||||
#endif /* _PICTURESTR_H_ */
|
||||
#endif /* _PICTURESTR_H_ */
|
||||
|
||||
3636
render/render.c
3636
render/render.c
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user