rootless: Delete dead remnants of rootless acceleration.

Jeremy deleted rootlessAccelInit's implementation in 2008 in commit
587c010a1c. Delete its prototype and the
remaining commented-out call to it.

It still makes sense for the rootless GC ops to relax the planemask, but
that's independent of the size of the operation, so quit checking the
thresholds there.

FillBytes and CompositePixels are not called anywhere, so delete
everything related to both.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Jeremy Huddleston <jeremyhu@apple.com>
Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
Jamey Sharp 2010-07-14 13:14:28 -07:00
parent 58d1ec0fe8
commit 2079853632
9 changed files with 11 additions and 204 deletions

View File

@ -463,8 +463,6 @@ static RootlessFrameProcsRec xprRootlessProcs = {
xprHideWindow,
xprUpdateColormap,
xp_copy_bytes,
xp_fill_bytes,
xp_composite_pixels,
xprCopyWindow
};
@ -480,8 +478,6 @@ xprInit(ScreenPtr pScreen)
TA_SERVER();
rootless_CopyBytes_threshold = xp_copy_bytes_threshold;
rootless_FillBytes_threshold = xp_fill_bytes_threshold;
rootless_CompositePixels_threshold = xp_composite_area_threshold;
rootless_CopyWindow_threshold = xp_scroll_area_threshold;
return TRUE;

View File

