dix: delete logo hack screen saver

Protocol doesn't mention about screen saver with logo being required and
people are already using more intelligent ways to draw screen saver themes. So
consider -logo as deprecated option, deleting its code.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
Tiago Vignatti 2010-10-20 17:54:58 -02:00
parent 88cb61e1e5
commit bfe9cdd11b
6 changed files with 0 additions and 232 deletions

View File

@ -106,10 +106,6 @@ CARD32 defaultScreenSaverTime = DEFAULT_SCREEN_SAVER_TIME;
CARD32 defaultScreenSaverInterval = DEFAULT_SCREEN_SAVER_INTERVAL;
int defaultScreenSaverBlanking = DEFAULT_SCREEN_SAVER_BLANKING;
int defaultScreenSaverAllowExposures = DEFAULT_SCREEN_SAVER_EXPOSURES;
#ifndef NOLOGOHACK
int logoScreenSaver = DEFAULT_LOGO_SCREEN_SAVER;
#endif
#ifdef SCREENSAVER
Bool screenSaverSuspended = FALSE;
#endif

View File

@ -3087,13 +3087,6 @@ SendVisibilityNotify(WindowPtr pWin)
}
#define RANDOM_WIDTH 32
#ifndef NOLOGOHACK
static void DrawLogo(
WindowPtr pWin
);
#endif
int
dixSaveScreens(ClientPtr client, int on, int mode)
{
@ -3155,18 +3148,10 @@ dixSaveScreens(ClientPtr client, int on, int mode)
* for the root window, so miPaintWindow works
*/
screenIsSaved = SCREEN_SAVER_OFF;
#ifndef NOLOGOHACK
if (logoScreenSaver)
(*pWin->drawable.pScreen->ClearToBackground)(pWin, 0, 0, 0, 0, FALSE);
#endif
(*pWin->drawable.pScreen->MoveWindow)(pWin,
(short)(-(rand() % RANDOM_WIDTH)),
(short)(-(rand() % RANDOM_WIDTH)),
pWin->nextSib, VTMove);
#ifndef NOLOGOHACK
if (logoScreenSaver)
DrawLogo(pWin);
#endif
screenIsSaved = SCREEN_SAVER_ON;
}
/*
@ -3324,10 +3309,6 @@ TileScreenSaver(ScreenPtr pScreen, int kind)
(*pWin->drawable.pScreen->ChangeWindowAttributes)(pWin, CWBackPixmap);
}
MapWindow(pWin, serverClient);
#ifndef NOLOGOHACK
if (kind == SCREEN_IS_TILED && logoScreenSaver)
DrawLogo(pWin);
#endif
return TRUE;
}
@ -3673,184 +3654,3 @@ WindowParentHasDeviceCursor(WindowPtr pWin,
}
return FALSE;
}
#ifndef NOLOGOHACK
static void
DrawLogo(WindowPtr pWin)
{
DrawablePtr pDraw;
ScreenPtr pScreen;
int x, y;
unsigned int width, height, size;
GC *pGC;
int rc, thin, gap, d31;
DDXPointRec poly[4];
ChangeGCVal fore[2], back[2];
xrgb rgb[2];
BITS32 fmask, bmask;
ColormapPtr cmap;
pDraw = (DrawablePtr)pWin;
pScreen = pDraw->pScreen;
x = -pWin->origin.x;
y = -pWin->origin.y;
width = pScreen->width;
height = pScreen->height;
pGC = GetScratchGC(pScreen->rootDepth, pScreen);
if (!pGC)
return;
if ((rand() % 100) <= 17) /* make the probability for white fairly low */
fore[0].val = pScreen->whitePixel;
else
fore[0].val = pScreen->blackPixel;
if (pWin->backgroundState == BackgroundPixel) {
rc = dixLookupResourceByType((pointer *)&cmap, wColormap(pWin),
RT_COLORMAP, serverClient, DixReadAccess);
if (rc == Success) {
Pixel querypixels[2];
querypixels[0] = fore[0].val;
querypixels[1] = pWin->background.pixel;
QueryColors(cmap, 2, querypixels, rgb, serverClient);
if ((rgb[0].red == rgb[1].red) &&
(rgb[0].green == rgb[1].green) &&
(rgb[0].blue == rgb[1].blue)) {
if (fore[0].val == pScreen->blackPixel)
fore[0].val = pScreen->whitePixel;
else
fore[0].val = pScreen->blackPixel;
}
}
}
fore[1].val = FillSolid;
fmask = GCForeground|GCFillStyle;
if (pWin->backgroundState == BackgroundPixel) {
back[0].val = pWin->background.pixel;
back[1].val = FillSolid;
bmask = GCForeground|GCFillStyle;
} else {
back[0].val = 0;
back[1].val = 0;
ChangeGC(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin, back);
back[0].val = FillTiled;
back[1].ptr = pWin->background.pixmap;
bmask = GCFillStyle|GCTile;
}
/* should be the same as the reference function XmuDrawLogo() */
size = width;
if (height < width)
size = height;
size = RANDOM_WIDTH + rand() % (size - RANDOM_WIDTH);
size &= ~1;
x += rand() % (width - size);
y += rand() % (height - size);
/*
* Draw what will be the thin strokes.
*
* -----
* / /
* / /
* / /
* / /
* /____/
* d
*
* Point d is 9/44 (~1/5) of the way across.
*/
thin = (size / 11);
if (thin < 1) thin = 1;
gap = (thin+3) / 4;
d31 = thin + thin + gap;
poly[0].x = x + size; poly[0].y = y;
poly[1].x = x + size-d31; poly[1].y = y;
poly[2].x = x + 0; poly[2].y = y + size;
poly[3].x = x + d31; poly[3].y = y + size;
ChangeGC(NullClient, pGC, fmask, fore);
ValidateGC(pDraw, pGC);
(*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
/*
* Erase area not needed for lower thin stroke.
*
* ------
* / /
* / __ /
* / / /
* / / /
* /__/__/
*/
poly[0].x = x + d31/2; poly[0].y = y + size;
poly[1].x = x + size / 2; poly[1].y = y + size/2;
poly[2].x = x + (size/2)+(d31-(d31/2)); poly[2].y = y + size/2;
poly[3].x = x + d31; poly[3].y = y + size;
ChangeGC(NullClient, pGC, bmask, back);
ValidateGC(pDraw, pGC);
(*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
/*
* Erase area not needed for upper thin stroke.
*
* ------
* / / /
* /--/ /
* / /
* / /
* /_____/
*/
poly[0].x = x + size - d31/2; poly[0].y = y;
poly[1].x = x + size / 2; poly[1].y = y + size/2;
poly[2].x = x + (size/2)-(d31-(d31/2)); poly[2].y = y + size/2;
poly[3].x = x + size - d31; poly[3].y = y;
ValidateGC(pDraw, pGC);
(*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
/*
* Draw thick stroke.
* Point b is 1/4 of the way across.
*
* b
* -----
* \ \
* \ \
* \ \
* \ \
* \____\
*/
poly[0].x = x; poly[0].y = y;
poly[1].x = x + size/4; poly[1].y = y;
poly[2].x = x + size; poly[2].y = y + size;
poly[3].x = x + size - size/4; poly[3].y = y + size;
ChangeGC(NullClient, pGC, fmask, fore);
ValidateGC(pDraw, pGC);
(*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
/*
* Erase to create gap.
*
* /
* /
* /
* /
* /
*/
poly[0].x = x + size- thin; poly[0].y = y;
poly[1].x = x + size-( thin+gap); poly[1].y = y;
poly[2].x = x + thin; poly[2].y = y + size;
poly[3].x = x + thin + gap; poly[3].y = y + size;
ChangeGC(NullClient, pGC, bmask, back);
ValidateGC(pDraw, pGC);
(*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
FreeScratchGC(pGC);
}
#endif

View File

@ -285,14 +285,6 @@ sets the stack space limit of the server to the specified number of kilobytes.
A value of zero makes the stack size as large as possible. The default value
of \-1 leaves the stack space limit unchanged.
.TP 8
.B \-logo
turns on the X Window System logo display in the screen-saver.
There is currently no way to change this from a client.
.TP 8
.B nologo
turns off the X Window System logo display in the screen-saver.
There is currently no way to change this from a client.
.TP 8
.B \-render
.BR default | mono | gray | color
sets the color allocation policy that will be used by the render extension.

View File

@ -56,9 +56,6 @@ extern _X_EXPORT Bool disableBackingStore;
extern _X_EXPORT Bool enableBackingStore;
extern _X_EXPORT Bool PartialNetwork;
extern _X_EXPORT Bool RunFromSigStopParent;
#ifndef NOLOGOHACK
extern _X_EXPORT int logoScreenSaver;
#endif
#ifdef RLIMIT_DATA
extern _X_EXPORT int limitDataSpace;
#endif

View File

@ -112,9 +112,6 @@ SOFTWARE.
#define DEFAULT_SCREEN_SAVER_INTERVAL (10 * (60 * 1000))
#define DEFAULT_SCREEN_SAVER_BLANKING PreferBlanking
#define DEFAULT_SCREEN_SAVER_EXPOSURES AllowExposures
#ifndef NOLOGOHACK
#define DEFAULT_LOGO_SCREEN_SAVER 1
#endif
#ifndef DEFAULT_ACCESS_CONTROL
#define DEFAULT_ACCESS_CONTROL TRUE
#endif

View File

@ -496,10 +496,6 @@ void UseMsg(void)
ErrorF("-ls int limit stack space to N Kb\n");
#endif
ErrorF("-nolock disable the locking mechanism\n");
#ifndef NOLOGOHACK
ErrorF("-logo enable logo in screen saver\n");
ErrorF("nologo disable logo in screen saver\n");
#endif
ErrorF("-nolisten string don't listen on protocol\n");
ErrorF("-noreset don't reset after last client exists\n");
ErrorF("-reset reset after last client exists\n");
@ -755,16 +751,6 @@ ProcessCommandLine(int argc, char *argv[])
#endif
nolock = TRUE;
}
#ifndef NOLOGOHACK
else if ( strcmp( argv[i], "-logo") == 0)
{
logoScreenSaver = 1;
}
else if ( strcmp( argv[i], "nologo") == 0)
{
logoScreenSaver = 0;
}
#endif
else if ( strcmp( argv[i], "-nolisten") == 0)
{
if(++i < argc) {