summaryrefslogtreecommitdiff
path: root/miext/rootless
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-07-14 13:14:28 -0700
committerJamey Sharp <jamey@minilop.net>2010-09-13 15:58:08 -0700
commit20798536326f94ac9c97b4ec7a51329f7c912991 (patch)
tree4f5e50552421d824e37d6d304a4c8259ba046aca /miext/rootless
parent58d1ec0fe84412c66f1ea1de15e3901c0b120164 (diff)
rootless: Delete dead remnants of rootless acceleration.
Jeremy deleted rootlessAccelInit's implementation in 2008 in commit 587c010a1cd733fded4d49dc339df0634bda8be6. 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>
Diffstat (limited to 'miext/rootless')
-rw-r--r--miext/rootless/README.txt41
-rw-r--r--miext/rootless/rootless.h69
-rw-r--r--miext/rootless/rootlessCommon.c2
-rw-r--r--miext/rootless/rootlessGC.c57
4 files changed, 11 insertions, 158 deletions
diff --git a/miext/rootless/README.txt b/miext/rootless/README.txt
index 7ec5c41b6..754715d33 100644
--- a/miext/rootless/README.txt
+++ b/miext/rootless/README.txt
@@ -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
@@ -322,44 +321,6 @@ typedef void (*RootlessCopyBytesProc)
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)
*
* wid Frame id
diff --git a/miext/rootless/rootless.h b/miext/rootless/rootless.h
index b2d8d0f07..3d4a1b077 100644
--- a/miext/rootless/rootless.h
+++ b/miext/rootless/rootless.h
@@ -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 */
@@ -292,44 +270,6 @@ typedef void (*RootlessCopyBytesProc)
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)
*
* wid Frame id
@@ -374,8 +314,6 @@ typedef struct _RootlessFrameProcs {
/* Optional acceleration functions */
RootlessCopyBytesProc CopyBytes;
- RootlessFillBytesProc FillBytes;
- RootlessCompositePixelsProc CompositePixels;
RootlessCopyWindowProc CopyWindow;
} RootlessFrameProcsRec, *RootlessFrameProcsPtr;
@@ -386,13 +324,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.
*
* create If true and the window has no frame, attempt to create one
diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c
index a9cd72a41..861e8e858 100644
--- a/miext/rootless/rootlessCommon.c
+++ b/miext/rootless/rootlessCommon.c
@@ -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;
diff --git a/miext/rootless/rootlessGC.c b/miext/rootless/rootlessGC.c
index 6af8d857f..68a9dc764 100644
--- a/miext/rootless/rootlessGC.c
+++ b/miext/rootless/rootlessGC.c
@@ -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);
}