summaryrefslogtreecommitdiffstats
path: root/jwxyz
diff options
context:
space:
mode:
authorSimon Rettberg2019-07-30 16:03:58 +0200
committerSimon Rettberg2019-07-30 16:03:58 +0200
commit6a32252403781b303d4ebd195932ce39c5b1c08e (patch)
treecd2f8b3c4052c1b575caf33c9983ae531fad9092 /jwxyz
parentRemove android and OSX files (diff)
downloadxscreensaver-6a32252403781b303d4ebd195932ce39c5b1c08e.tar.gz
xscreensaver-6a32252403781b303d4ebd195932ce39c5b1c08e.tar.xz
xscreensaver-6a32252403781b303d4ebd195932ce39c5b1c08e.zip
Update to 5.43
Diffstat (limited to 'jwxyz')
-rw-r--r--jwxyz/jwxyz-cocoa.m24
-rw-r--r--jwxyz/jwxyz-common.c3
-rw-r--r--jwxyz/jwxyz-timers.c10
-rw-r--r--jwxyz/jwxyz.m4
-rw-r--r--jwxyz/jwzgles.c6
-rw-r--r--jwxyz/jwzglesI.h4
6 files changed, 35 insertions, 16 deletions
diff --git a/jwxyz/jwxyz-cocoa.m b/jwxyz/jwxyz-cocoa.m
index 96d54b8..13666e7 100644
--- a/jwxyz/jwxyz-cocoa.m
+++ b/jwxyz/jwxyz-cocoa.m
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1991-2018 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1991-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -94,8 +94,8 @@ jwxyz_drawable_depth (Drawable d)
}
-float
-jwxyz_scale (Window main_window)
+static float
+jwxyz_scale_1 (Window main_window, BOOL fonts_p)
{
float scale = 1;
@@ -108,20 +108,32 @@ jwxyz_scale (Window main_window)
or so, even if the display has significantly higher resolution. That is
unrelated to this hack, which is really about DPI.
*/
- scale = main_window->window.view.hackedContentScaleFactor;
+ scale = [main_window->window.view hackedContentScaleFactor:fonts_p];
if (scale < 1) // iPad Pro magnifies the backbuffer by 3x, which makes text
scale = 1; // excessively blurry in BSOD.
# else // !USE_IPHONE
/* Desktop retina displays also need fonts doubled. */
- scale = main_window->window.view.hackedContentScaleFactor;
+ scale = [main_window->window.view hackedContentScaleFactor:fonts_p];
# endif // !USE_IPHONE
return scale;
}
+float
+jwxyz_scale (Window main_window)
+{
+ return jwxyz_scale_1 (main_window, FALSE);
+}
+
+static float
+jwxyz_font_scale (Window main_window)
+{
+ return jwxyz_scale_1 (main_window, TRUE);
+}
+
/* Font metric terminology, as used by X11:
@@ -421,7 +433,7 @@ jwxyz_load_native_font (Window main_window, int traits_jwxyz, int mask_jwxyz,
encoding:NSUTF8StringEncoding] :
nil;
- size *= jwxyz_scale (main_window);
+ size *= jwxyz_font_scale (main_window);
if (font_name_type == JWXYZ_FONT_RANDOM) {
diff --git a/jwxyz/jwxyz-common.c b/jwxyz/jwxyz-common.c
index 1a31ae3..febb3b5 100644
--- a/jwxyz/jwxyz-common.c
+++ b/jwxyz/jwxyz-common.c
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1991-2018 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1991-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -103,6 +103,7 @@ XDisplayHeightMM (Display *dpy, int screen)
unsigned long
XBlackPixelOfScreen(Screen *screen)
{
+ if (! screen) abort();
return DefaultVisualOfScreen (screen)->alpha_mask;
}
diff --git a/jwxyz/jwxyz-timers.c b/jwxyz/jwxyz-timers.c
index 67326b0..1e81ab8 100644
--- a/jwxyz/jwxyz-timers.c
+++ b/jwxyz/jwxyz-timers.c
@@ -200,7 +200,8 @@ XtAppAddInput (XtAppContext app, int fd, XtPointer flags,
data->app = app;
data->refcount++;
- LOGI("source 0x%08lX %2d: alloc", (unsigned long) data, data->fd);
+ LOGI("source 0x%08lX %2d: alloc 0x%08lX", (unsigned long) data, data->fd,
+ (unsigned long) closure);
ASSERT_RET0 (fd > 0 && fd < FD_SETSIZE, "fd out of range");
ASSERT_RET0 (td->ids[fd] == 0, "sources corrupted");
@@ -216,7 +217,8 @@ XtRemoveInput (XtInputId id)
{
jwxyz_sources_data *td = DISPLAY_SOURCES_DATA (id->app);
- LOGI("source 0x%08lX %2d: remove", (unsigned long) id, id->fd);
+ LOGI("source 0x%08lX %2d: remove 0x%08lX", (unsigned long) id, id->fd,
+ (unsigned long) id->closure);
ASSERT_RET (id->refcount > 0, "sources corrupted");
ASSERT_RET (td->fd_count > 0, "sources corrupted");
ASSERT_RET (id->fd > 0 && id->fd < FD_SETSIZE, "fd out of range");
@@ -226,8 +228,8 @@ XtRemoveInput (XtInputId id)
td->fd_count--;
id->refcount--;
- LOGI("source 0x%08lX %2d: release %d", (unsigned long) id, id->fd,
- id->refcount);
+ LOGI("source 0x%08lX %2d: release %d 0x%08lX", (unsigned long) id, id->fd,
+ id->refcount, (unsigned long) id->closure);
ASSERT_RET (id->refcount >= 0, "double free");
if (id->refcount == 0) {
memset (id, 0xA1, sizeof(*id));
diff --git a/jwxyz/jwxyz.m b/jwxyz/jwxyz.m
index 4256f6d..c6a7af5 100644
--- a/jwxyz/jwxyz.m
+++ b/jwxyz/jwxyz.m
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1991-2018 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1991-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -1284,7 +1284,7 @@ GetSubImage (Display *dpy, Drawable d, int x, int y,
// data points at (x,y) with ibpl rowstride. ignore x,y from now on.
data += (y * ibpl) + (x * (ibpp/8));
- format = (depth == 1 ? XYPixmap : ZPixmap);
+ // format = (depth == 1 ? XYPixmap : ZPixmap);
int obpl = image->bytes_per_line;
diff --git a/jwxyz/jwzgles.c b/jwxyz/jwzgles.c
index e0437e0..b26bc3a 100644
--- a/jwxyz/jwzgles.c
+++ b/jwxyz/jwzgles.c
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 2012-2018 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 2012-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -352,7 +352,8 @@ static jwzgles_state *state = 0;
#ifdef DEBUG
-static void Log(const char *fmt, ...)
+void
+Log(const char *fmt, ...)
{
va_list args;
va_start (args, fmt);
@@ -4287,6 +4288,7 @@ void jwzgles_##NAME (ARGS_##SIG) \
WRAP (glActiveTexture, I)
WRAP (glAlphaFunc, IF)
WRAP (glBlendFunc, II)
+//WRAP (glBlendColor, FFFF);
WRAP (glClear, I)
WRAP (glClearColor, FFFF)
WRAP (glClearStencil, I)
diff --git a/jwxyz/jwzglesI.h b/jwxyz/jwzglesI.h
index 8f09208..b90bad4 100644
--- a/jwxyz/jwzglesI.h
+++ b/jwxyz/jwzglesI.h
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 2012-2018 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 2012-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -118,6 +118,7 @@
# define GL_VIEWPORT_BIT 0x00000800
# define GL_INT 0x1404
# define GL_DOUBLE 0x140A
+# define GL_CONSTANT_ALPHA 0x8003
#endif
@@ -173,6 +174,7 @@ extern void jwzgles_glPopAttrib(void);
extern void jwzgles_glActiveTexture (GLuint);
extern void jwzgles_glBindTexture (GLuint, GLuint);
extern void jwzgles_glBlendFunc (GLuint, GLuint);
+extern void jwzgles_glBlendColor (GLfloat, GLfloat, GLfloat, GLfloat);
extern void jwzgles_glClear (GLuint);
extern void jwzgles_glClearColor (GLclampf, GLclampf, GLclampf, GLclampf);
extern void jwzgles_glClearStencil (GLuint);