Skip to content

Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.

C

eagl: the opacity of the blur whose radius varies mixes the blur in, it does not darken -- the dark strip in Search

vcvkkeb9457b64932
diff --git a/userland/rc.jobs.strip b/userland/rc.jobs.strip
index db6fc72..8cdadfc 100644
--- a/userland/rc.jobs.strip
+++ b/userland/rc.jobs.strip
@@ -1,8 +1,9 @@
# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).
# The dark strip in Search, on demand (RC_JOBS=rc.jobs.strip, a run of about a minute and a half;
# the way the user found): Search pulled down, then the gesture from the bottom edge begun and let
-# go after half a centimetre, eight times. Each time the strip under the status bar darkens to a
-# quarter and comes back -- and now and then stays at about half (two of eight in run 093851). To
-# be watched with boot-args rec_secs=3600 rec_ring=1 rec_step=4 rec_mb=256 glframes=1.
+# go after half a centimetre, eight times. Each time the strip under the status bar used to darken
+# to a quarter and come back -- and now and then stay dark (two of eight in run 093851): the blur's
+# opacity, multiplied in where it is to be mixed (see vblur_fragment in src/eagl.c). To be watched
+# with boot-args rec_secs=3600 rec_ring=1 rec_step=4 rec_mb=256 glframes=1.
/redwood/bin/rwtouch wait 40 swipe 0.5 0.985 0.5 0.3 200 wait 8 swipe 0.5 0.4 0.5 0.7 300 wait 6 swipe 0.5 0.995 0.5 0.965 150 wait 4 swipe 0.5 0.995 0.5 0.965 150 wait 4 swipe 0.5 0.995 0.5 0.96 200 wait 4 swipe 0.5 0.995 0.5 0.97 120 wait 4
/redwood/bin/rwtouch swipe 0.5 0.995 0.5 0.965 150 wait 4 swipe 0.5 0.995 0.5 0.96 250 wait 4 swipe 0.5 0.995 0.5 0.965 150 wait 4 swipe 0.5 0.995 0.5 0.95 200 wait 8
diff --git a/userland/src/eagl.c b/userland/src/eagl.c
index 6f5dc09..8168e29 100644
--- a/userland/src/eagl.c
+++ b/userland/src/eagl.c
@@ -1410,6 +1410,13 @@ static const char halve_fragment[] =
* With the function's second number set (inputNormalizeEdges, it seems), what the blur drew in
* from outside the picture -- nothing, transparent -- is made up for by dividing by the opacity,
* as the edges of an ordinary blur are.
+ * The colour's opacity is the blurring layer's (Spotlight's strip fades so while the gesture that
+ * dismisses Search is under way), and CoreAnimation puts what this draws on the screen as it is,
+ * without blending: so the opacity is how much of the blur is shown over the picture itself, not a
+ * darkening. Multiplied in, the strip went dark with it -- to a quarter, in four frames, at each
+ * start of that gesture -- and stayed dark whenever the gesture ended between two of the window
+ * server's renderings of the strip: it reuses the last one until what is behind the strip changes
+ * (the dark strip in Search, rc.jobs.strip).
*/
static const char vblur_draw_vertex[] =
"#version 300 es\n"
@@ -1461,8 +1468,12 @@ static const char vblur_fragment[] =
" highp vec4 c = mix(level(k, at), level(min(k + 1, levels - 1), at), lod - float(k));\n"
" if (normalize_edges > 0.5) {\n"
" c = c.a > 0.004 ? vec4(c.rgb / c.a, 1.0) : vec4(0.0);\n"
+ " highp vec4 sharp = texture(level0, at);\n"
+ " sharp = sharp.a > 0.004 ? vec4(sharp.rgb / sharp.a, 1.0) : c;\n"
+ " result = vec4(mix(sharp.rgb, c.rgb, color.a), 1.0);\n"
+ " } else {\n"
+ " result = color * c;\n"
" }\n"
- " result = color * c;\n"
" if (paint != 0) {\n"
" highp float t = m;\n"
" result = vec4(t, 0.25 * c.g, 1.0 - t, 1.0);\n"