From cab14a9a08ff06bc4cbef79c7be8f1d07c07ebf9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 21 Jan 2016 12:01:02 -0800 Subject: [PATCH] glamor: Drop the composite_with_copy path entirely. I originally inherited this from the EXA code, without determining whether it was really needed. Regular composite should end up doing the same thing, since it's all just shaders anyway. To the extent that it doesn't, we should fix composite. Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie --- glamor/glamor_render.c | 92 ------------------------------------------ 1 file changed, 92 deletions(-) diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c index 92b6b0cd0..1b226aa28 100644 --- a/glamor/glamor_render.c +++ b/glamor/glamor_render.c @@ -508,41 +508,6 @@ glamor_set_composite_solid(float *color, GLint uniform_location) glUniform4fv(uniform_location, 1, color); } -static int -compatible_formats(CARD8 op, PicturePtr dst, PicturePtr src) -{ - if (op == PictOpSrc) { - /* We can't do direct copies between different depths at 16bpp - * because r,g,b are allocated to different bits. - */ - if (dst->pDrawable->bitsPerPixel == 16 && - dst->pDrawable->depth != src->pDrawable->depth) { - return 0; - } - - if (src->format == dst->format) - return 1; - - if (src->format == PICT_a8r8g8b8 && dst->format == PICT_x8r8g8b8) - return 1; - - if (src->format == PICT_a8b8g8r8 && dst->format == PICT_x8b8g8r8) - return 1; - } - else if (op == PictOpOver) { - if (src->alphaMap || dst->alphaMap) - return 0; - - if (src->format != dst->format) - return 0; - - if (src->format == PICT_x8r8g8b8 || src->format == PICT_x8b8g8r8) - return 1; - } - - return 0; -} - static char glamor_get_picture_location(PicturePtr picture) { @@ -564,54 +529,6 @@ glamor_get_picture_location(PicturePtr picture) return glamor_get_drawable_location(picture->pDrawable); } -static Bool -glamor_composite_with_copy(CARD8 op, - PicturePtr source, - PicturePtr dest, - INT16 x_source, - INT16 y_source, - INT16 x_dest, INT16 y_dest, RegionPtr region) -{ - int ret = FALSE; - - if (!source->pDrawable) - return FALSE; - - if (!compatible_formats(op, dest, source)) - return FALSE; - - if (source->repeat || source->transform) { - return FALSE; - } - - x_dest += dest->pDrawable->x; - y_dest += dest->pDrawable->y; - x_source += source->pDrawable->x; - y_source += source->pDrawable->y; - if (PICT_FORMAT_A(source->format) == 0) { - /* Fallback if we sample outside the source so that we - * swizzle the correct clear color for out-of-bounds texels. - */ - if (region->extents.x1 + x_source - x_dest < 0) - goto cleanup_region; - if (region->extents.x2 + x_source - x_dest > source->pDrawable->width) - goto cleanup_region; - - if (region->extents.y1 + y_source - y_dest < 0) - goto cleanup_region; - if (region->extents.y2 + y_source - y_dest > source->pDrawable->height) - goto cleanup_region; - } - glamor_copy(source->pDrawable, - dest->pDrawable, NULL, - RegionRects(region), RegionNumRects(region), - x_source - x_dest, y_source - y_dest, - FALSE, FALSE, 0, NULL); - ret = TRUE; - cleanup_region: - return ret; -} - static void * glamor_setup_composite_vbo(ScreenPtr screen, int n_verts) { @@ -1451,15 +1368,6 @@ glamor_composite_clipped_region(CARD8 op, } } - if (!mask && temp_src) { - if (glamor_composite_with_copy(op, temp_src, dest, - x_temp_src, y_temp_src, - x_dest, y_dest, region)) { - ok = TRUE; - goto out; - } - } - if (temp_src_pixmap == dest_pixmap) { glamor_fallback("source and dest pixmaps are the same\n"); goto out;