From http://www.jwz.org/xscreensaver/xscreensaver-5.36.tar.gz
[xscreensaver] / jwxyz / jwxyz-gl.c
index 66944ed25a61aa870c1661d80c09ed395f8b67f2..2f15b1aa0199e050c6bce59b17d177561cc3ed5d 100644 (file)
 # include <CoreGraphics/CGGeometry.h>
 #else
 
-
-#ifdef HAVE_ANDROID
- extern void Log(const char *fmt, ...);
-#else
-static void
-Log (const char *fmt, ...)
-{
-  va_list args;
-  va_start (args, fmt);
-  vfprintf (stderr, fmt, args);
-  va_end (args);
-}
-#endif
-
 struct CGPoint {
     float x;
     float y;
@@ -1778,13 +1764,16 @@ XPutImage (Display *dpy, Drawable d, GC gc, XImage *ximage,
     glVertexPointer (2, GL_FLOAT, 0, vertices);
     glTexCoordPointer (2, GL_FLOAT, 0, tex_coords);
 
-    // Respect the alpha channel in the XImage
-    glEnable (GL_BLEND);
-    glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    // Respect the alpha channel in the XImage if we're using alpha.
+    if (gc->gcv.alpha_allowed_p) {
+      glEnable (GL_BLEND);
+      glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    }
 
     glDrawArrays (GL_TRIANGLE_FAN, 0, 4);
 
-    glDisable (GL_BLEND);
+    if (gc->gcv.alpha_allowed_p)
+      glDisable (GL_BLEND);
 
 //  clear_texture();
     glDisable (dpy->gl_texture_target);
@@ -2798,35 +2787,6 @@ XFreeStringList (char **list)
 }
 
 
-// Returns the verbose Unicode name of this character, like "agrave" or
-// "daggerdouble".  Used by fontglide debugMetrics.
-//
-char *
-jwxyz_unicode_character_name (Font fid, unsigned long uc)
-{
-  /* TODO Fonts
-  char *ret = 0;
-  CTFontRef ctfont =
-    CTFontCreateWithName ((CFStringRef) [fid->nsfont fontName],
-                          [fid->nsfont pointSize],
-                          NULL);
-  Assert (ctfont, @"no CTFontRef for UIFont");
-
-  CGGlyph cgglyph;
-  if (CTFontGetGlyphsForCharacters (ctfont, (UniChar *) &uc, &cgglyph, 1)) {
-    NSString *name = (NSString *)
-      CGFontCopyGlyphNameForGlyph (CTFontCopyGraphicsFont (ctfont, 0),
-                                   cgglyph);
-    ret = (name ? strdup ([name UTF8String]) : 0);
-  }
-
-  CFRelease (ctfont);
-  return ret;
-   */
-  return NULL;
-}
-
-
 // Given a UTF8 string, return an NSString.  Bogus UTF8 characters are ignored.
 // We have to do this because stringWithCString returns NULL if there are
 // any invalid characters at all.