Check for RENDER before trying to use it... XRenderFindFormat() prints

Wed Jan  9 10:20:16 2002  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkdrawable-x11.c gdk/x11/gdkgc-c11.c: Check for
	RENDER before trying to use it... XRenderFindFormat() prints
	warnings if called when extension isn't present.
This commit is contained in:
Owen Taylor
2002-01-09 15:23:30 +00:00
committed by Owen Taylor
parent 9b2a1356f0
commit 63e511bcf4
9 changed files with 56 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* GDK - The GIMP Drawing Kit
/* GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
@ -238,6 +238,9 @@ gdk_x11_drawable_get_picture (GdkDrawable *drawable)
{
GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable);
if (!_gdk_x11_have_render ())
return None;
if (impl->picture == None)
{
GdkVisual *visual = gdk_drawable_get_visual (drawable);
@ -802,12 +805,14 @@ select_format (Display *xdisplay,
XRenderPictFormat **mask)
{
XRenderPictFormat pf;
/* Look for a 32-bit xRGB and Axxx formats that exactly match the
* in memory data format. We can use them as pixmap and mask
* to deal with non-premultiplied data.
*/
if (!_gdk_x11_have_render ())
return FORMAT_NONE;
/* Look for a 32-bit xRGB and Axxx formats that exactly match the
* in memory data format. We can use them as pixmap and mask
* to deal with non-premultiplied data.
*/
pf.type = PictTypeDirect;
pf.depth = 32;