Merge branch 'master' into xi2

This commit is contained in:
Peter Hutterer 2009-06-04 15:11:36 +10:00
commit 993daf0649
6 changed files with 24 additions and 40 deletions

View File

@ -3935,10 +3935,6 @@ static int indexForScanlinePad[ 65 ] = {
3 /* 64 bits per scanline pad unit */
};
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
/*
grow the array of screenRecs if necessary.
call the device-supplied initialization procedure

View File

@ -31,9 +31,6 @@
# include "picturestr.h"
#endif
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
static Bool ShadowCloseScreen (int i, ScreenPtr pScreen);
static void ShadowCopyWindow(
WindowPtr pWin,
@ -1364,44 +1361,44 @@ ShadowFontToBox(BoxPtr BB, DrawablePtr pDrawable, GCPtr pGC, int x, int y,
if (pFont->info.constantWidth) {
int ascent, descent, left, right = 0;
ascent = MAX(pFont->info.fontAscent, pFont->info.maxbounds.ascent);
descent = MAX(pFont->info.fontDescent, pFont->info.maxbounds.descent);
ascent = max(pFont->info.fontAscent, pFont->info.maxbounds.ascent);
descent = max(pFont->info.fontDescent, pFont->info.maxbounds.descent);
left = pFont->info.maxbounds.leftSideBearing;
if (count > 0) {
right = (count - 1) * pFont->info.maxbounds.characterWidth;
}
right += pFont->info.maxbounds.rightSideBearing;
BB->x1 =
MAX(pDrawable->x + x - left, (REGION_EXTENTS(pGC->pScreen,
max(pDrawable->x + x - left, (REGION_EXTENTS(pGC->pScreen,
&((WindowPtr) pDrawable)->winSize))->x1);
BB->y1 =
MAX(pDrawable->y + y - ascent,
max(pDrawable->y + y - ascent,
(REGION_EXTENTS(pGC->pScreen,
&((WindowPtr) pDrawable)->winSize))->y1);
BB->x2 =
MIN(pDrawable->x + x + right,
min(pDrawable->x + x + right,
(REGION_EXTENTS(pGC->pScreen,
&((WindowPtr) pDrawable)->winSize))->x2);
BB->y2 =
MIN(pDrawable->y + y + descent,
min(pDrawable->y + y + descent,
(REGION_EXTENTS(pGC->pScreen,
&((WindowPtr) pDrawable)->winSize))->y2);
} else {
ShadowTextExtent(pFont, count, chars, wide ? (FONTLASTROW(pFont) == 0)
? Linear16Bit : TwoD16Bit : Linear8Bit, BB);
BB->x1 =
MAX(pDrawable->x + x + BB->x1, (REGION_EXTENTS(pGC->pScreen,
max(pDrawable->x + x + BB->x1, (REGION_EXTENTS(pGC->pScreen,
&((WindowPtr) pDrawable)->winSize))->x1);
BB->y1 =
MAX(pDrawable->y + y + BB->y1,
max(pDrawable->y + y + BB->y1,
(REGION_EXTENTS(pGC->pScreen,
&((WindowPtr) pDrawable)->winSize))->y1);
BB->x2 =
MIN(pDrawable->x + x + BB->x2,
min(pDrawable->x + x + BB->x2,
(REGION_EXTENTS(pGC->pScreen,
&((WindowPtr) pDrawable)->winSize))->x2);
BB->y2 =
MIN(pDrawable->y + y + BB->y2,
min(pDrawable->y + y + BB->y2,
(REGION_EXTENTS(pGC->pScreen,
&((WindowPtr) pDrawable)->winSize))->y2);
}

View File

@ -39,14 +39,10 @@
#include <cursorstr.h>
#include <mipointrst.h>
#include <servermd.h>
#include "misc.h"
extern Bool g_fSoftwareCursor;
#ifndef MIN
#define MIN(x,y) ((x)<(y)?(x):(y))
#endif
#define BYTE_COUNT(x) (((x) + 7) / 8)
#define BRIGHTNESS(x) (x##Red * 0.299 + x##Green * 0.587 + x##Blue * 0.114)
@ -198,8 +194,8 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen)
nBytes = BYTE_COUNT(pScreenPriv->cursor.sm_cx) * pScreenPriv->cursor.sm_cy;
/* Get the effective width and height */
nCX = MIN(pScreenPriv->cursor.sm_cx, pCursor->bits->width);
nCY = MIN(pScreenPriv->cursor.sm_cy, pCursor->bits->height);
nCX = min(pScreenPriv->cursor.sm_cx, pCursor->bits->width);
nCY = min(pScreenPriv->cursor.sm_cy, pCursor->bits->height);
/* Allocate memory for the bitmaps */
pAnd = malloc (nBytes);

View File

@ -109,8 +109,8 @@ RootlessResolveColormap (ScreenPtr pScreen, int first_color,
map = RootlessGetColormap (pScreen);
if (map == NULL || map->class != PseudoColor) return FALSE;
last = MIN (map->pVisual->ColormapEntries, first_color + n_colors);
for (i = MAX (0, first_color); i < last; i++) {
last = min (map->pVisual->ColormapEntries, first_color + n_colors);
for (i = max (0, first_color); i < last; i++) {
Entry *ent = map->red + i;
uint16_t red, green, blue;

View File

@ -36,6 +36,7 @@
#ifndef _ROOTLESSCOMMON_H
#define _ROOTLESSCOMMON_H
#include "misc.h"
#include "rootless.h"
#include "fb.h"
@ -120,12 +121,6 @@ typedef struct _RootlessScreenRec {
unsigned int colormap_changed :1;
} RootlessScreenRec, *RootlessScreenPtr;
#undef MIN
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#undef MAX
#define MAX(x,y) ((x) > (y) ? (x) : (y))
// "Definition of the Porting Layer for the X11 Sample Server" says
// unwrap and rewrap of screen functions is unnecessary, but
// screen->CreateGC changes after a call to cfbCreateGC.

View File

@ -200,10 +200,10 @@ RootlessGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
x1 = x0 + w;
y1 = y0 + h;
x0 = MAX (x0, winRec->x);
y0 = MAX (y0, winRec->y);
x1 = MIN (x1, winRec->x + winRec->width);
y1 = MIN (y1, winRec->y + winRec->height);
x0 = max (x0, winRec->x);
y0 = max (y0, winRec->y);
x1 = min (x1, winRec->x + winRec->width);
y1 = min (y1, winRec->y + winRec->height);
sx = x0 - pDrawable->x;
sy = y0 - pDrawable->y;
@ -347,10 +347,10 @@ RootlessGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
x2 = x1 + glyph->info.width;
y2 = y1 + glyph->info.height;
box.x1 = MAX (box.x1, x1);
box.y1 = MAX (box.y1, y1);
box.x2 = MAX (box.x2, x2);
box.y2 = MAX (box.y2, y2);
box.x1 = max (box.x1, x1);
box.y1 = max (box.y1, y1);
box.x2 = max (box.x2, x2);
box.y2 = max (box.y2, y2);
x += glyph->info.xOff;
y += glyph->info.yOff;