summaryrefslogtreecommitdiff
path: root/fb
diff options
context:
space:
mode:
Diffstat (limited to 'fb')
-rw-r--r--fb/Makefile.am1
-rw-r--r--fb/fb.h20
-rw-r--r--fb/fbbstore.c63
-rw-r--r--fb/fbcopy.c4
-rw-r--r--fb/fbpict.c30
-rw-r--r--fb/fbscreen.c6
-rw-r--r--fb/fbtrap.c8
-rw-r--r--fb/wfbrename.h1
8 files changed, 23 insertions, 110 deletions
diff --git a/fb/Makefile.am b/fb/Makefile.am
index 75861a38d..e34aaba10 100644
--- a/fb/Makefile.am
+++ b/fb/Makefile.am
@@ -24,7 +24,6 @@ libfb_la_SOURCES = \
fbbits.h \
fbblt.c \
fbbltone.c \
- fbbstore.c \
fbcopy.c \
fbfill.c \
fbfillrect.c \
diff --git a/fb/fb.h b/fb/fb.h
index 78e48e5bb..aba2bd252 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -26,7 +26,7 @@
#define _FB_H_
#include <X11/X.h>
-#include <pixman/pixman.h>
+#include <pixman.h>
#include "scrnintstr.h"
#include "pixmap.h"
@@ -1263,23 +1263,6 @@ fbBltPlane (FbBits *src,
Pixel planeMask);
/*
- * fbbstore.c
- */
-void
-fbSaveAreas(PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin);
-
-void
-fbRestoreAreas(PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin);
-
-/*
* fbcmap.c
*/
int
@@ -2118,6 +2101,7 @@ fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
pixman_image_t *image_from_pict (PicturePtr pict,
Bool has_clip);
+void free_pixman_pict (PicturePtr, pixman_image_t *);
#endif /* _FB_H_ */
diff --git a/fb/fbbstore.c b/fb/fbbstore.c
deleted file mode 100644
index 3ee5f5e35..000000000
--- a/fb/fbbstore.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "fb.h"
-
-void
-fbSaveAreas(PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin)
-{
- fbCopyWindowProc (&pWin->drawable,
- &pPixmap->drawable,
- 0,
- REGION_RECTS(prgnSave),
- REGION_NUM_RECTS(prgnSave),
- xorg, yorg,
- FALSE,
- FALSE,
- 0,0);
-}
-
-void
-fbRestoreAreas(PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin)
-{
- fbCopyWindowProc (&pPixmap->drawable,
- &pWin->drawable,
- 0,
- REGION_RECTS(prgnRestore),
- REGION_NUM_RECTS(prgnRestore),
- -xorg, -yorg,
- FALSE,
- FALSE,
- 0,0);
-}
diff --git a/fb/fbcopy.c b/fb/fbcopy.c
index 3ad01bfee..68f403f3f 100644
--- a/fb/fbcopy.c
+++ b/fb/fbcopy.c
@@ -64,8 +64,8 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
if (!pixman_blt ((uint32_t *)src, (uint32_t *)dst, srcStride, dstStride, srcBpp, dstBpp,
(pbox->x1 + dx + srcXoff),
(pbox->y1 + dy + srcYoff),
- (pbox->x1 + srcXoff),
- (pbox->y1 + srcYoff),
+ (pbox->x1 + dstXoff),
+ (pbox->y1 + dstYoff),
(pbox->x2 - pbox->x1),
(pbox->y2 - pbox->y1)))
goto fallback;
diff --git a/fb/fbpict.c b/fb/fbpict.c
index 9efa0e816..85b5171c5 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -185,15 +185,11 @@ fbComposite (CARD8 op,
pixman_image_composite (op, src, mask, dest,
xSrc, ySrc, xMask, yMask, xDst, yDst,
width, height);
-
}
-
- if (src)
- pixman_image_unref (src);
- if (mask)
- pixman_image_unref (mask);
- if (dest)
- pixman_image_unref (dest);
+
+ free_pixman_pict (pSrc, src);
+ free_pixman_pict (pMask, mask);
+ free_pixman_pict (pDst, dest);
}
void
@@ -295,9 +291,9 @@ create_bits_picture (PicturePtr pict,
pixman_image_t *image;
fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
-
- bits += yoff * stride + xoff;
-
+
+ bits = (CARD8*)bits + yoff * stride * sizeof(FbBits) + xoff * (bpp / 8);
+
image = pixman_image_create_bits (
pict->format,
pict->pDrawable->width, pict->pDrawable->height,
@@ -332,8 +328,6 @@ create_bits_picture (PicturePtr pict,
/* Indexed table */
if (pict->pFormat->index.devPrivate)
pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
-
- fbFinishAccess (pict->pDrawable);
return image;
}
@@ -379,7 +373,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict)
pixman_image_set_alpha_map (
image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
- pixman_image_unref (alpha_map);
+ free_pixman_pict (pict->alphaMap, alpha_map);
}
pixman_image_set_component_alpha (image, pict->componentAlpha);
@@ -403,6 +397,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict)
}
pixman_image_set_filter (image, filter, (pixman_fixed_t *)pict->filter_params, pict->filter_nparams);
+ pixman_image_set_source_clipping (image, TRUE);
}
pixman_image_t *
@@ -445,6 +440,13 @@ image_from_pict (PicturePtr pict,
return image;
}
+void
+free_pixman_pict (PicturePtr pict, pixman_image_t *image)
+{
+ if (image && pixman_image_unref (image) && pict->pDrawable)
+ fbFinishAccess (pict->pDrawable);
+}
+
Bool
fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
diff --git a/fb/fbscreen.c b/fb/fbscreen.c
index 94033f1d1..661268c74 100644
--- a/fb/fbscreen.c
+++ b/fb/fbscreen.c
@@ -142,12 +142,6 @@ fbSetupScreen(ScreenPtr pScreen,
pScreen->GetWindowPixmap = _fbGetWindowPixmap;
pScreen->SetWindowPixmap = _fbSetWindowPixmap;
- pScreen->BackingStoreFuncs.SaveAreas = fbSaveAreas;
- pScreen->BackingStoreFuncs.RestoreAreas = fbRestoreAreas;
- pScreen->BackingStoreFuncs.SetClipmaskRgn = 0;
- pScreen->BackingStoreFuncs.GetImagePixmap = 0;
- pScreen->BackingStoreFuncs.GetSpansPixmap = 0;
-
return TRUE;
}
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index e70336cce..830603ae7 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -47,9 +47,7 @@ fbAddTraps (PicturePtr pPicture,
pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps);
- fbFinishAccess (pPicture->pDrawable);
-
- pixman_image_unref (image);
+ free_pixman_pict (pPicture, image);
}
void
@@ -65,9 +63,7 @@ fbRasterizeTrapezoid (PicturePtr pPicture,
pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off);
- fbFinishAccess (pPicture->pDrawable);
-
- pixman_image_unref (image);
+ free_pixman_pict (pPicture, image);
}
static int
diff --git a/fb/wfbrename.h b/fb/wfbrename.h
index 952512ecc..5ea9092f8 100644
--- a/fb/wfbrename.h
+++ b/fb/wfbrename.h
@@ -188,6 +188,7 @@
#define fbWinPrivateIndex wfbWinPrivateIndex
#define fbZeroLine wfbZeroLine
#define fbZeroSegment wfbZeroSegment
+#define free_pixman_pict wfb_free_pixman_pict
#define image_from_pict wfb_image_from_pict
#define xxScrPrivateIndex wfbxxScrPrivateIndex
#define xxGCPrivateIndex wfbxxGCPrivateIndex