diff options
author | Eric Anholt <eric@anholt.net> | 2009-02-24 18:22:20 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-02-26 14:20:42 -0800 |
commit | 22dc9a5580d77cc4707bfb8e19474e611a06ae9a (patch) | |
tree | 91a60fbcc1fba6b315549c7b112728320c5f30ec /uxa | |
parent | cb1f7ec0876746c1b52b63cdb508544e9e4e32e3 (diff) |
Fix UXA for server 1.4.
Diffstat (limited to 'uxa')
-rw-r--r-- | uxa/uxa-accel.c | 62 | ||||
-rw-r--r-- | uxa/uxa-glyphs.c | 4 | ||||
-rw-r--r-- | uxa/uxa-priv.h | 22 | ||||
-rw-r--r-- | uxa/uxa-render.c | 5 | ||||
-rw-r--r-- | uxa/uxa-unaccel.c | 18 | ||||
-rw-r--r-- | uxa/uxa.c | 31 |
6 files changed, 140 insertions, 2 deletions
diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c index 1b0af9c4..e3220543 100644 --- a/uxa/uxa-accel.c +++ b/uxa/uxa-accel.c @@ -977,6 +977,68 @@ out: return ret; } +#ifndef SERVER_1_5 +void +uxa_paint_window(WindowPtr pWin, RegionPtr pRegion, int what) +{ + ScreenPtr screen = pWin->drawable.pScreen; + uxa_screen_t *uxa_screen = uxa_get_screen(screen); + DDXPointRec zeros = { 0, 0 }; + + if (REGION_NIL(pRegion)) + return; + + if (uxa_screen->swappedOut) { + uxa_check_paint_window(pWin, pRegion, what); + return; + } + + switch (what) { + case PW_BACKGROUND: + switch (pWin->backgroundState) { + case None: + return; + case ParentRelative: + do { + pWin = pWin->parent; + } while (pWin->backgroundState == ParentRelative); + (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, + what); + return; + case BackgroundPixel: + if (uxa_fill_region_solid(&pWin->drawable, pRegion, + pWin->background.pixel, + FB_ALLONES, GXcopy)) + return; + break; + case BackgroundPixmap: + if (uxa_fill_region_tiled(&pWin->drawable, pRegion, + pWin->background.pixmap, + &zeros, FB_ALLONES, GXcopy)) + return; + break; + } + break; + case PW_BORDER: + if (pWin->borderIsPixel) { + if (uxa_fill_region_solid(&pWin->drawable, pRegion, + pWin->border.pixel, + FB_ALLONES, GXcopy)) + return; + break; + } else { + if (uxa_fill_region_tiled(&pWin->drawable, pRegion, + pWin->border.pixmap, + &zeros, FB_ALLONES, GXcopy)) + return; + break; + } + break; + } + + uxa_check_paint_window(pWin, pRegion, what); +} +#endif /* !SERVER_1_5 */ /** * Accelerates GetImage for solid ZPixmap downloads from framebuffer memory. diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c index 1c06e6d2..5abd0015 100644 --- a/uxa/uxa-glyphs.c +++ b/uxa/uxa-glyphs.c @@ -50,6 +50,8 @@ #include "mipict.h" +#ifdef SERVER_1_5 + #if DEBUG_GLYPH_CACHE #define DBG_GLYPH_CACHE(a) ErrorF a #else @@ -887,3 +889,5 @@ uxa_glyphs (CARD8 op, (*pScreen->DestroyPixmap) (pMaskPixmap); } } + +#endif /* SERVER_1_5 */ diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h index bdc6e82e..d1cd341e 100644 --- a/uxa/uxa-priv.h +++ b/uxa/uxa-priv.h @@ -26,6 +26,9 @@ #ifndef UXAPRIV_H #define UXAPRIV_H +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #else @@ -126,6 +129,10 @@ typedef struct { CloseScreenProcPtr SavedCloseScreen; GetImageProcPtr SavedGetImage; GetSpansProcPtr SavedGetSpans; +#ifndef SERVER_1_5 + PaintWindowBackgroundProcPtr SavedPaintWindowBackground; + PaintWindowBorderProcPtr SavedPaintWindowBorder; +#endif CreatePixmapProcPtr SavedCreatePixmap; DestroyPixmapProcPtr SavedDestroyPixmap; CopyWindowProcPtr SavedCopyWindow; @@ -161,7 +168,16 @@ typedef struct { #endif extern int uxa_screen_index; -#define uxa_get_screen(s) ((uxa_screen_t *)dixLookupPrivate(&(s)->devPrivates, &uxa_screen_index)) +static inline uxa_screen_t * +uxa_get_screen(ScreenPtr screen) +{ +#ifdef SERVER_1_5 + return (uxa_screen_t *)dixLookupPrivate(&screen->devPrivates, + &uxa_screen_index); +#else + return screen->devPrivates[uxa_screen_index].ptr; +#endif +} /** Align an offset to an arbitrary alignment */ #define UXA_ALIGN(offset, align) (((offset) + (align) - 1) - \ @@ -262,6 +278,8 @@ uxa_check_get_spans (DrawablePtr pDrawable, int nspans, char *pdstStart); +void uxa_check_paint_window (WindowPtr pWin, RegionPtr pRegion, int what); + void uxa_check_add_traps (PicturePtr pPicture, INT16 x_off, @@ -292,6 +310,8 @@ uxa_shm_put_image(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int form int w, int h, int sx, int sy, int sw, int sh, int dx, int dy, char *data); +void uxa_paint_window(WindowPtr pWin, RegionPtr pRegion, int what); + void uxa_get_image (DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d); diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c index b377bf53..edbf0d8c 100644 --- a/uxa/uxa-render.c +++ b/uxa/uxa-render.c @@ -818,8 +818,13 @@ uxa_create_alpha_picture (ScreenPtr pScreen, return 0; } +#ifdef SERVER_1_5 pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pPictFormat->depth, 0); +#else + pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, + pPictFormat->depth); +#endif if (!pPixmap) return 0; pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); diff --git a/uxa/uxa-unaccel.c b/uxa/uxa-unaccel.c index 8f864688..f63c03b7 100644 --- a/uxa/uxa-unaccel.c +++ b/uxa/uxa-unaccel.c @@ -336,6 +336,24 @@ uxa_check_get_spans (DrawablePtr pDrawable, } } +#ifndef SERVER_1_5 +void +uxa_check_paint_window (WindowPtr pWin, RegionPtr pRegion, int what) +{ + ScreenPtr screen = pWin->drawable.pScreen; + + UXA_FALLBACK(("from %p (%c)\n", pWin, + uxa_drawable_location (&pWin->drawable))); + if (uxa_prepare_access (&pWin->drawable, UXA_ACCESS_RW)) { + if (uxa_prepare_access_window (pWin)) { + fbPaintWindow (pWin, pRegion, what); + uxa_finish_access_window (pWin); + } + uxa_finish_access(&pWin->drawable); + } +} +#endif + void uxa_check_composite (CARD8 op, PicturePtr pSrc, @@ -40,6 +40,9 @@ #include "uxa.h" int uxa_screen_index; +#ifndef SERVER_1_5 +static int uxa_generation; +#endif /** * uxa_get_drawable_pixmap() returns a backing pixmap for a given drawable. @@ -367,12 +370,18 @@ uxa_close_screen(int i, ScreenPtr pScreen) PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); #endif +#ifdef SERVER_1_5 uxa_glyphs_fini(pScreen); +#endif pScreen->CreateGC = uxa_screen->SavedCreateGC; pScreen->CloseScreen = uxa_screen->SavedCloseScreen; pScreen->GetImage = uxa_screen->SavedGetImage; pScreen->GetSpans = uxa_screen->SavedGetSpans; +#ifndef SERVER_1_5 + pScreen->PaintWindowBackground = uxa_screen->SavedPaintWindowBackground; + pScreen->PaintWindowBorder = uxa_screen->SavedPaintWindowBorder; +#endif pScreen->CreatePixmap = uxa_screen->SavedCreatePixmap; pScreen->DestroyPixmap = uxa_screen->SavedDestroyPixmap; pScreen->CopyWindow = uxa_screen->SavedCopyWindow; @@ -469,7 +478,15 @@ uxa_driver_init(ScreenPtr screen, uxa_driver_t *uxa_driver) uxa_screen->info = uxa_driver; +#ifdef SERVER_1_5 dixSetPrivate(&screen->devPrivates, &uxa_screen_index, uxa_screen); +#else + if (uxa_generation != serverGeneration) { + uxa_screen_index = AllocateScreenPrivateIndex(); + uxa_generation = serverGeneration; + } + screen->devPrivates[uxa_screen_index].ptr = uxa_screen; +#endif // exaDDXDriverInit(screen); @@ -488,6 +505,14 @@ uxa_driver_init(ScreenPtr screen, uxa_driver_t *uxa_driver) uxa_screen->SavedGetSpans = screen->GetSpans; screen->GetSpans = uxa_check_get_spans; +#ifndef SERVER_1_5 + uxa_screen->SavedPaintWindowBackground = screen->PaintWindowBackground; + screen->PaintWindowBackground = uxa_paint_window; + + uxa_screen->SavedPaintWindowBorder = screen->PaintWindowBorder; + screen->PaintWindowBorder = uxa_paint_window; +#endif /* !SERVER_1_5 */ + uxa_screen->SavedCopyWindow = screen->CopyWindow; screen->CopyWindow = uxa_copy_window; @@ -505,9 +530,11 @@ uxa_driver_init(ScreenPtr screen, uxa_driver_t *uxa_driver) uxa_screen->SavedComposite = ps->Composite; ps->Composite = uxa_composite; +#ifdef SERVER_1_5 uxa_screen->SavedGlyphs = ps->Glyphs; ps->Glyphs = uxa_glyphs; - +#endif + uxa_screen->SavedTriangles = ps->Triangles; ps->Triangles = uxa_triangles; @@ -527,7 +554,9 @@ uxa_driver_init(ScreenPtr screen, uxa_driver_t *uxa_driver) ShmRegisterFuncs(screen, &uxa_shm_funcs); #endif +#ifdef SERVER_1_5 uxa_glyphs_init(screen); +#endif LogMessage(X_INFO, "UXA(%d): Driver registered support for the following" " operations:\n", screen->myNum); |