[PATCH 3/3] winex11.drv: require Xrender 0.9.1

Emil Velikov emil.l.velikov at gmail.com
Sun Oct 10 15:06:19 CDT 2021


Bump the requirement to 0.9.1, released over 10 years ago. Even older
distributions ship much newer version. For example:

  Debian 10 (Buster) oldstable - 0.9.10
  Ubuntu 18.04 (Bionic) - 0.9.10

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 configure.ac               |  6 ++----
 dlls/winex11.drv/xrender.c | 20 ++------------------
 include/config.h.in        |  6 ------
 3 files changed, 4 insertions(+), 28 deletions(-)

diff --git a/configure.ac b/configure.ac
index 530785c0033..b8dbf8dfb38 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1167,11 +1167,9 @@ then
         then
             WINE_CHECK_SONAME(Xrender,XRenderQueryExtension,
               [AC_CHECK_LIB(Xrender,XRenderSetPictureTransform,
-                [AC_DEFINE(HAVE_XRENDERSETPICTURETRANSFORM, 1,
-                 [Define if Xrender has the XRenderSetPictureTransform function])],,[$X_LIBS $X_EXTRA_LIBS])
+                 ,[AC_MSG_ERROR([Xrender library too old, missing XRenderSetPictureTransform])],[$X_LIBS $X_EXTRA_LIBS])
                AC_CHECK_LIB(Xrender,XRenderCreateLinearGradient,
-                [AC_DEFINE(HAVE_XRENDERCREATELINEARGRADIENT, 1,
-                 [Define if Xrender has the XRenderCreateLinearGradient function])],,[$X_LIBS $X_EXTRA_LIBS])],,[$X_LIBS $X_EXTRA_LIBS])
+                 ,[AC_MSG_ERROR([Xrender library too old, missing XRenderCreateLinearGradient])],[$X_LIBS $X_EXTRA_LIBS])],,[$X_LIBS $X_EXTRA_LIBS])
 
         fi
         WINE_WARNING_WITH(xrender,[test "x$ac_cv_lib_soname_Xrender" = "x"],
diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index ac19af79e10..20f9d42cf01 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -179,12 +179,8 @@ MAKE_FUNCPTR(XRenderFindVisualFormat)
 MAKE_FUNCPTR(XRenderFreeGlyphSet)
 MAKE_FUNCPTR(XRenderFreePicture)
 MAKE_FUNCPTR(XRenderSetPictureClipRectangles)
-#ifdef HAVE_XRENDERCREATELINEARGRADIENT
 MAKE_FUNCPTR(XRenderCreateLinearGradient)
-#endif
-#ifdef HAVE_XRENDERSETPICTURETRANSFORM
 MAKE_FUNCPTR(XRenderSetPictureTransform)
-#endif
 MAKE_FUNCPTR(XRenderQueryExtension)
 
 #undef MAKE_FUNCPTR
@@ -328,7 +324,6 @@ const struct gdi_dc_funcs *X11DRV_XRender_Init(void)
     if (!(xrender_handle = dlopen(SONAME_LIBXRENDER, RTLD_NOW))) return NULL;
 
 #define LOAD_FUNCPTR(f) if((p##f = dlsym(xrender_handle, #f)) == NULL) return NULL
-#define LOAD_OPTIONAL_FUNCPTR(f) p##f = dlsym(xrender_handle, #f)
     LOAD_FUNCPTR(XRenderAddGlyphs);
     LOAD_FUNCPTR(XRenderChangePicture);
     LOAD_FUNCPTR(XRenderComposite);
@@ -342,13 +337,8 @@ const struct gdi_dc_funcs *X11DRV_XRender_Init(void)
     LOAD_FUNCPTR(XRenderFreePicture);
     LOAD_FUNCPTR(XRenderSetPictureClipRectangles);
     LOAD_FUNCPTR(XRenderQueryExtension);
-#ifdef HAVE_XRENDERCREATELINEARGRADIENT
-    LOAD_OPTIONAL_FUNCPTR(XRenderCreateLinearGradient);
-#endif
-#ifdef HAVE_XRENDERSETPICTURETRANSFORM
-    LOAD_OPTIONAL_FUNCPTR(XRenderSetPictureTransform);
-#endif
-#undef LOAD_OPTIONAL_FUNCPTR
+    LOAD_FUNCPTR(XRenderCreateLinearGradient);
+    LOAD_FUNCPTR(XRenderSetPictureTransform);
 #undef LOAD_FUNCPTR
 
     if (!pXRenderQueryExtension(gdi_display, &event_base, &xrender_error_base)) return NULL;
@@ -451,7 +441,6 @@ static enum wxr_format get_xrender_format_from_bitmapinfo( const BITMAPINFO *inf
 /* Set the x/y scaling and x/y offsets in the transformation matrix of the source picture */
 static void set_xrender_transformation(Picture src_pict, double xscale, double yscale, int xoffset, int yoffset)
 {
-#ifdef HAVE_XRENDERSETPICTURETRANSFORM
     XTransform xform = {{
         { XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(xoffset) },
         { XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(yoffset) },
@@ -459,7 +448,6 @@ static void set_xrender_transformation(Picture src_pict, double xscale, double y
     }};
 
     pXRenderSetPictureTransform(gdi_display, src_pict, &xform);
-#endif
 }
 
 static void update_xrender_clipping( struct xrender_physdev *dev, HRGN rgn )
@@ -2018,7 +2006,6 @@ static BOOL CDECL xrenderdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *
 static BOOL CDECL xrenderdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
                                            void * grad_array, ULONG ngrad, ULONG mode )
 {
-#ifdef HAVE_XRENDERCREATELINEARGRADIENT
     static const XFixed stops[2] = { 0, 1 << 16 };
     struct xrender_physdev *physdev = get_xrender_dev( dev );
     XLinearGradient gradient;
@@ -2029,8 +2016,6 @@ static BOOL CDECL xrenderdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, U
     RECT rc;
     POINT pt[2];
 
-    if (!pXRenderCreateLinearGradient) goto fallback;
-
     /* <= 16-bpp uses dithering */
     if (!physdev->pict_format || physdev->pict_format->depth <= 16) goto fallback;
 
@@ -2111,7 +2096,6 @@ static BOOL CDECL xrenderdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, U
     }
 
 fallback:
-#endif
     dev = GET_NEXT_PHYSDEV( dev, pGradientFill );
     return dev->funcs->pGradientFill( dev, vert_array, nvert, grad_array, ngrad, mode );
 }
diff --git a/include/config.h.in b/include/config.h.in
index e975ca8a55d..d9d41890c5d 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -926,12 +926,6 @@
 /* Define if libxml2 has the xmlSchemaSetValidStructuredErrors function */
 #undef HAVE_XMLSCHEMASSETVALIDSTRUCTUREDERRORS
 
-/* Define if Xrender has the XRenderCreateLinearGradient function */
-#undef HAVE_XRENDERCREATELINEARGRADIENT
-
-/* Define if Xrender has the XRenderSetPictureTransform function */
-#undef HAVE_XRENDERSETPICTURETRANSFORM
-
 /* Define if Xrandr has the XRRGetProviderResources function */
 #undef HAVE_XRRGETPROVIDERRESOURCES
 
-- 
2.33.0




More information about the wine-devel mailing list