summaryrefslogtreecommitdiff
path: root/glamor/glamor_render.c
diff options
context:
space:
mode:
Diffstat (limited to 'glamor/glamor_render.c')
-rw-r--r--glamor/glamor_render.c136
1 files changed, 0 insertions, 136 deletions
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 27c09fd48..efca36744 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1701,139 +1701,3 @@ glamor_composite(CARD8 op,
glamor_finish_access_picture(source);
glamor_finish_access_picture(dest);
}
-
-static void
-glamor_get_src_rect_extent(int nrect,
- glamor_composite_rect_t *rects, BoxPtr extent)
-{
- extent->x1 = MAXSHORT;
- extent->y1 = MAXSHORT;
- extent->x2 = MINSHORT;
- extent->y2 = MINSHORT;
-
- while (nrect--) {
- if (extent->x1 > rects->x_src)
- extent->x1 = rects->x_src;
- if (extent->y1 > rects->y_src)
- extent->y1 = rects->y_src;
- if (extent->x2 < rects->x_src + rects->width)
- extent->x2 = rects->x_src + rects->width;
- if (extent->y2 < rects->y_src + rects->height)
- extent->y2 = rects->y_src + rects->height;
- rects++;
- }
-}
-
-static void
-glamor_composite_src_rect_translate(int nrect,
- glamor_composite_rect_t *rects,
- int x, int y)
-{
- while (nrect--) {
- rects->x_src += x;
- rects->y_src += y;
- rects++;
- }
-}
-
-void
-glamor_composite_glyph_rects(CARD8 op,
- PicturePtr src, PicturePtr mask, PicturePtr dst,
- int nrect, glamor_composite_rect_t *rects)
-{
- int n;
- PicturePtr temp_src = NULL;
- glamor_composite_rect_t *r;
-
- ValidatePicture(src);
- ValidatePicture(dst);
- if (!(glamor_is_large_picture(src)
- || (mask && glamor_is_large_picture(mask))
- || glamor_is_large_picture(dst))) {
- PixmapPtr src_pixmap = NULL;
- PixmapPtr mask_pixmap = NULL;
- PixmapPtr dst_pixmap = NULL;
- PixmapPtr temp_src_pixmap = NULL;
- glamor_pixmap_private *src_pixmap_priv = NULL;
- glamor_pixmap_private *mask_pixmap_priv = NULL;
- glamor_pixmap_private *dst_pixmap_priv;
- glamor_pixmap_private *temp_src_priv = NULL;
- BoxRec src_extent;
-
- dst_pixmap = glamor_get_drawable_pixmap(dst->pDrawable);
- dst_pixmap_priv = glamor_get_pixmap_private(dst_pixmap);
-
- if (mask && mask->pDrawable) {
- mask_pixmap = glamor_get_drawable_pixmap(mask->pDrawable);
- mask_pixmap_priv = glamor_get_pixmap_private(mask_pixmap);
- }
- if (src->pDrawable) {
- src_pixmap = glamor_get_drawable_pixmap(src->pDrawable);
- src_pixmap_priv = glamor_get_pixmap_private(src_pixmap);
- }
-
- if (!src->pDrawable
- && (src->pSourcePict->type != SourcePictTypeSolidFill)) {
- glamor_get_src_rect_extent(nrect, rects, &src_extent);
- temp_src = glamor_convert_gradient_picture(dst->pDrawable->pScreen,
- src,
- src_extent.x1,
- src_extent.y1,
- src_extent.x2 -
- src_extent.x1,
- src_extent.y2 -
- src_extent.y1);
- if (!temp_src)
- goto fallback;
-
- temp_src_pixmap = (PixmapPtr) (temp_src->pDrawable);
- temp_src_priv = glamor_get_pixmap_private(temp_src_pixmap);
- glamor_composite_src_rect_translate(nrect, rects,
- -src_extent.x1, -src_extent.y1);
- }
- else {
- temp_src = src;
- temp_src_pixmap = src_pixmap;
- temp_src_priv = src_pixmap_priv;
- }
-
- if (mask && mask->componentAlpha) {
- if (op == PictOpOver) {
- if (glamor_composite_with_shader(PictOpOutReverse,
- temp_src, mask, dst,
- temp_src_pixmap, mask_pixmap, dst_pixmap,
- temp_src_priv,
- mask_pixmap_priv,
- dst_pixmap_priv, nrect, rects,
- TRUE))
- goto done;
- }
- }
- else {
- if (glamor_composite_with_shader
- (op, temp_src, mask, dst,
- temp_src_pixmap, mask_pixmap, dst_pixmap,
- temp_src_priv, mask_pixmap_priv,
- dst_pixmap_priv, nrect, rects, FALSE))
- goto done;
- }
- }
- fallback:
- n = nrect;
- r = rects;
-
- while (n--) {
- CompositePicture(op,
- temp_src ? temp_src : src,
- mask,
- dst,
- r->x_src, r->y_src,
- r->x_mask, r->y_mask,
- r->x_dst, r->y_dst, r->width, r->height);
- r++;
- }
-
- done:
- if (temp_src && temp_src != src)
- FreePicture(temp_src, 0);
-}