@ -367,12 +367,6 @@ xprAddScreen(int index, ScreenPtr pScreen)
static Bool
xprSetupScreen(int index, ScreenPtr pScreen)
{
// Initialize accelerated rootless drawing
// Note that this must be done before DamageSetup().
// These are crashing ugly... better to be stable and not crash for now.
//RootlessAccelInit(pScreen);
#ifdef DAMAGE
// The Damage extension needs to wrap underneath the
// generic rootless layer, so do it now.

View File

@ -1376,16 +1376,6 @@ winMWExtWMCopyBytes (unsigned int width, unsigned int height,
const void *src, unsigned int srcRowBytes,
void *dst, unsigned int dstRowBytes);
void
winMWExtWMFillBytes (unsigned int width, unsigned int height, unsigned int value,
void *dst, unsigned int dstRowBytes);
int
winMWExtWMCompositePixels (unsigned int width, unsigned int height, unsigned int function,
void *src[2], unsigned int srcRowBytes[2],
void *mask, unsigned int maskRowBytes,
void *dst[2], unsigned int dstRowBytes[2]);
void
winMWExtWMCopyWindow (RootlessFrameID wid, int dstNrects, const BoxRec *dstRects,
int dx, int dy);

View File

@ -61,8 +61,6 @@ winMWExtWMProcs = {
NULL,//winMWExtWMUpdateColorMap,
NULL,//winMWExtWMCopyBytes,
NULL,//winMWExtWMFillBytes,
NULL,//winMWExtWMCompositePixels,
winMWExtWMCopyWindow
};
#endif
@ -463,8 +461,6 @@ winFinishScreenInitFB (int index,
winDebug ("winScreenInit - MultiWindowExtWM - RootlessInit returned\n");
rootless_CopyBytes_threshold = 0;
rootless_FillBytes_threshold = 0;
rootless_CompositePixels_threshold = 0;
/* FIXME: How many? Profiling needed? */
rootless_CopyWindow_threshold = 1;

View File

@ -1006,28 +1006,6 @@ winMWExtWMCopyBytes (unsigned int width, unsigned int height,
#endif
}
void
winMWExtWMFillBytes (unsigned int width, unsigned int height, unsigned int value,
void *dst, unsigned int dstRowBytes)
{
#if CYGMULTIWINDOW_DEBUG
winDebug ("winMWExtWMFillBytes - Not implemented\n");
#endif
}
int
winMWExtWMCompositePixels (unsigned int width, unsigned int height, unsigned int function,
void *src[2], unsigned int srcRowBytes[2],
void *mask, unsigned int maskRowBytes,
void *dst[2], unsigned int dstRowBytes[2])
{
#if CYGMULTIWINDOW_DEBUG
winDebug ("winMWExtWMCompositePixels - Not implemented\n");
#endif
return 0;
}
void
winMWExtWMCopyWindow (RootlessFrameID wid, int nDstRects, const BoxRec *pDstRects,
int nDx, int nDy)

View File

@ -102,8 +102,7 @@ rootlessConfig.h:
offset that is applied to all screens when converting from
screen-local to global coordinates.
o rootless_CopyBytes_threshold, rootless_FillBytes_threshold,
rootless_CompositePixels_threshold, rootless_CopyWindow_threshold:
o rootless_CopyBytes_threshold, rootless_CopyWindow_threshold:
The minimum number of bytes or pixels for which to use the rootless
implementation's respective acceleration function. The rootless
acceleration functions are all optional so these will only be used
@ -321,44 +320,6 @@ typedef void (*RootlessCopyBytesProc)
const void *src, unsigned int srcRowBytes,
void *dst, unsigned int dstRowBytes);
/*
* Fill memory with 32-bit pattern. (Optional)
*
* width Bytes to fill per row
* height Number of rows
* value 32-bit pattern to fill with
* dst Destination data
* dstRowBytes Width of destination in bytes
*/
typedef void (*RootlessFillBytesProc)
(unsigned int width, unsigned int height, unsigned int value,
void *dst, unsigned int dstRowBytes);
/*
* Composite pixels from source and mask to destination. (Optional)
*
* width, height Size of area to composite to in pizels
* function Composite function built with RL_COMPOSITE_FUNCTION
* src Source data
* srcRowBytes Width of source in bytes (Passing NULL means source
* is a single pixel.
* mask Mask data
* maskRowBytes Width of mask in bytes
* dst Destination data
* dstRowBytes Width of destination in bytes
*
* For src and dst, the first element of the array is the color data. If
* the second element is non-null it implies there is alpha data (which
* may be meshed or planar). Data without alpha is assumed to be opaque.
*
* An X11 error code is returned.
*/
typedef int (*RootlessCompositePixelsProc)
(unsigned int width, unsigned int height, unsigned int function,
void *src[2], unsigned int srcRowBytes[2],
void *mask, unsigned int maskRowBytes,
void *dst[2], unsigned int dstRowBytes[2]);
/*
* Copy area in frame to another part of frame. (Optional)
*

View File

@ -82,30 +82,8 @@ extern int rootlessGlobalOffsetY;
/* The minimum number of bytes or pixels for which to use the
implementation's accelerated functions. */
extern unsigned int rootless_CopyBytes_threshold;
extern unsigned int rootless_FillBytes_threshold;
extern unsigned int rootless_CompositePixels_threshold;
extern unsigned int rootless_CopyWindow_threshold;
/* Operations used by CompositePixels */
enum rl_composite_op_enum {
RL_COMPOSITE_SRC = 0,
RL_COMPOSITE_OVER,
};
/* Data formats for depth field and composite functions */
enum rl_depth_enum {
RL_DEPTH_NIL = 0, /* null source when compositing */
RL_DEPTH_ARGB8888,
RL_DEPTH_RGB555,
RL_DEPTH_A8, /* for masks when compositing */
RL_DEPTH_INDEX8,
};
/* Macro to form the composite function for CompositePixels */
#define RL_COMPOSITE_FUNCTION(op, src_depth, mask_depth, dest_depth) \
(((op) << 24) | ((src_depth) << 16) \
| ((mask_depth) << 8) | ((dest_depth) << 0))
/* Gravity for window contents during resizing */
enum rl_gravity_enum {
RL_GRAVITY_NONE = 0, /* no gravity, fill everything */
@ -291,44 +269,6 @@ typedef void (*RootlessCopyBytesProc)
const void *src, unsigned int srcRowBytes,
void *dst, unsigned int dstRowBytes);
/*
* Fill memory with 32-bit pattern. (Optional)
*
* width Bytes to fill per row
* height Number of rows
* value 32-bit pattern to fill with
* dst Destination data
* dstRowBytes Width of destination in bytes
*/
typedef void (*RootlessFillBytesProc)
(unsigned int width, unsigned int height, unsigned int value,
void *dst, unsigned int dstRowBytes);
/*
* Composite pixels from source and mask to destination. (Optional)
*
* width, height Size of area to composite to in pizels
* function Composite function built with RL_COMPOSITE_FUNCTION
* src Source data
* srcRowBytes Width of source in bytes (Passing NULL means source
* is a single pixel.
* mask Mask data
* maskRowBytes Width of mask in bytes
* dst Destination data
* dstRowBytes Width of destination in bytes
*
* For src and dst, the first element of the array is the color data. If
* the second element is non-null it implies there is alpha data (which
* may be meshed or planar). Data without alpha is assumed to be opaque.
*
* An X11 error code is returned.
*/
typedef int (*RootlessCompositePixelsProc)
(unsigned int width, unsigned int height, unsigned int function,
void *src[2], unsigned int srcRowBytes[2],
void *mask, unsigned int maskRowBytes,
void *dst[2], unsigned int dstRowBytes[2]);
/*
* Copy area in frame to another part of frame. (Optional)
*
@ -374,8 +314,6 @@ typedef struct _RootlessFrameProcs {
/* Optional acceleration functions */
RootlessCopyBytesProc CopyBytes;
RootlessFillBytesProc FillBytes;
RootlessCompositePixelsProc CompositePixels;
RootlessCopyWindowProc CopyWindow;
} RootlessFrameProcsRec, *RootlessFrameProcsPtr;
@ -385,13 +323,6 @@ typedef struct _RootlessFrameProcs {
*/
Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs);
/*
* Initialize acceleration for rootless mode on a given screen.
* Note: RootlessAccelInit() must be called before DamageSetup()
* and RootlessInit() must be called afterwards.
*/
Bool RootlessAccelInit(ScreenPtr pScreen);
/*
* Return the frame ID for the physical window displaying the given window.
*

View File

@ -40,8 +40,6 @@
#include "colormapst.h"
unsigned int rootless_CopyBytes_threshold = 0;
unsigned int rootless_FillBytes_threshold = 0;
unsigned int rootless_CompositePixels_threshold = 0;
unsigned int rootless_CopyWindow_threshold = 0;
int rootlessGlobalOffsetX = 0;
int rootlessGlobalOffsetY = 0;

View File

@ -148,9 +148,6 @@ static GCOps rootlessGCOps = {
};
/*
There are two issues we must contend with when drawing. These are
controlled with ROOTLESS_PROTECT_ALPHA and RootlessAccelInit().
If ROOTLESS_PROTECT_ALPHA is set, we have to make sure that the alpha
channel of the on screen windows is always opaque. fb makes this harder
than it would otherwise be by noticing that a planemask of 0x00ffffff
@ -171,21 +168,8 @@ static GCOps rootlessGCOps = {
can do this when drawing op is GXcopy. We can also do this when copying
from another window since its alpha channel must also be opaque.
The other issue to consider is that the rootless implementation may
provide accelerated drawing functions if RootlessAccelInit() is called.For
some drawing primitives we swap in rootless acceleration functions, which
use the accelerated drawing functions where possible.
Where both alpha protection and acceleration is used, it is even a bigger
win to relax the planemask to all ones because most accelerated drawing
functions can only be used in this case. However, even if we can't set
the planemask to all ones, we can still use the accelerated
CompositePixels function for GXcopy if it is a forward copy. This is
mainly intended for copying from pixmaps to windows. The CompositePixels
operation used sets alpha to 0xFF during the copy.
The three macros below are used to implement this, potentially accelerated
drawing ops look something like this:
The three macros below are used to implement this. Drawing ops that can
potentially have their planemask relaxed look like:
OP {
GC_SAVE(gc);
@ -285,16 +269,6 @@ canAccelFill(DrawablePtr pDraw, GCPtr pGC)
return canAccelBlit(pDraw, pGC);
}
static unsigned int
boxBytes(DrawablePtr pDraw, BoxRec *box)
{
unsigned int pixels;
pixels = (box->x2 - box->x1) * (box->y2 - box->y1);
return pixels * (pDraw->bitsPerPixel >> 3);
}
/*
* Screen function to create a graphics context
@ -477,8 +451,7 @@ RootlessFillSpans(DrawablePtr dst, GCPtr pGC, int nInit,
RootlessStartDrawing((WindowPtr) dst);
if (canAccelFill(dst, pGC) &&
boxBytes(dst, &box) >= rootless_FillBytes_threshold)
if (canAccelFill(dst, pGC))
{
GC_UNSET_PM(pGC, dst);
}
@ -584,15 +557,11 @@ RootlessCopyArea(DrawablePtr pSrc, DrawablePtr dst, GCPtr pGC,
RL_DEBUG_MSG("copy area start (src 0x%x, dst 0x%x)", pSrc, dst);
if (pSrc->type == DRAWABLE_WINDOW && IsFramedWindow((WindowPtr)pSrc)) {
unsigned int bytes;
/* If both source and dest are windows, and we're doing
a simple copy operation, we can remove the alpha-protecting
planemask (since source has opaque alpha as well) */
bytes = w * h * (pSrc->depth >> 3);
if (bytes >= rootless_CopyBytes_threshold && canAccelBlit(pSrc, pGC))
if (canAccelBlit(pSrc, pGC))
{
GC_UNSET_PM(pGC, dst);
}
@ -1064,8 +1033,7 @@ static void RootlessFillPolygon(DrawablePtr dst, GCPtr pGC,
RootlessStartDrawing((WindowPtr) dst);
if (canAccelFill(dst, pGC) &&
boxBytes(dst, &box) >= rootless_FillBytes_threshold)
if (canAccelFill(dst, pGC))
{
GC_UNSET_PM(pGC, dst);
}
@ -1117,8 +1085,7 @@ static void RootlessPolyFillRect(DrawablePtr dst, GCPtr pGC,
RootlessStartDrawing((WindowPtr) dst);
if (canAccelFill(dst, pGC) &&
boxBytes(dst, &box) >= rootless_FillBytes_threshold)
if (canAccelFill(dst, pGC))
{
GC_UNSET_PM(pGC, dst);
}
@ -1170,8 +1137,7 @@ static void RootlessPolyFillArc(DrawablePtr dst, GCPtr pGC,
RootlessStartDrawing((WindowPtr) dst);
if (canAccelFill(dst, pGC) &&
boxBytes(dst, &box) >= rootless_FillBytes_threshold)
if (canAccelFill(dst, pGC))
{
GC_UNSET_PM(pGC, dst);
}
@ -1221,8 +1187,7 @@ static void RootlessImageText8(DrawablePtr dst, GCPtr pGC,
RootlessStartDrawing((WindowPtr) dst);
if (canAccelFill(dst, pGC) &&
boxBytes(dst, &box) >= rootless_FillBytes_threshold)
if (canAccelFill(dst, pGC))
{
GC_UNSET_PM(pGC, dst);
}
@ -1309,8 +1274,7 @@ static void RootlessImageText16(DrawablePtr dst, GCPtr pGC,
RootlessStartDrawing((WindowPtr) dst);
if (canAccelFill(dst, pGC) &&
boxBytes(dst, &box) >= rootless_FillBytes_threshold)
if (canAccelFill(dst, pGC))
{
GC_UNSET_PM(pGC, dst);
}
@ -1408,8 +1372,7 @@ static void RootlessImageGlyphBlt(DrawablePtr dst, GCPtr pGC,
RootlessStartDrawing((WindowPtr) dst);
if (canAccelFill(dst, pGC) &&
boxBytes(dst, &box) >= rootless_FillBytes_threshold)
if (canAccelFill(dst, pGC))
{
GC_UNSET_PM(pGC, dst);
}