if (glamor_prepare_access_picture(pPicture, GLAMOR_ACCESS_RW)) {
fbAddTraps(pPicture, x_off, y_off, ntrap, traps);
- glamor_finish_access_picture(pPicture, GLAMOR_ACCESS_RW);
}
+ glamor_finish_access_picture(pPicture);
return TRUE;
}
glamor_get_drawable_location(src),
glamor_get_drawable_location(dst));
- if (glamor_prepare_access(dst, GLAMOR_ACCESS_RW)) {
- if (dst == src || glamor_prepare_access(src, GLAMOR_ACCESS_RO)) {
- fbCopyNtoN(src, dst, gc, box, nbox,
- dx, dy, reverse, upsidedown, bitplane, closure);
- if (dst != src)
- glamor_finish_access(src, GLAMOR_ACCESS_RO);
- }
- glamor_finish_access(dst, GLAMOR_ACCESS_RW);
+ if (glamor_prepare_access(dst, GLAMOR_ACCESS_RW) &&
+ glamor_prepare_access(src, GLAMOR_ACCESS_RO)) {
+ fbCopyNtoN(src, dst, gc, box, nbox,
+ dx, dy, reverse, upsidedown, bitplane, closure);
}
+ glamor_finish_access(src);
+ glamor_finish_access(dst);
ok = TRUE;
done:
&& glamor_ddx_fallback_check_pixmap(pDst))
goto fail;
- glamor_prepare_access(pDst, GLAMOR_ACCESS_RW);
- glamor_prepare_access(pSrc, GLAMOR_ACCESS_RO);
- *pRegion = fbCopyPlane(pSrc, pDst, pGC, srcx, srcy, w, h,
- dstx, dsty, bitPlane);
- glamor_finish_access(pSrc, GLAMOR_ACCESS_RO);
- glamor_finish_access(pDst, GLAMOR_ACCESS_RW);
+ if (glamor_prepare_access(pDst, GLAMOR_ACCESS_RW) &&
+ glamor_prepare_access(pSrc, GLAMOR_ACCESS_RO)) {
+ *pRegion = fbCopyPlane(pSrc, pDst, pGC, srcx, srcy, w, h,
+ dstx, dsty, bitPlane);
+ }
+ glamor_finish_access(pSrc);
+ glamor_finish_access(pDst);
return TRUE;
fail:
}
void
-glamor_finish_access(DrawablePtr drawable, glamor_access_t access_mode)
+glamor_finish_access(DrawablePtr drawable)
{
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
if (!glamor_prepare_access(&gc->tile.pixmap->drawable,
GLAMOR_ACCESS_RO)) {
if (gc->stipple)
- glamor_finish_access(&gc->stipple->drawable, GLAMOR_ACCESS_RO);
+ glamor_finish_access(&gc->stipple->drawable);
return FALSE;
}
}
glamor_finish_access_gc(GCPtr gc)
{
if (gc->fillStyle == FillTiled)
- glamor_finish_access(&gc->tile.pixmap->drawable, GLAMOR_ACCESS_RO);
+ glamor_finish_access(&gc->tile.pixmap->drawable);
if (gc->stipple)
- glamor_finish_access(&gc->stipple->drawable, GLAMOR_ACCESS_RO);
+ glamor_finish_access(&gc->stipple->drawable);
}
Bool
(&old_tile->drawable, GLAMOR_ACCESS_RO)) {
new_tile =
fb24_32ReformatTile(old_tile, drawable->bitsPerPixel);
- glamor_finish_access(&old_tile->drawable, GLAMOR_ACCESS_RO);
+ glamor_finish_access(&old_tile->drawable);
}
}
if (new_tile) {
if (glamor_prepare_access
(&gc->tile.pixmap->drawable, GLAMOR_ACCESS_RW)) {
fbPadPixmap(gc->tile.pixmap);
- glamor_finish_access
- (&gc->tile.pixmap->drawable, GLAMOR_ACCESS_RW);
+ glamor_finish_access(&gc->tile.pixmap->drawable);
}
}
}
*/
if (glamor_prepare_access(&gc->stipple->drawable, GLAMOR_ACCESS_RW)) {
fbValidateGC(gc, changes, drawable);
- glamor_finish_access(&gc->stipple->drawable, GLAMOR_ACCESS_RW);
+ glamor_finish_access(&gc->stipple->drawable);
}
}
else {
if (!glamor_prepare_access(&pixmap->drawable, GLAMOR_ACCESS_RO))
return NULL;
ret = fbPixmapToRegion(pixmap);
- glamor_finish_access(&pixmap->drawable, GLAMOR_ACCESS_RO);
+ glamor_finish_access(&pixmap->drawable);
return ret;
}
x = 0;
y = 0;
}
- if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
- if (glamor_prepare_access_gc(gc)) {
- fbFill(drawable, gc, x, y, width, height);
- glamor_finish_access_gc(gc);
- }
- glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
+ if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) &&
+ glamor_prepare_access_gc(gc)) {
+ fbFill(drawable, gc, x, y, width, height);
}
+ glamor_finish_access_gc(gc);
+ glamor_finish_access(drawable);
if (sub_pixmap != NULL) {
if (gc->fillStyle != FillSolid) {
}
glamor_fallback("to %p (%c)\n", drawable,
glamor_get_drawable_location(drawable));
- if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
- if (glamor_prepare_access_gc(gc)) {
- fbFillSpans(drawable, gc, n, points, widths, sorted);
- glamor_finish_access_gc(gc);
- }
- glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
+ if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) &&
+ glamor_prepare_access_gc(gc)) {
+ fbFillSpans(drawable, gc, n, points, widths, sorted);
}
+ glamor_finish_access_gc(gc);
+ glamor_finish_access(drawable);
ret = TRUE;
done:
ret = TRUE;
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RO)) {
fbGetSpans(drawable, wmax, points, widths, count, dst);
- glamor_finish_access(drawable, GLAMOR_ACCESS_RO);
}
+ glamor_finish_access(drawable);
done:
return ret;
}
}
void
-glamor_finish_access_picture(PicturePtr picture, glamor_access_t access)
+glamor_finish_access_picture(PicturePtr picture)
{
if (!picture || !picture->pDrawable)
return;
- glamor_finish_access(picture->pDrawable, access);
+ glamor_finish_access(picture->pDrawable);
}
/*
glamor_fallback(" to %p (%c)\n",
drawable, glamor_get_drawable_location(drawable));
- if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
- if (glamor_prepare_access_gc(gc)) {
- fbPolyFillRect(drawable, gc, nrect, prect);
- glamor_finish_access_gc(gc);
- }
- glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
+ if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) &&
+ glamor_prepare_access_gc(gc)) {
+ fbPolyFillRect(drawable, gc, nrect, prect);
}
+ glamor_finish_access_gc(gc);
+ glamor_finish_access(drawable);
ret = TRUE;
done:
return FALSE;
if (gc->lineWidth == 0) {
- if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
- if (glamor_prepare_access_gc(gc)) {
- fbPolyLine(drawable, gc, mode, n, points);
- glamor_finish_access_gc(gc);
- }
- glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
+ if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) &&
+ glamor_prepare_access_gc(gc)) {
+ fbPolyLine(drawable, gc, mode, n, points);
}
+ glamor_finish_access_gc(gc);
+ glamor_finish_access(drawable);
}
else {
wide_line:
/* glamor_core.c */
Bool glamor_prepare_access(DrawablePtr drawable, glamor_access_t access);
-void glamor_finish_access(DrawablePtr drawable, glamor_access_t access);
+void glamor_finish_access(DrawablePtr drawable);
Bool glamor_prepare_access_window(WindowPtr window);
void glamor_finish_access_window(WindowPtr window);
Bool glamor_prepare_access_gc(GCPtr gc);
Bool glamor_prepare_access_picture(PicturePtr picture, glamor_access_t access);
-void glamor_finish_access_picture(PicturePtr picture, glamor_access_t access);
+void glamor_finish_access_picture(PicturePtr picture);
void glamor_destroy_picture(PicturePtr picture);
fail:
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
fbPutImage(drawable, gc, 1, x, y, w, h, left_pad, XYBitmap, bits);
- glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
}
+ glamor_finish_access(drawable);
}
#endif
if (mask && mask->pDrawable && !mask->transform)
GET_SUB_PICTURE(mask, GLAMOR_ACCESS_RO);
- if (glamor_prepare_access_picture(dest, GLAMOR_ACCESS_RW)) {
- if (source_pixmap == dest_pixmap || glamor_prepare_access_picture
- (source, GLAMOR_ACCESS_RO)) {
- if (!mask || glamor_prepare_access_picture(mask, GLAMOR_ACCESS_RO)) {
- fbComposite(op,
- source, mask, dest,
- x_source, y_source,
- x_mask, y_mask, x_dest, y_dest, width, height);
- if (mask)
- glamor_finish_access_picture(mask, GLAMOR_ACCESS_RO);
- }
- if (source_pixmap != dest_pixmap)
- glamor_finish_access_picture(source, GLAMOR_ACCESS_RO);
- }
- glamor_finish_access_picture(dest, GLAMOR_ACCESS_RW);
- }
+ if (glamor_prepare_access_picture(dest, GLAMOR_ACCESS_RW) &&
+ glamor_prepare_access_picture(source, GLAMOR_ACCESS_RO) &&
+ glamor_prepare_access_picture(mask, GLAMOR_ACCESS_RO)) {
+ fbComposite(op,
+ source, mask, dest,
+ x_source, y_source,
+ x_mask, y_mask, x_dest, y_dest, width, height);
+ }
+ glamor_finish_access_picture(mask);
+ glamor_finish_access_picture(source);
+ glamor_finish_access_picture(dest);
#define PUT_SUB_PICTURE(p, access) do { \
if (sub_ ##p ##_pixmap != NULL) { \
drawable, glamor_get_drawable_location(drawable));
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
fbSetSpans(drawable, gc, src, points, widths, numPoints, sorted);
- glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
}
+ glamor_finish_access(drawable);
ret = TRUE;
done:
|| glamor_ddx_fallback_check_pixmap(pSrc->pDrawable)))
return FALSE;
- if (glamor_prepare_access_picture(pDst, GLAMOR_ACCESS_RW)) {
- if (glamor_prepare_access_picture(pSrc, GLAMOR_ACCESS_RO)) {
-
- fbTriangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntris, tris);
-
- glamor_finish_access_picture(pSrc, GLAMOR_ACCESS_RO);
- }
-
- glamor_finish_access_picture(pDst, GLAMOR_ACCESS_RW);
+ if (glamor_prepare_access_picture(pDst, GLAMOR_ACCESS_RW) &&
+ glamor_prepare_access_picture(pSrc, GLAMOR_ACCESS_RO)) {
+ fbTriangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntris, tris);
}
+ glamor_finish_access_picture(pSrc);
+ glamor_finish_access_picture(pDst);
+
return TRUE;
}
default:
ErrorF("dump depth %d, not implemented.\n", pixmap->drawable.depth);
}
- glamor_finish_access(&pixmap->drawable, GLAMOR_ACCESS_RO);
+ glamor_finish_access(&pixmap->drawable);
}
static inline void
{
assert(pixmap1->drawable.depth == pixmap2->drawable.depth);
- glamor_prepare_access(&pixmap1->drawable, GLAMOR_ACCESS_RO);
- glamor_prepare_access(&pixmap2->drawable, GLAMOR_ACCESS_RO);
-
- _glamor_compare_pixmaps(pixmap1, pixmap2, x, y, w, h, -1, all, diffs);
-
- glamor_finish_access(&pixmap1->drawable, GLAMOR_ACCESS_RO);
- glamor_finish_access(&pixmap2->drawable, GLAMOR_ACCESS_RO);
+ if (glamor_prepare_access(&pixmap1->drawable, GLAMOR_ACCESS_RO) &&
+ glamor_prepare_access(&pixmap2->drawable, GLAMOR_ACCESS_RO)) {
+ _glamor_compare_pixmaps(pixmap1, pixmap2, x, y, w, h, -1, all, diffs);
+ }
+ glamor_finish_access(&pixmap1->drawable);
+ glamor_finish_access(&pixmap2->drawable);
}
/* This function is used to compare two pictures.
return;
}
- glamor_prepare_access(&fst_pixmap->drawable, GLAMOR_ACCESS_RO);
- glamor_prepare_access(&snd_pixmap->drawable, GLAMOR_ACCESS_RO);
-
if ((fst_type == SourcePictTypeLinear) ||
(fst_type == SourcePictTypeRadial) ||
(fst_type == SourcePictTypeConical) ||
x_source = y_source = 0;
}
- _glamor_compare_pixmaps(fst_pixmap, snd_pixmap,
- x_source, y_source,
- width, height, fst_picture->format, all, diffs);
-
- glamor_finish_access(&fst_pixmap->drawable, GLAMOR_ACCESS_RO);
- glamor_finish_access(&snd_pixmap->drawable, GLAMOR_ACCESS_RO);
+ if (glamor_prepare_access(&fst_pixmap->drawable, GLAMOR_ACCESS_RO) &&
+ glamor_prepare_access(&snd_pixmap->drawable, GLAMOR_ACCESS_RO)) {
+ _glamor_compare_pixmaps(fst_pixmap, snd_pixmap,
+ x_source, y_source,
+ width, height, fst_picture->format,
+ all, diffs);
+ }
+ glamor_finish_access(&fst_pixmap->drawable);
+ glamor_finish_access(&snd_pixmap->drawable);
if (fst_generated)
glamor_destroy_picture(fst_picture);