Add stretching support to AlphaBlend.

This commit is contained in:
Kevin Koltzau 2004-10-27 00:43:50 +00:00 committed by Alexandre Julliard
parent e86389e057
commit 92ec21bd2b
4 changed files with 115 additions and 3 deletions

75
configure vendored
View File

@ -7988,6 +7988,81 @@ _ACEOF
X_PRE_LIBS="$X_PRE_LIBS -lXv" X_PRE_LIBS="$X_PRE_LIBS -lXv"
fi
fi
if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes"
then
echo "$as_me:$LINENO: checking for XRenderSetPictureTransform in -lXrender" >&5
echo $ECHO_N "checking for XRenderSetPictureTransform in -lXrender... $ECHO_C" >&6
if test "${ac_cv_lib_Xrender_XRenderSetPictureTransform+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXrender $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char XRenderSetPictureTransform ();
int
main ()
{
XRenderSetPictureTransform ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Xrender_XRenderSetPictureTransform=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_Xrender_XRenderSetPictureTransform=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderSetPictureTransform" >&5
echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderSetPictureTransform" >&6
if test $ac_cv_lib_Xrender_XRenderSetPictureTransform = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_XRENDERSETPICTURETRANSFORM 1
_ACEOF
fi fi
fi fi

View File

@ -257,6 +257,15 @@ then
],, ],,
$X_LIBS -lXext -lX11 $X_EXTRA_LIBS) $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
fi fi
dnl *** Check for Transform functions in Xrender
if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes"
then
AC_CHECK_LIB(Xrender, XRenderSetPictureTransform,
[AC_DEFINE(HAVE_XRENDERSETPICTURETRANSFORM, 1,
[Define if Xrender has the XRenderSetPictureTransform function])],,
$X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
fi
] ]
) dnl *** End of X11/Xlib.h check ) dnl *** End of X11/Xlib.h check

View File

@ -130,6 +130,9 @@ MAKE_FUNCPTR(XRenderFindVisualFormat)
MAKE_FUNCPTR(XRenderFreeGlyphSet) MAKE_FUNCPTR(XRenderFreeGlyphSet)
MAKE_FUNCPTR(XRenderFreePicture) MAKE_FUNCPTR(XRenderFreePicture)
MAKE_FUNCPTR(XRenderSetPictureClipRectangles) MAKE_FUNCPTR(XRenderSetPictureClipRectangles)
#ifdef HAVE_XRENDERSETPICTURETRANSFORM
MAKE_FUNCPTR(XRenderSetPictureTransform)
#endif
MAKE_FUNCPTR(XRenderQueryExtension) MAKE_FUNCPTR(XRenderQueryExtension)
#undef MAKE_FUNCPTR #undef MAKE_FUNCPTR
@ -177,6 +180,12 @@ LOAD_FUNCPTR(XRenderFreePicture)
LOAD_FUNCPTR(XRenderSetPictureClipRectangles) LOAD_FUNCPTR(XRenderSetPictureClipRectangles)
LOAD_FUNCPTR(XRenderQueryExtension) LOAD_FUNCPTR(XRenderQueryExtension)
#undef LOAD_FUNCPTR #undef LOAD_FUNCPTR
#ifdef HAVE_XRENDERSETPICTURETRANSFORM
#define LOAD_OPTIONAL_FUNCPTR(f) p##f = wine_dlsym(xrender_handle, #f, NULL, 0);
LOAD_OPTIONAL_FUNCPTR(XRenderSetPictureTransform)
#undef LOAD_OPTIONAL_FUNCPTR
#endif
wine_tsx11_lock(); wine_tsx11_lock();
if(pXRenderQueryExtension(gdi_display, &event_base, &error_base)) { if(pXRenderQueryExtension(gdi_display, &event_base, &error_base)) {
@ -1561,9 +1570,13 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst,
widthSrc = pts[1].x - pts[0].x; widthSrc = pts[1].x - pts[0].x;
heightSrc = pts[1].y - pts[0].y; heightSrc = pts[1].y - pts[0].y;
#ifndef HAVE_XRENDERSETPICTURETRANSFORM
if(widthDst != widthSrc || heightDst != heightSrc) { if(widthDst != widthSrc || heightDst != heightSrc)
FIXME("Unable to Stretch\n"); #else
if(!pXRenderSetPictureTransform)
#endif
{
FIXME("Unable to Stretch, XRenderSetPictureTransform is currently required\n");
return FALSE; return FALSE;
} }
@ -1624,6 +1637,18 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst,
CPSubwindowMode, &pa); CPSubwindowMode, &pa);
TRACE("src_pict %08lx\n", src_pict); TRACE("src_pict %08lx\n", src_pict);
#ifdef HAVE_XRENDERSETPICTURETRANSFORM
if(widthDst != widthSrc || heightDst != heightSrc) {
double xscale = widthSrc/(double)widthDst;
double yscale = heightSrc/(double)heightDst;
XTransform xform = {{
{ XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(0) },
{ XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0) },
{ XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1) }
}};
pXRenderSetPictureTransform(gdi_display, src_pict, &xform);
}
#endif
pXRenderComposite(gdi_display, PictOpOver, src_pict, 0, dst_pict, pXRenderComposite(gdi_display, PictOpOver, src_pict, 0, dst_pict,
xSrc, ySrc, 0, 0, xSrc, ySrc, 0, 0,
xDst + devDst->org.x, yDst + devDst->org.y, widthSrc, heightSrc); xDst + devDst->org.x, yDst + devDst->org.y, widthSrc, heightSrc);

View File

@ -830,6 +830,9 @@
/* Define if you have the XKB extension */ /* Define if you have the XKB extension */
#undef HAVE_XKB #undef HAVE_XKB
/* Define if Xrender has the XRenderSetPictureTransform function */
#undef HAVE_XRENDERSETPICTURETRANSFORM
/* Define if the X libraries support XVideo */ /* Define if the X libraries support XVideo */
#undef HAVE_XVIDEO #undef HAVE_XVIDEO