summaryrefslogtreecommitdiff
path: root/src/glamor_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/glamor_utils.h')
-rw-r--r--src/glamor_utils.h34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/glamor_utils.h b/src/glamor_utils.h
index d5c7b5f..eac3597 100644
--- a/src/glamor_utils.h
+++ b/src/glamor_utils.h
@@ -1193,7 +1193,7 @@ static inline void glamor_dump_pixmap(PixmapPtr pixmap, int x, int y, int w, int
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 _glamor_compare_pixmaps(PixmapPtr pixmap1, PixmapPtr pixmap2,
@@ -1320,13 +1320,12 @@ static inline void glamor_compare_pixmaps(PixmapPtr pixmap1, PixmapPtr pixmap2,
{
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.
@@ -1438,9 +1437,6 @@ static inline void glamor_compare_pictures( ScreenPtr screen,
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) ||
@@ -1450,13 +1446,15 @@ static inline void glamor_compare_pictures( ScreenPtr screen,
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);