Skip to content

LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.

Frame cost, steps 0-3: golden drag hashes (test_drag_exact, LORD_PAINT_VERIFY), no canvas_clear before the copy of what is below, partial repaint of the dragged window's layer when exact (not across 0, not after outside damage mapped through layer.at), lord.stats memory in O(1) (JS_GetMallocSize)

Federico Pereiraee2c546d3929
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 61cbc46..f16d830 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -188,6 +188,53 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),
firewall and restrictions see it as itself, `flatpak run` arguments built in C, per-user installs through a closed
set of commands in their own network scope with Flathub's key pinned, and the exceptions to `AGENTS.md` the
maintainer has to approve before any code.
+- **A pixel-exact check for the dragged window's frames** (in development for 0.8.6, the groundwork for making a drag
+ frame cheaper on the Raspberry Pi; `docs/WINDOWS.md`, "Checking it"). Tests and debugging only: no frame changes.
+ - **`test_drag_exact`** in `build/engine-test` (`make -C server test`): LordBench's desktop scene (a 760×480 rounded
+ window with a shadow, a turning 72 px square and six cards with shadows and text, a rounded window below, a menu
+ bar and a Dock with backdrop blur, on a 1024×640 display) dragged along LordBench's figure of eight
+ (`lbi_path`) for 480 frames, painted as `main.c` paints a frame, plus four 60-frame runs for what makes the layer
+ paint again (a text that changes a child's size, a child moving inside the window, a terminal's blinking cursor,
+ a square turning across the window's edge). Each of the 725 frames is hashed (FNV-1a over the pixels) on the
+ CPU path and on the GPU path's canvas (`gpu_active()` on), and compared with `tests/drag_golden_cpu.txt` and
+ `tests/drag_golden_gpu.txt`, written from the current code (x86_64; `make drag-golden` writes another
+ architecture's): any change to a frame fails. The test also prints how many pixels differ from a full repaint:
+ today at most 2,265 per frame on the CPU path, with black pixels at the dragged window's rounded top corners, and
+ 70,940 on the GPU path, one level darker in the window's shadow. About 11 s on VM 116.
+ - **`LORD_PAINT_VERIFY=N`** (lord-server's environment): every N-th frame of each display is compared with a full
+ repaint of the tree into a scratch canvas (`paint_root_full`: no drag layer, no copy of what is below it, no
+ skipped node; the GPU path's list of app windows is kept), and the count of differing pixels goes to stderr.
+ Off by default.
+ - The drag line in `session.log` now says how many of the layer's renders were only a part of it
+ (`paint_layer_parts`). `lord.setStyle`'s decision of what to place or repaint moved to `node_restyled`
+ (`ui/node.c`), unchanged, so the test drives the same C path.
+
+### Changed
+
+- **Less work in a dragged window's frame, same pixels** (in development for 0.8.6; the first two steps of making a
+ drag frame cheaper on the Raspberry Pi). Every frame of `test_drag_exact` keeps its golden hash on the CPU and GPU
+ paths (VM 116, x86_64); the time saved has not been measured yet.
+ - **No clear under the copy of what is below the window:** `paint_root_clear` (`ui/paint.c`) replaces
+ `canvas_clear` + `paint_root` in `main.c`, `app/appclient.c` and `engine-test`, and skips the clear when the drag
+ layer's copy of what is below (`below_copy`) is about to write every pixel of the same rectangle. That copy was
+ itself cleared to the same black before it was painted, so the GPU path's app-window holes stay the same.
+ - **`lord.stats()` no longer walks every JavaScript object:** `jsKB` comes from `JS_GetMallocSize`, a local
+ QuickJS addition (`THIRD_PARTY.md`) that returns the same `malloc_size` `JS_ComputeMemoryUsage` reported (checked
+ equal on a runtime with 100,000 objects, a 50,000-entry Map and after GC). About, Settings → General and System
+ Information poll it while they are open.
+ - **Only the changed part of the dragged window's layer is painted again:** a node inside the window that changes
+ (a style, a text, a transform such as LordBench's turning square, a child moving inside) now repaints only its old
+ and new boxes in the layer, with a 4 px margin (`layer_tree_part` in `ui/paint.c`), instead of the whole window
+ and its shadow. The layer is still painted whole for the window's own style or size, a part outside the layer or
+ bigger than half of it, and whenever the result can't be shown to be the same: the window moved by a fraction of
+ a physical pixel, the layer's box would change, a fractional display scale, positions or sizes that aren't
+ sixteenths of a pixel within ±4096 px, fractional font sizes, text drawn through `textlayout.c` or in a font
+ whose em isn't a power of two of at most 2048 units, as Inter's is (`text_drew_inexact`), an unchanged transformed node, an app window or a video inside
+ (`layer_part_exact`, `layer_note_exact`). A transformed node's image steps its bilinear weights from the first
+ pixel of each row, so a part cutting it on the left would change them; `canvas_affine_watch`/`canvas_affine_cut`
+ (`canvas.c`) report that and the layer is painted whole. In `test_drag_exact` 606 of the 611 layer renders are now
+ parts (before: 6, the terminal's); the other 5 are each run's first. Every golden hash is unchanged on both paths.
+ With neither the margin nor the watch, 160 frames per path fail; with the watch but no margin, they all pass.
### Fixed
diff --git a/THIRD_PARTY.md b/THIRD_PARTY.md
index 592ad28..059b7cb 100644
--- a/THIRD_PARTY.md
+++ b/THIRD_PARTY.md
@@ -24,6 +24,13 @@ the components below, each under its own license.
| JetBrains Mono (`assets/fonts/JetBrainsMono-*.ttf`) | terminal and code text | SIL OFL 1.1 (`assets/fonts/JetBrainsMono-LICENSE.txt`) |
| Noto Sans Arabic, Devanagari, Thai and CJK SC, subset (`server/src/bench/fonts/`) | built into `lord-bench` for LordBench's shaping workload (subset by `tools/gen-lbfonts.py`) | SIL OFL 1.1 (`server/src/bench/fonts/OFL.txt`) |
+### Local changes to bundled components
+
+- **QuickJS** (`third_party/quickjs`, version in `VERSION`): adds `size_t JS_GetMallocSize(JSRuntime *rt)`
+ (`quickjs.c`, next to `JS_ComputeMemoryUsage`, and its prototype in `quickjs.h`). It returns the
+ same `malloc_size` that `JS_ComputeMemoryUsage` reports, without walking every object, so
+ `lord.stats()` (`server/src/ui/js.c`) costs O(1). Re-apply it when QuickJS is updated.
+
## npm packages (bundled into the theme JavaScript at build time)
| Package | License |
diff --git a/docs/WINDOWS.md b/docs/WINDOWS.md
index 24789cc..badc180 100644
--- a/docs/WINDOWS.md
+++ b/docs/WINDOWS.md
@@ -70,7 +70,27 @@ wm.beginResize(id, edges) // edges as in xdg_toplevel.resize: 1 top, 2 botto
- It is painted in its screen coordinates (a canvas with a shifted origin). That way the terminal
and Linux apps keep recording where they are.
- **If something inside changes,** like a terminal line or the blinking cursor, only that part of
- the layer is repainted. If a style inside changes, the whole layer is repainted.
+ the layer is repainted.
+- **If a node inside changes** (a style, a text, a transform such as LordBench's turning square, or a
+ child moving inside the window), only its old box (moved with the window) and its new one are
+ repainted in the layer, with a 4 px margin (`layer_tree_part`; 0.8.6, in development). The window's
+ own style or size, a part outside the layer or bigger than half of it still repaint the whole layer.
+ That gives the same pixels as repainting it whole, and the layer is repainted whole whenever that
+ can't be shown (`layer_part_exact`, `layer_note_exact`):
+ - the window moved by whole physical pixels since the layer was painted whole, the layer's box and
+ offsets are the ones a full render would give, the display scale is whole, and positions, sizes,
+ paddings and borders are in sixteenths of a pixel within ±4096 px, so every coordinate the paint
+ derives from them is exact at both places;
+ - text uses whole font sizes and was drawn by `text.c`'s own path in a font whose em is a power of
+ two of at most 2048 units, as Inter's is (`text_drew_inexact`): glyph advances and kerning are then
+ exact too. Text through `textlayout.c` (shaping, other scripts' fonts) or in another font (Plus
+ Jakarta Sans and JetBrains Mono have 1000-unit ems) repaints the layer whole;
+ - a transformed node that didn't change, an app window or a video inside makes it repaint whole (a
+ transform composites through its matrix, which rounds differently at another place; painting an
+ app window registers it);
+ - a transformed node's image steps its bilinear weights along each row from its first pixel, so a
+ part whose left edge cuts that image would change them: `canvas_affine_watch` reports it and the
+ layer is painted whole instead (the margin keeps that from happening in LordBench's scene).
- **What's below** (everything painted before the window: background, desktop, the other windows)
is also saved once. Per frame:
1. the region that changed is copied;
@@ -92,6 +112,23 @@ wm.beginResize(id, edges) // edges as in xdg_toplevel.resize: 1 top, 2 botto
- **A `canvas_blit` detail:** opaque pixels are copied directly (same result as blending, without
the math).
+### Checking it (0.8.6, in development)
+
+- **`test_drag_exact`** (`server/tests/engine_test.c`, run by `make -C server test`) drags LordBench's
+ desktop scene along its figure of eight for 480 frames, plus four short runs (a text that resizes a
+ child, a child moving inside the window, a terminal's blinking cursor, a square turning across the
+ window's edge), on the CPU path and on the GPU path's canvas. Every frame's hash must match
+ `server/tests/drag_golden_cpu.txt` and `drag_golden_gpu.txt`, written from the code before any change
+ to this path: a faster frame has to give exactly the same pixels. The hashes are per architecture
+ (x86_64 so far); `make -C server drag-golden` writes them, only on the reference code.
+- **Against a full repaint** the test prints a second number, which may only go down: today a drag
+ frame differs from a full repaint in at most 2,265 pixels on the CPU path (black pixels at the dragged
+ window's rounded top corners) and 70,940 on the GPU path (one level darker in its shadow).
+- **`LORD_PAINT_VERIFY=N`** in lord-server's environment repaints the whole tree every N-th frame of a
+ display into a scratch canvas, without the layer, and writes to stderr how many pixels differ from
+ the frame. Use N > 1 to check the partial repaints of the layer: the check repaint also notes where
+ the terminals are, so on the next frame a terminal's change repaints the whole layer.
+
### Resize edges (`sdk/windowshell.jsx`)
`<WindowShell>` is the window's node: the frame goes inside and around it there are 8 invisible
diff --git a/server/Makefile b/server/Makefile
index 1313e7c..528e21c 100644
--- a/server/Makefile
+++ b/server/Makefile
@@ -129,7 +129,7 @@ build/imager-test: tests/imager_test.c src/imager/imgverify.c src/imager/imgveri
OBJ := $(SRC:src/%.c=build/obj/%.o)
HDR += $(wildcard src/tp/*.h)
-.PHONY: all clean test test-full
+.PHONY: all clean test test-full drag-golden
# lord-sessiond: sessions, login screen and remote desktop (docs/SESSIONS.md). It's the
# only one that links OpenSSL (TLS), and with it libsrtp2 and usrsctp (the remote desktop's WebRTC);
# without libssl-dev, only lord-server is built.
@@ -390,15 +390,21 @@ build/nethist-test: tests/nethist_test.c src/monitor/nethist.c src/monitor/nethi
./$@ || { rm -f $@; exit 1; }
# canvas.c rows: SIMD (NEON on aarch64) against C, bit for bit, and how long each one takes
# UI engine (docs/DESIGN.md "Engine notes"): ellipsis in LTR/RTL/Arabic/Thai/emoji, per-side borders,
-# per-corner radii, logical edges, transforms and hit testing; `build/engine-test bench` times a 2000-row
+# per-corner radii, logical edges, transforms and hit testing, and the dragged window's frames against
+# the golden hashes in tests/drag_golden_{cpu,gpu}.txt; `build/engine-test bench` times a 2000-row
# list and a window drag on one and two displays
ENGINE_SRC := src/ui/node.c src/ui/style.c src/ui/layout.c src/ui/transform.c src/ui/text.c src/ui/textlayout.c src/ui/image.c \
src/ui/paint.c src/ui/otf.c src/ui/fonts.c src/ui/unicode.c src/ui/bidi.c src/ui/shape.c src/ui/shape_indic.c \
src/ui/shape_syl.c src/ui/shape_khmer.c src/ui/shape_myanmar.c src/ui/shape_use.c src/ui/thbrk.c src/canvas.c
test: build/engine-test
-build/engine-test: tests/engine_test.c $(ENGINE_SRC) build/obj/ui/stb.o $(HDR)
- $(CC) $(CPPFLAGS) $(CFLAGS) $(WARN) -std=c11 -o $@ tests/engine_test.c $(ENGINE_SRC) build/obj/ui/stb.o -lm
+build/engine-test: tests/engine_test.c $(ENGINE_SRC) src/outputs.c src/bench/lbinput.c build/obj/ui/stb.o $(HDR) tests/drag_golden_cpu.txt tests/drag_golden_gpu.txt
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(WARN) -std=c11 -o $@ tests/engine_test.c $(ENGINE_SRC) src/outputs.c src/bench/lbinput.c build/obj/ui/stb.o -lm -lpthread
./$@ || { rm -f $@; exit 1; }
+# test_drag_exact's golden hashes for this architecture: only on the reference code, never to make a
+# changed frame pass (tests/engine_test.c, "The dragged window, pixel for pixel")
+drag-golden: tests/engine_test.c $(ENGINE_SRC) src/outputs.c src/bench/lbinput.c build/obj/ui/stb.o $(HDR)
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(WARN) -std=c11 -o build/engine-golden tests/engine_test.c $(ENGINE_SRC) src/outputs.c src/bench/lbinput.c build/obj/ui/stb.o -lm -lpthread
+ ./build/engine-golden drag-golden
build/canvas-test: tests/canvas_test.c src/canvas.c src/canvas.h
@mkdir -p build
$(CC) $(CPPFLAGS) $(CFLAGS) $(WARN) -std=c11 -DLORD_CANVAS_TEST -o $@ tests/canvas_test.c src/canvas.c -lm
diff --git a/server/src/app/appclient.c b/server/src/app/appclient.c
index da8030a..c630a9d 100644
--- a/server/src/app/appclient.c
+++ b/server/src/app/appclient.c
@@ -140,11 +140,10 @@ static void render(AppWin *w) {
ui.width = (float)w->cw;
ui.height = (float)w->ch;
layout_root(root, (float)w->cw, (float)w->ch);
- canvas_clear(&c, 0x00000000);
/* every window shares node coordinates starting at 0,0: no "paint from the video" shortcut
* (an empty damage box turns off media_cover_node/opaque_cover_node in paint_root) */
ui.damage = (Box){ 0, 0, 0, 0 };
- paint_root(&c, root);
+ paint_root_clear(&c, root, 0x00000000);
b->busy = 1;
wl_surface_attach(w->surf, b->b, 0, 0);
wl_surface_damage_buffer(w->surf, 0, 0, w->cw, w->ch);
diff --git a/server/src/canvas.c b/server/src/canvas.c
index 514cb6b..1063be8 100644
--- a/server/src/canvas.c
+++ b/server/src/canvas.c
@@ -1029,6 +1029,16 @@ static inline uint32_t texel(const uint32_t *src, int sw, int sh, int x, int y)
return x < 0 || y < 0 || x >= sw || y >= sh ? 0 : src[(size_t)y * sw + x];
}
+/* A row of canvas_blit_affine steps its source coordinates from the first pixel it paints, so where
+ * the clip cuts the image on the left changes the bilinear weights by a rounding. A partial repaint
+ * (paint.c's drag layer) watches its canvas: if an image there starts left of the repaint's own left
+ * edge x, the row began at x, where a wider clip would not have begun it, and the caller paints it
+ * all instead. */
+static const Canvas *affine_watch;
+static int affine_watch_x, affine_cut;
+void canvas_affine_watch(const Canvas *c, int x) { affine_watch = c; affine_watch_x = x; affine_cut = 0; }
+int canvas_affine_cut(void) { affine_watch = NULL; return affine_cut; }
+
void canvas_blit_affine(Canvas *c, const uint32_t *src, int sw, int sh, const float inv[6], const float fwd[6], float opacity) {
if (sw <= 0 || sh <= 0) return;
/* destination bounds: the four transformed corners */
@@ -1042,6 +1052,7 @@ void canvas_blit_affine(Canvas *c, const uint32_t *src, int sw, int sh, const fl
if (!bounds(c, bx0 - 1, by0 - 1, bx1 - bx0 + 2, by1 - by0 + 2, &x0, &y0, &x1, &y1)) return;
uint32_t k_op = (uint32_t)(opacity * 256 + 0.5f);
if (!k_op) return;
+ if (c == affine_watch && x0 == affine_watch_x && (int)floorf(bx0 - 1) < x0) affine_cut = 1;
for (int j = y0; j < y1; j++) {
uint32_t *row = c->px + (size_t)j * c->stride;
float dy = j + 0.5f;
diff --git a/server/src/canvas.h b/server/src/canvas.h
index 8bd2bc1..bf01e75 100644
--- a/server/src/canvas.h
+++ b/server/src/canvas.h
@@ -54,6 +54,9 @@ void canvas_corners_restore4(Canvas *c, Corners *k, float x, float y, float w, f
/* Affine copy: destination pixel p takes the source at inv(p) (bilinear, transparent outside), a
* premultiplied w × h image; inv maps canvas pixels to source pixels. */
void canvas_blit_affine(Canvas *c, const uint32_t *src, int sw, int sh, const float inv[6], const float fwd[6], float opacity);
+/* partial repaints: watch canvas c for an affine image cut by its left edge x (canvas.c) */
+void canvas_affine_watch(const Canvas *c, int x);
+int canvas_affine_cut(void); /* 1 if one was cut since canvas_affine_watch; stops watching */
/* 8-bit coverage mask (glyphs). */
void canvas_alpha_mask(Canvas *c, int x, int y, const uint8_t *a, int w, int h, int stride, uint32_t argb);
diff --git a/server/src/main.c b/server/src/main.c
index 2e1afcc..25d16bf 100644
--- a/server/src/main.c
+++ b/server/src/main.c
@@ -382,14 +382,14 @@ static void dispatch_pointer(Server *s) {
if (!dstat.held) {
if (dstat.active && dstat.frames > 1 && dstat.last > dstat.t0) {
double span = dstat.last - dstat.t0;
- long lr = 0, lb = 0;
+ long lr = 0, lb = 0, lp = paint_layer_parts();
paint_layer_stats(&lr, &lb);
fprintf(stderr, "drag: %ld frames in %.0f ms = %.1f FPS (%ld moves); per frame: work %.2f ms "
"(max %.2f; JS %.2f, layout %.2f, paint %.2f, present %.2f), max gap %.1f ms; "
- "layer: %ld painted, %ld copied (%s)\n",
+ "layer: %ld painted (%ld of them a part), %ld copied (%s)\n",
dstat.frames, span, 1000.0 * dstat.frames / span, dstat.moves, dstat.work / dstat.frames, dstat.work_max,
dstat.js / dstat.frames, dstat.layout / dstat.frames, (dstat.paint - dstat.layout) / dstat.frames,
- dstat.present / dstat.frames, dstat.gap_max, lr, lb, gpu_active() ? "GPU" : "CPU");
+ dstat.present / dstat.frames, dstat.gap_max, lr, lp, lb, gpu_active() ? "GPU" : "CPU");
}
dstat = (DragStats){ 0 };
}
@@ -1013,6 +1013,55 @@ static Box paint_ui(Server *s) {
return d;
}
+/* LORD_PAINT_VERIFY=N (checking the partial repaints, docs/LAYERS.md): every N-th frame painted on a
+ * display, the whole tree is painted again into a scratch canvas with nothing kept from earlier frames
+ * (paint_root_full: no drag layer, no copy of what is below it, no skipped node) and the pixels that
+ * differ from the display's frame are counted on stderr. Off by default; it only reads the frame. The
+ * terminals and Linux apps note where they were painted, so with N = 1 a terminal's change during a
+ * drag always repaints the whole layer: use N > 1 to check the layer's partial repaints. */
+static void paint_verify(Out *o, int index) {
+ static int every = -1;
+ static long frames[OUT_MAX];
+ static uint32_t *px;
+ static size_t cap;
+ if (every < 0) {
+ const char *e = getenv("LORD_PAINT_VERIFY");
+ every = e ? atoi(e) : 0;
+ if (every < 0) every = 0;
+ }
+ if (!every || index < 0 || index >= OUT_MAX || ++frames[index] % every) return;
+ size_t n = (size_t)o->scene.w * o->scene.h;
+ if (n > cap) {
+ free(px);
+ px = malloc(n * 4);
+ cap = px ? n : 0;
+ if (!px) return;
+ }
+ Canvas c;
+ canvas_init(&c, px, o->scene.w, o->scene.h, o->scene.w);
+ canvas_clear(&c, 0x000000);
+ view_of(o, index);
+ wl_paint_save();
+ paint_root_full(&c, ui.root);
+ wl_paint_restore();
+ view_reset();
+ long diff = 0;
+ int worst = 0;
+ for (int y = 0; y < o->scene.h; y++) {
+ const uint32_t *a = o->scene.px + (size_t)y * o->scene.stride, *b = px + (size_t)y * o->scene.w;
+ for (int x = 0; x < o->scene.w; x++) {
+ if (a[x] == b[x]) continue;
+ diff++;
+ for (int sh = 0; sh < 32; sh += 8) {
+ int d = abs((int)((a[x] >> sh) & 255) - (int)((b[x] >> sh) & 255));
+ if (d > worst) worst = d;
+ }
+ }
+ }
+ fprintf(stderr, "paint-verify: display %d frame %ld: %ld pixels differ from a full repaint (worst %d)%s\n",
+ index, frames[index], diff, worst, paint_layer_node() ? ", drag layer" : "");
+}
+
/* Paints a display's pending damage into its frame at its scale. Returns the physical rect painted. */
static Rect paint_out(Server *s, Out *o, int index, int feed) {
Rect r = { 0, 0, 0, 0 };
@@ -1055,8 +1104,7 @@ static Rect paint_out(Server *s, Out *o, int index, int feed) {
out_logical_box(&o->v, pr, &lx0, &ly0, &lx1, &ly1);
ui.damage = (Box){ lx0, ly0, lx1, ly1 }; /* paint_root skips what this region does not need */
canvas_set_clip(&o->scene, pr);
- canvas_clear(&o->scene, 0x000000);
- paint_root(&o->scene, ui.root);
+ paint_root_clear(&o->scene, ui.root, 0x000000);
if (feed) media_scene_painted(&o->scene); /* recording/remote desktop with protected windows */
r = rect_join(r, pr);
o->painted[o->npainted++] = (Box){ (float)pr.x0, (float)pr.y0, (float)pr.x1, (float)pr.y1 };
@@ -1073,6 +1121,7 @@ static Rect paint_out(Server *s, Out *o, int index, int feed) {
if (s->debug || paint_profile)
fprintf(stderr, "render %ld: display %d, layout %.2f ms, paint %.2f ms, repainted %.1f%% in %d rect%s\n", s->renders, index, ui.layout_ms, ms,
100.0 * px / ((double)o->scene.w * o->scene.h), nparts, nparts == 1 ? "" : "s");
+ paint_verify(o, index);
return r;
}
diff --git a/server/src/ui/grab.h b/server/src/ui/grab.h
index 63c3a67..899f7a2 100644
--- a/server/src/ui/grab.h
+++ b/server/src/ui/grab.h
@@ -49,5 +49,6 @@ void paint_layer_end(void);
void paint_layer_external_damage(void); /* something changed inside (terminal, Linux app, video) */
/* For drag measurements: times the layer was painted and times it was only copied (and resets to 0). */
void paint_layer_stats(long *renders, long *blits);
+long paint_layer_parts(void); /* of those renders, the ones of only a part (layer.part) */
#endif
diff --git a/server/src/ui/js.c b/server/src/ui/js.c
index a7c080c..143d5f4 100644
--- a/server/src/ui/js.c
+++ b/server/src/ui/js.c
@@ -177,18 +177,7 @@ static JSValue f_set_style(JSContext *c, JSValueConst this_val, int argc, JSValu
}
if (err) fprintf(stderr, "js: unsupported style '%s'\n", key);
JS_FreeCString(c, key);
- /* the same value (e.g. React confirms the position left by a drag in C): nothing to repaint */
- int ext_changed = n->s.ext && (!before.ext || memcmp(&ext_before, n->s.ext, STYLE_EXT_VALUES));
- if (memcmp(&before, &n->s, sizeof before) || ext_changed) {
- /* only the insets of an absolutely positioned node changed (a dot sliding along the Monitor's
- * map, the map image while panning): its size and content are the same, so it's only placed
- * again, like a window being dragged (no remeasuring of every ancestor, no repaint of its
- * content; the old and new boxes are damaged by the paint pass) */
- Style moved = before;
- memcpy(moved.pos, n->s.pos, sizeof moved.pos);
- if (!ext_changed && n->s.absolute && before.absolute && !memcmp(&moved, &n->s, sizeof moved)) node_moved(n);
- else node_invalidate(n);
- }
+ node_restyled(n, &before, before.ext ? &ext_before : NULL); /* node.c (engine-test does the same) */
return JS_UNDEFINED;
}
@@ -328,11 +317,9 @@ static JSValue f_stats(JSContext *c, JSValueConst this_val, int argc, JSValueCon
long pages = 0, rss = 0;
FILE *f = fopen("/proc/self/statm", "r");
if (f) { if (fscanf(f, "%ld %ld", &pages, &rss) != 2) rss = 0; fclose(f); }
- JSMemoryUsage mu;
- JS_ComputeMemoryUsage(rt, &mu);
JSValue o = JS_NewObject(c);
JS_SetPropertyStr(c, o, "rssKB", JS_NewInt64(c, rss * 4));
- JS_SetPropertyStr(c, o, "jsKB", JS_NewInt64(c, mu.malloc_size / 1024));
+ JS_SetPropertyStr(c, o, "jsKB", JS_NewInt64(c, (int64_t)(JS_GetMallocSize(rt) / 1024)));
JS_SetPropertyStr(c, o, "nodes", JS_NewInt32(c, node_count()));
JS_SetPropertyStr(c, o, "layoutMs", JS_NewFloat64(c, ui.layout_ms));
JS_SetPropertyStr(c, o, "paintMs", JS_NewFloat64(c, ui.paint_ms));
diff --git a/server/src/ui/node.c b/server/src/ui/node.c
index 8c37f70..8c26dd5 100644
--- a/server/src/ui/node.c
+++ b/server/src/ui/node.c
@@ -126,6 +126,21 @@ void node_invalidate(Node *n) {
invalidate_measure(n);
}
+void node_restyled(Node *n, const Style *before, const StyleExt *ext_before) {
+ /* the same value (e.g. React confirms the position left by a drag in C): nothing to repaint */
+ int ext_changed = n->s.ext && (!before->ext || memcmp(ext_before, n->s.ext, STYLE_EXT_VALUES));
+ if (memcmp(before, &n->s, sizeof *before) || ext_changed) {
+ /* only the insets of an absolutely positioned node changed (a dot sliding along the Monitor's
+ * map, the map image while panning): its size and content are the same, so it's only placed
+ * again, like a window being dragged (no remeasuring of every ancestor, no repaint of its
+ * content; the old and new boxes are damaged by the paint pass) */
+ Style moved = *before;
+ memcpy(moved.pos, n->s.pos, sizeof moved.pos);
+ if (!ext_changed && n->s.absolute && before->absolute && !memcmp(&moved, &n->s, sizeof moved)) node_moved(n);
+ else node_invalidate(n);
+ }
+}
+
void node_detach(Node *c) {
Node *p = c->parent;
if (!p) return;
diff --git a/server/src/ui/paint.c b/server/src/ui/paint.c
index c33c938..875af8f 100644
--- a/server/src/ui/paint.c
+++ b/server/src/ui/paint.c
@@ -431,8 +431,9 @@ static void tf_gc(void) {
/* ---- capa de la ventana que se mueve (grab.h) ----
* Al empezar a mover una ventana su árbol se pinta una vez en un búfer aparte (con su sombra) y
* en cada cuadro solo se copia en la posición nueva: no se vuelve a pintar texto, terminal ni
- * sombra. Si algo de adentro cambia (estilo, texto, la terminal, una app Linux) la capa se
- * vuelve a pintar. Sin capa (se pinta como siempre): con desenfoque de fondo adentro (necesita
+ * sombra. If something inside changes (a style, a text, the terminal, a Linux app), the layer is
+ * painted again: only the part that changed when that gives the same pixels (layer_tree_part,
+ * layer_part_exact), otherwise all of it. Sin capa (se pinta como siempre): con desenfoque de fondo adentro (necesita
* lo de abajo) y, en el camino GPU, si adentro hay una ventana de app (va como textura aparte).
*
* Lo de abajo (todo lo que se pinta antes que la ventana: fondo, escritorio, las otras ventanas)
@@ -458,6 +459,14 @@ static struct {
int resize; /* cambiando el tamaño: sin capa, solo lo de abajo */
uint8_t *hole; /* camino GPU: dónde la capa tiene el hueco de una app (alfa 0 de verdad) */
int painted; /* la capa se pintó en este cuadro (las apps ya quedaron anotadas) */
+ /* a node inside the window changed: layer.part also holds its boxes (layer_tree_part) */
+ int tree_part;
+ int inexact; /* something in the window may not paint the same when moved (layer_note_exact) */
+ float rx, ry; /* where the window was (physical px) when the layer was last painted whole */
+ int in_range; /* and the layer lay within [0, LAYER_EXACT_MAX) px (rounding is not
+ * shift-exact across 0: roundf, (int) truncation, canvas_corners_save) */
+ int ext_part; /* outside damage went into layer.part through layer.at since then */
+ int odd_text; /* text in it took a path that may not move exactly (text_drew_inexact) */
} layer;
void paint_layer_begin(int node, int resize) {
@@ -491,13 +500,20 @@ void paint_layer_view(int index) {
layer.below_valid = 0;
}
-static long layer_renders, layer_blits, below_renders;
+static long layer_renders, layer_blits, below_renders, layer_parts;
void paint_layer_stats(long *renders, long *blits) {
*renders = layer_renders + 1000 * below_renders;
*blits = layer_blits;
layer_renders = layer_blits = below_renders = 0;
}
+/* How many of those renders were only layer.part (layer_render_part), since the last call. */
+long paint_layer_parts(void) {
+ long n = layer_parts;
+ layer_parts = 0;
+ return n;
+}
+
static void subtree_box(Node *n, Box *b, int *ok) {
if (n->type == NODE_RAW || n->s.display_none) return;
if (n->s.backdrop_blur >= 1) *ok = 0;
@@ -567,14 +583,63 @@ static void layer_register(Canvas *c, Node *n, float op) {
if (n->type != NODE_TEXT) for (Node *k = n->first; k; k = k->next) layer_register(c, k, op);
}
-static int layer_render(Node *n, float opacity) {
- Box b = visual_box(n);
+/* The layer's box: the window's and its subtree's (logical px) in *b, its pixels on the view's
+ * physical ones. 0: no layer (a blur, a transformed window, too big). */
+static int layer_box(Node *n, Box *b, int *x0, int *y0, int *w, int *h) {
+ *b = visual_box(n);
int ok = !n->has_tf; /* a transformed window is painted as usual */
- subtree_box(n, &b, &ok);
- /* the layer's pixels are the view's physical ones */
- int x0 = (int)floorf(VX(b.x0)), y0 = (int)floorf(VY(b.y0));
- int w = (int)ceilf(VX(b.x1)) - x0, h = (int)ceilf(VY(b.y1)) - y0;
- if (!ok || w <= 0 || h <= 0 || (size_t)w * h > 4096u * 4096u) { layer.want = 0; return 0; }
+ subtree_box(n, b, &ok);
+ *x0 = (int)floorf(VX(b->x0));
+ *y0 = (int)floorf(VY(b->y0));
+ *w = (int)ceilf(VX(b->x1)) - *x0;
+ *h = (int)ceilf(VY(b->y1)) - *y0;
+ return ok && *w > 0 && *h > 0 && (size_t)*w * *h <= 4096u * 4096u;
+}
+
+/* Painting part of the layer again gives what painting it all at the window's new place would only
+ * if every pixel outside that part comes out the same when moved there. That holds when the window
+ * moved by whole physical pixels and every coordinate the paint computes from a position is a
+ * binary fraction small enough for a float to hold exactly at both places: positions and sizes in
+ * sixteenths of a logical pixel within ±LAYER_EXACT_MAX, a whole display scale, whole font sizes
+ * and text drawn by text.c's own path in a font with a power-of-two em (text_drew_inexact). A transformed node composites through its
+ * matrix, which is not exact when moved, so it must be inside the part (changed this frame). App
+ * windows and videos are left out (painting them registers them). */
+#define LAYER_EXACT_MAX 4096
+static int fine(float v) { float s = v * 16; return s == floorf(s) && fabsf(v) < LAYER_EXACT_MAX; }
+
+static void layer_note_exact(const Node *n, int dirty) {
+ const Style *s = &n->s;
+ const float *pd = node_padding(n);
+ int ok = fine(n->ax) && fine(n->ay) && fine(n->w) && fine(n->h);
+ for (int e = EDGE_L; e <= EDGE_B && ok; e++) ok = fine(pd[e]) && fine(node_border(n, e));
+ if (n->own_tf && !dirty) ok = 0;
+ if (n->type == NODE_SURFACE || n->type == NODE_MEDIA) ok = 0;
+ if (n->type == NODE_TEXT && (s->font_size != floorf(s->font_size) || !fine(s->line_height))) ok = 0;
+ if (!ok) layer.inexact = 1;
+}
+
+/* Whether the layer, kept and painted again only in layer.part, gives the pixels and the layer
+ * state of layer_render at the window's place now: the same box, offsets and scale. *bp: that box. */
+static int layer_part_exact(Node *n, Box *bp) {
+ const float k = paint_view.k;
+ if (layer.inexact || layer.odd_text || !layer.in_range || k != layer.k || k < 1 || k != floorf(k)) return 0;
+ if (!fine(paint_view.x) || !fine(paint_view.y) || !fine(paint_view.dx) || !fine(paint_view.dy)) return 0;
+ float sx = VX(n->ax) - layer.rx, sy = VY(n->ay) - layer.ry;
+ if (sx != floorf(sx) || sy != floorf(sy)) return 0;
+ Box b;
+ int x0, y0, w, h;
+ if (!layer_box(n, &b, &x0, &y0, &w, &h) || w != layer.w || h != layer.h) return 0;
+ if (x0 != (int)lroundf(VX(n->ax) + layer.pox) || y0 != (int)lroundf(VY(n->ay) + layer.poy)) return 0;
+ if (b.x0 - n->ax != layer.ox || b.y0 - n->ay != layer.oy || x0 - VX(n->ax) != layer.pox || y0 - VY(n->ay) != layer.poy) return 0;
+ if (x0 < 0 || y0 < 0 || x0 + w >= LAYER_EXACT_MAX || y0 + h >= LAYER_EXACT_MAX) return 0;
+ *bp = b;
+ return 1;
+}
+
+static int layer_render(Node *n, float opacity) {
+ Box b;
+ int x0, y0, w, h;
+ if (!layer_box(n, &b, &x0, &y0, &w, &h)) { layer.want = 0; return 0; }
if ((size_t)w * h > (size_t)layer.cap) {
uint32_t *px = realloc(layer.px, (size_t)w * h * 4);
uint8_t *hole = realloc(layer.hole, (size_t)w * h);
@@ -594,6 +659,10 @@ static int layer_render(Node *n, float opacity) {
layer.op = opacity;
layer.at = b;
layer.part = (Box){ 0, 0, 0, 0 };
+ layer.tree_part = layer.inexact = layer.ext_part = 0;
+ layer.rx = VX(n->ax);
+ layer.ry = VY(n->ay);
+ layer.in_range = x0 >= 0 && y0 >= 0 && x0 + w < LAYER_EXACT_MAX && y0 + h < LAYER_EXACT_MAX;
/* canvas con el origen corrido: el árbol se pinta en sus coordenadas de pantalla (así la terminal
* y las apps Linux siguen anotando dónde están), pero cae en el búfer de la capa */
Canvas lc;
@@ -602,7 +671,9 @@ static int layer_render(Node *n, float opacity) {
int skip = skip_until;
skip_until = 0;
layer.rendering = 1;
+ text_drew_inexact();
paint_node(&lc, n, opacity);
+ layer.odd_text = text_drew_inexact();
layer.rendering = 0;
skip_until = skip;
nlsurf = lsurf_all = 0;
@@ -614,14 +685,18 @@ static int layer_render(Node *n, float opacity) {
return 1;
}
-/* Repinta solo layer.part (lo que cambió adentro: una línea de la terminal, el cursor que parpadea). */
-static void layer_render_part(Node *n, float opacity) {
+/* Repinta solo layer.part (lo que cambió adentro: una línea de la terminal, el cursor que parpadea).
+ * 0: a part with a node's change (layer.tree_part) cut a transformed node's image on its left edge,
+ * which a full paint would not have cut (canvas_affine_watch): the caller paints the layer whole. */
+static int layer_render_part(Node *n, float opacity) {
int x0 = (int)lroundf(VX(n->ax) + layer.pox), y0 = (int)lroundf(VY(n->ay) + layer.poy);
Box p = layer.part;
+ int tree = layer.tree_part;
layer.part = (Box){ 0, 0, 0, 0 };
+ layer.tree_part = 0;
int px0 = (int)fmaxf(0, floorf(p.x0)), py0 = (int)fmaxf(0, floorf(p.y0));
int px1 = (int)fminf((float)layer.w, ceilf(p.x1)), py1 = (int)fminf((float)layer.h, ceilf(p.y1));
- if (px0 >= px1 || py0 >= py1) return;
+ if (px0 >= px1 || py0 >= py1) return 1;
layer_fill(px0, py0, px1, py1);
Canvas lc;
canvas_init(&lc, layer.px - ((ptrdiff_t)y0 * layer.w + x0), x0 + layer.w, y0 + layer.h, layer.w);
@@ -629,9 +704,14 @@ static void layer_render_part(Node *n, float opacity) {
int skip = skip_until;
skip_until = 0;
layer.rendering = 1;
+ if (tree) canvas_affine_watch(&lc, x0 + px0);
+ text_drew_inexact();
paint_node(&lc, n, opacity);
+ layer.odd_text |= text_drew_inexact();
+ int cut = tree && canvas_affine_cut();
layer.rendering = 0;
skip_until = skip;
+ if (cut) return 0;
nlsurf = lsurf_all = 0;
layer_surfaces(n, x0, y0);
layer_holes(px0, py0, px1, py1);
@@ -639,6 +719,8 @@ static void layer_render_part(Node *n, float opacity) {
float k = paint_view.k, lx = (x0 - paint_view.dx) / k + paint_view.x, ly = (y0 - paint_view.dy) / k + paint_view.y;
layer.at = (Box){ lx, ly, lx + layer.w / k, ly + layer.h / k };
layer_renders++;
+ layer_parts++;
+ return 1;
}
static int layer_paint(Canvas *c, Node *n, float opacity) {
@@ -646,8 +728,15 @@ static int layer_paint(Canvas *c, Node *n, float opacity) {
if (layer.stopped) return 1;
if (!layer.want || layer.rendering || n->id != layer.node || paint_capture_mode || layer.resize || paint_view.index != layer.view) return 0;
if (skip_until && !skip_reached && skip_until != layer.node) return 0; /* lo tapa un video */
+ /* a node inside changed: only its part, when that paints what a full render would */
+ Box b = layer.at;
+ if (layer.valid && layer.tree_part && layer.op == opacity && !layer_part_exact(n, &b)) layer.valid = 0;
if ((!layer.valid || layer.op != opacity) && !layer_render(n, opacity)) return 0;
- if (layer.part.x1 > layer.part.x0) layer_render_part(n, opacity);
+ if (layer.part.x1 > layer.part.x0) {
+ int tree = layer.tree_part;
+ if (layer_render_part(n, opacity)) { if (tree) layer.at = b; } /* layer_render's box */
+ else if (!layer_render(n, opacity)) return 0;
+ }
if (skip_until == layer.node) skip_reached = 1;
int bx = (int)lroundf(VX(n->ax) + layer.pox), by = (int)lroundf(VY(n->ay) + layer.poy);
canvas_blit(c, layer.px, layer.w, layer.h, bx, by, 0, 1, 0);
@@ -722,6 +811,30 @@ static Box box_or(Box a, Box b) {
return (Box){ fminf(a.x0, b.x0), fminf(a.y0, b.y0), fmaxf(a.x1, b.x1), fmaxf(a.y1, b.y1) };
}
+/* A node inside the dragged window changed or moved inside it: its old box (moved with the window)
+ * and its new one go into layer.part, in layer pixels from the window's place now, with a margin
+ * for the rounding of both (4 px: a transformed node's image reaches up to 3 px past its box).
+ * 0: the layer is painted whole (outside the layer, more than half of it, already invalid). */
+static int layer_tree_part(Box cur, Box moved) {
+ Node *w = node_get(layer.node);
+ int hc = cur.x1 > cur.x0 && cur.y1 > cur.y0, hm = moved.x1 > moved.x0 && moved.y1 > moved.y0;
+ /* outside damage mapped through layer.at, which may be stale (a node removed after copies only):
+ * until a full render, a node's change repaints the layer whole, as it always did */
+ if (!layer.valid || layer.ext_part || !w || (!hc && !hm)) return 0;
+ Box u = !hm ? cur : !hc ? moved : (Box){ fminf(cur.x0, moved.x0), fminf(cur.y0, moved.y0), fmaxf(cur.x1, moved.x1), fmaxf(cur.y1, moved.y1) };
+ float k = layer.k > 0 ? layer.k : 1, ox = roundf(w->ax + layer.ox), oy = roundf(w->ay + layer.oy);
+ Box q = { floorf((u.x0 - ox) * k), floorf((u.y0 - oy) * k), ceilf((u.x1 - ox) * k), ceilf((u.y1 - oy) * k) };
+ if (q.x0 < 0 || q.y0 < 0 || q.x1 > layer.w || q.y1 > layer.h) return 0;
+ q = (Box){ q.x0 - 4, q.y0 - 4, q.x1 + 4, q.y1 + 4 };
+ Box *p = &layer.part;
+ if (p->x1 <= p->x0) *p = q;
+ else { p->x0 = fminf(p->x0, q.x0); p->y0 = fminf(p->y0, q.y0); p->x1 = fmaxf(p->x1, q.x1); p->y1 = fmaxf(p->y1, q.y1); }
+ float aw = fminf(p->x1, (float)layer.w) - fmaxf(p->x0, 0), ah = fminf(p->y1, (float)layer.h) - fmaxf(p->y0, 0);
+ if (aw * ah * 2 > (float)layer.w * layer.h) return 0;
+ layer.tree_part = 1;
+ return 1;
+}
+
static void damage_walk(Node *n, int parent_dirty, int visible, int in_layer, Box clip) {
if (n->type == NODE_RAW) {
if (walk_sig && visible) sig_mix(walk_sig, &n->gen, sizeof n->gen); /* the text, for a cached raster */
@@ -750,11 +863,13 @@ static void damage_walk(Node *n, int parent_dirty, int visible, int in_layer, Bo
layer.gdx = cur.x0 - n->prev_box.x0;
layer.gdy = cur.y0 - n->prev_box.y0;
}
+ if (in_layer && vis) layer_note_exact(n, dirty);
if (dirty || !box_eq(cur, n->prev_box)) {
damage_add(n->prev_box);
damage_add(cur);
Box moved = { n->prev_box.x0 + layer.gdx, n->prev_box.y0 + layer.gdy, n->prev_box.x1 + layer.gdx, n->prev_box.y1 + layer.gdy };
- if (in_layer && (dirty || !box_eq(cur, moved))) layer.valid = 0;
+ /* the window itself (its style, its size): the whole layer; a node inside: its part */
+ if (in_layer && (dirty || !box_eq(cur, moved)) && (n->id == layer.node || !layer_tree_part(cur, moved))) layer.valid = 0;
if (!in_layer) layer.below_valid = 0;
}
n->prev_box = cur;
@@ -989,6 +1104,7 @@ int paint_damage(Node *root) {
/* lo que llegó de afuera desde el cuadro anterior (terminal, apps Linux, video): si toca la
* ventana, se vuelve a pintar su capa; si cae afuera, lo de abajo */
Box ext = ui.damage;
+ if (!layer.tree_part) layer.inexact = 0; /* layer_note_exact, for the part still to paint */
if (layer.want && ext.x1 > ext.x0 && ext.y1 > ext.y0) {
Node *n = node_get(layer.node);
Box now = n ? n->prev_box : layer.at;
@@ -999,6 +1115,7 @@ int paint_damage(Node *root) {
Box *p = &layer.part;
if (p->x1 <= p->x0) *p = q;
else { p->x0 = fminf(p->x0, q.x0); p->y0 = fminf(p->y0, q.y0); p->x1 = fmaxf(p->x1, q.x1); p->y1 = fmaxf(p->y1, q.y1); }
+ layer.ext_part = 1;
} else if (box_meets(ext, layer.at) || box_meets(ext, now)) layer.valid = 0;
if (!box_inside(ext, layer.at) && !box_inside(ext, now)) layer.below_valid = 0;
}
@@ -1007,7 +1124,9 @@ int paint_damage(Node *root) {
if (multi_rects(root)) return 1;
/* the damage is one box: growing it for a blurred node can reach another one (the bar and a menu) */
for (int pass = 0, grew = 1; root && grew && pass < 4 && ui.damage.x1 > ui.damage.x0; pass++) { grew = 0; blur_walk(root, &grew); }
- if (layer.want && layer.valid && layer.part.x1 > layer.part.x0) { /* esa parte, donde está ahora la ventana */
+ /* esa parte, donde está ahora la ventana; not with a node's change, where the whole layer used to be
+ * painted again and nodes' own boxes are the damage */
+ if (layer.want && layer.valid && !layer.tree_part && layer.part.x1 > layer.part.x0) {
Node *n = node_get(layer.node);
if (n) {
float x0 = roundf(n->ax + layer.ox), y0 = roundf(n->ay + layer.oy), k = layer.k > 0 ? layer.k : 1;
@@ -1051,8 +1170,10 @@ static int opaque_cover_node(Node *root) {
return found == root->id ? 0 : found;
}
-void paint_root(Canvas *c, Node *root) {
- if (!root) return;
+/* clear: fill the clip with rgb first, unless the copy of what is below the dragged window is
+ * about to write every pixel of that same clip (below_copy), which makes the fill wasted work */
+static void paint_root_body(Canvas *c, Node *root, int clear, uint32_t rgb) {
+ if (!root) { if (clear) canvas_clear(c, rgb); return; }
wl_paint_begin();
/* solo cambió un cuadro de video que tapa esa región: se pinta desde ese nodo (no en el camino
* GPU, que arma acá la lista de ventanas de las apps) */
@@ -1061,9 +1182,12 @@ void paint_root(Canvas *c, Node *root) {
skip_reached = 0;
paint_cull = !gpu_active() && paint_multi_damage;
/* una ventana que se mueve: lo de abajo se copia y se pinta desde ella (capa del arrastre) */
- if (!skip_until && below_ready(c, root)) {
+ int below = !skip_until && below_ready(c, root); /* once per call: it counts layer.since */
+ if (below) {
below_copy(c);
skip_until = layer.node;
+ } else if (clear) {
+ canvas_clear(c, rgb);
}
paint_node(c, root, 1);
skip_until = 0;
@@ -1077,6 +1201,31 @@ void paint_root(Canvas *c, Node *root) {
}
}
+void paint_root(Canvas *c, Node *root) {
+ paint_root_body(c, root, 0, 0);
+}
+
+/* canvas_clear(c, rgb) followed by paint_root(c, root), with the same pixels */
+void paint_root_clear(Canvas *c, Node *root, uint32_t rgb) {
+ paint_root_body(c, root, 1, rgb);
+}
+
+/* The whole tree painted again with nothing kept from earlier frames: no drag layer, no copy of what
+ * is below it, no node skipped (LORD_PAINT_VERIFY in main.c and engine-test compare it with the
+ * frame). Like paint_root it starts a new list of app windows on the GPU path: the caller keeps the
+ * frame's (wl_paint_save/wl_paint_restore). The canvas must be cleared first. */
+void paint_root_full(Canvas *c, Node *root) {
+ if (!root) return;
+ wl_paint_begin();
+ int want = layer.want;
+ layer.want = 0;
+ skip_until = skip_reached = 0;
+ paint_cull = 0;
+ paint_node(c, root, 1);
+ layer.want = want;
+ wl_paint_popups(c);
+}
+
int paint_capture_mode;
void paint_capture(Canvas *c, Node *root) {
diff --git a/server/src/ui/text.c b/server/src/ui/text.c
index 63b20fc..c0ebaeb 100644
--- a/server/src/ui/text.c
+++ b/server/src/ui/text.c
@@ -58,6 +58,13 @@ static unsigned char *map_file(const char *path, size_t *size) {
static unsigned be16(const unsigned char *d, size_t n, size_t off) { return off + 2 <= n ? (unsigned)(d[off] << 8 | d[off + 1]) : 0; }
+/* Whether text drawn since the last call may land differently when moved by whole pixels: only
+ * draw_fast with a font whose em is a power of two of at most 2048 units keeps every pen position an
+ * exact binary fraction at a whole font size; textlayout.c (shaping, other scripts' fonts) is not
+ * checked (paint.c's drag layer, layer_part_exact). */
+static int drew_inexact;
+int text_drew_inexact(void) { int r = drew_inexact; drew_inexact = 0; return r; }
+
/* a font already in memory (mapped: munmap it if it isn't a font) */
static int load_bytes(Font *f, unsigned char *data, size_t size, int index, int mapped) {
memset(f, 0, sizeof *f);
@@ -446,6 +453,7 @@ static void draw_fast(Canvas *c, const char *s, int font, float size, float line
if (k != 1) for (int i = 0; i < n; i++) lines[i].width *= k;
float lh = text_line_height(size, line_h);
Font *f = &fonts[font];
+ if (!f->upem || (f->upem & (f->upem - 1)) || f->upem > 2048) drew_inexact = 1;
float scale = stbtt_ScaleForMappingEmToPixels(&f->info, size);
float asc = f->ascent * scale, desc = f->descent * scale;
for (int i = 0; i < n; i++) {
@@ -470,7 +478,7 @@ static void draw_fast(Canvas *c, const char *s, int font, float size, float line
void text_draw(Canvas *c, const char *s, float weight, float size, float line_h,
float x, float y, float box_w, int align, int nowrap, uint32_t argb) {
int font = font_for(weight);
- if (text_needs_layout(s, font)) { text_layout_draw(c, s, font, size, line_h, x, y, box_w, align, nowrap, argb); return; }
+ if (text_needs_layout(s, font)) { drew_inexact = 1; text_layout_draw(c, s, font, size, line_h, x, y, box_w, align, nowrap, argb); return; }
draw_fast(c, s, font, size, line_h, x, y, box_w, align, nowrap, 0, argb);
}
@@ -563,7 +571,7 @@ static int line_ranges(const char *s, int font, float size, float box_w, int now
static void draw_lines(Canvas *c, const char *s, int font, float size, float line_h,
float x, float y, float box_w, int align, int nowrap, int max_lines, uint32_t argb) {
- if (text_needs_layout(s, font)) text_layout_draw_n(c, s, font, size, line_h, x, y, box_w, align, nowrap, max_lines, argb);
+ if (text_needs_layout(s, font)) { drew_inexact = 1; text_layout_draw_n(c, s, font, size, line_h, x, y, box_w, align, nowrap, max_lines, argb); }
else draw_fast(c, s, font, size, line_h, x, y, box_w, align, nowrap, max_lines, argb);
}
diff --git a/server/src/ui/ui.h b/server/src/ui/ui.h
index a3526f6..f9ff621 100644
--- a/server/src/ui/ui.h
+++ b/server/src/ui/ui.h
@@ -161,6 +161,9 @@ void node_detach(Node *c);
void node_set_text(Node *n, const char *s);
void node_invalidate(Node *n);
void node_moved(Node *n); /* only left/top changed (window drag): no repaint of its content */
+/* after a style change (lord.setStyle): before = the style, ext_before = its StyleExt values (NULL
+ * if it had none) before the change; places, remeasures or repaints only what the change needs */
+void node_restyled(Node *n, const Style *before, const StyleExt *ext_before);
int node_gather_text(const Node *n, char *buf, int size);
int node_children_ordered(Node *n, Node **out, int max);
void damage_add(Box b);
@@ -207,6 +210,7 @@ typedef struct {
/* The pointer is valid until the next call (the cache may grow). */
const Glyph *text_glyph(uint32_t cp, int font, float size);
int text_font_add(const char *path);
+int text_drew_inexact(void); /* text drawn since the last call may not move exactly; resets */
int text_font_load(const char *path, int index);
int text_font_has(int font, uint32_t cp);
uint32_t text_font_glyph(int font, uint32_t cp); /* glyph index, 0 = doesn't have it */
@@ -292,6 +296,8 @@ extern int paint_multi_damage; /* 1: several rectangles (LORD_DAMAGE=multi,
extern int paint_tf_nocache; /* tests: a reference paint that neither reads nor fills the
* transformed subtrees' raster cache (engine-test) */
void paint_root(Canvas *c, Node *root);
+void paint_root_clear(Canvas *c, Node *root, uint32_t rgb); /* canvas_clear + paint_root */
+void paint_root_full(Canvas *c, Node *root); /* everything, no drag layer or skipped nodes (checks only) */
Node *hit_test(Node *root, float x, float y);
/* Capture mode (media/capture.c): protected nodes are painted black and app windows
* are copied even when compositing on the GPU. paint_capture paints the whole tree this way. */
diff --git a/server/src/wl/wl.c b/server/src/wl/wl.c
index b2715e6..d5a03fa 100644
--- a/server/src/wl/wl.c
+++ b/server/src/wl/wl.c
@@ -2132,6 +2132,18 @@ void wl_paint_kept(void) {
for (int i = 0; i < nkept && ndraws[0] < 128; i++) draws[0][ndraws[0]++] = kept[i];
}
+/* LORD_PAINT_VERIFY (main.c): its check repaint notes the app windows again; the frame keeps its list. */
+static Draw verify_draws[2][128];
+static int verify_n[2];
+void wl_paint_save(void) {
+ memcpy(verify_draws, draws, sizeof verify_draws);
+ memcpy(verify_n, ndraws, sizeof verify_n);
+}
+void wl_paint_restore(void) {
+ memcpy(draws, verify_draws, sizeof draws);
+ memcpy(ndraws, verify_n, sizeof ndraws);
+}
+
void wl_paint(Canvas *c, int id, int node, float x, float y, float w, float h, float op) {
Surf *s = find(id);
if (!s || s->role != R_TOPLEVEL) return;
diff --git a/server/src/wl/wl.h b/server/src/wl/wl.h
index 558f82c..1f4890e 100644
--- a/server/src/wl/wl.h
+++ b/server/src/wl/wl.h
@@ -58,6 +58,8 @@ void wl_set_pointer_scale(int pct); /* the display under the pointer: cu
void wl_paint_begin(void);
void wl_paint_keep(void); /* saves the windows noted so far (paint.c, «what is below») */
void wl_paint_kept(void); /* and notes them again in another frame */
+void wl_paint_save(void); /* keeps the frame's list of windows (LORD_PAINT_VERIFY) */
+void wl_paint_restore(void); /* and puts it back */
void wl_paint_holes(int on); /* 0: wl_paint only notes the window, without opening the hole */
void wl_paint(Canvas *c, int id, int node, float x, float y, float w, float h, float op);
void wl_paint_popups(Canvas *c);
diff --git a/server/tests/drag_golden_cpu.txt b/server/tests/drag_golden_cpu.txt
new file mode 100644
index 0000000..7067d51
--- /dev/null
+++ b/server/tests/drag_golden_cpu.txt
@@ -0,0 +1,728 @@
+# engine-test test_drag_exact, cpu path: FNV-1a hash of every frame of the dragged window.
+# Written by `make drag-golden` on the code before the drag-frame optimizations
+# (001633b); later code must give the same pixels. Lines: architecture, run, frame, hash.
+x86_64 drag 0 16b358d6ecdc9df7
+x86_64 drag 1 45b0c7469d08a10e
+x86_64 drag 2 4751550b69048479
+x86_64 drag 3 0cfd0c4a1c495e35
+x86_64 drag 4 e720ff5165a49ea6
+x86_64 drag 5 7d84b6cbbe10e844
+x86_64 drag 6 70c81c1464fe0203
+x86_64 drag 7 bf284720044f96ce
+x86_64 drag 8 42af2718ee767b70
+x86_64 drag 9 a79115a732fb41ad
+x86_64 drag 10 8e4a14d7d58d2aa3
+x86_64 drag 11 3d4e9dd294e3fbad
+x86_64 drag 12 da8fce365be2fbc8
+x86_64 drag 13 1b9c12de4f50ea8e
+x86_64 drag 14 afbc2a5af82dd018
+x86_64 drag 15 277664c46fe88b61
+x86_64 drag 16 a5f7a787b3648661
+x86_64 drag 17 8f4267dff90f9e54
+x86_64 drag 18 a11abdaccd8b9ff3
+x86_64 drag 19 4ff5b4072775f7bf
+x86_64 drag 20 3262476e84603313
+x86_64 drag 21 57c4638317706f80
+x86_64 drag 22 2919ee17cfa69a37
+x86_64 drag 23 8d22092a71a0c4ff
+x86_64 drag 24 7bdbd9f9d361d783
+x86_64 drag 25 ab5a5151bbe2bc23
+x86_64 drag 26 c4441eb1c81ac29b
+x86_64 drag 27 151e320ab61b3002
+x86_64 drag 28 2d0683fd11625b3b
+x86_64 drag 29 0ee1d1a20faba7c1
+x86_64 drag 30 d0cc1ca36a8e4137
+x86_64 drag 31 ccc1ea31b5a9074b
+x86_64 drag 32 39847e4711f0df69
+x86_64 drag 33 3264e1dd39d6de26
+x86_64 drag 34 4b0d4cb33df190ec
+x86_64 drag 35 ce042530fdd3073c
+x86_64 drag 36 567522e0c410e87f
+x86_64 drag 37 dfab45fbad50f901
+x86_64 drag 38 5c30eaff8ef6e537
+x86_64 drag 39 63eb231eb9b6c492
+x86_64 drag 40 6cf1b438b347b8a7
+x86_64 drag 41 abbf7de6bcd88e96
+x86_64 drag 42 166ed8c951878fe6
+x86_64 drag 43 6d7b5b5e8cc1841a
+x86_64 drag 44 c17cb96949080cb3
+x86_64 drag 45 1b20d265747c6978
+x86_64 drag 46 a20ae71aabd0960b
+x86_64 drag 47 b7cc9a631dd9cc83
+x86_64 drag 48 712287187d1c28d8
+x86_64 drag 49 5341d5ae9993b92c
+x86_64 drag 50 e3446152a1a1a1e9
+x86_64 drag 51 3990586232482370
+x86_64 drag 52 98684a5469c84012
+x86_64 drag 53 5c3f6a50ec25f968
+x86_64 drag 54 f041ea64bb9c7deb
+x86_64 drag 55 5cbe600652d37abf
+x86_64 drag 56 bf0581f3f370e2b7
+x86_64 drag 57 d3c44cb0dbb3383a
+x86_64 drag 58 dd8cc786d70c76a0
+x86_64 drag 59 582285199af32693
+x86_64 drag 60 812cc89471153ca3
+x86_64 drag 61 555d01075564efde
+x86_64 drag 62 ec68d1cfb03b257e
+x86_64 drag 63 fa1a5ecf32184ae9
+x86_64 drag 64 57a058b3ebfeb614
+x86_64 drag 65 986fe689256e6872
+x86_64 drag 66 e096cf13d3884856
+x86_64 drag 67 fdd358918c3679e5
+x86_64 drag 68 3b82d914c08b434a
+x86_64 drag 69 bf6fcf4891d2d3fe
+x86_64 drag 70 77cf56641addf648
+x86_64 drag 71 3e0a59244d2c4793
+x86_64 drag 72 adea336f57d88f24
+x86_64 drag 73 fd6d1e03482701f9
+x86_64 drag 74 6e3460dc2bdba5ed
+x86_64 drag 75 5ecc9eb8978e576e
+x86_64 drag 76 e0f6db9f59e242b8
+x86_64 drag 77 cbe410d46ab74459
+x86_64 drag 78 6b56c5a29b4cbea1
+x86_64 drag 79 11970554708ff04f
+x86_64 drag 80 44dad9f879a19f04
+x86_64 drag 81 117b3e2edd1f8c41
+x86_64 drag 82 23412fab765a329c
+x86_64 drag 83 8bd6614296ee7f82
+x86_64 drag 84 ee93fc1d94d1b8cb
+x86_64 drag 85 dcfdbae79c480477
+x86_64 drag 86 cf1dc2c3b3eb2523
+x86_64 drag 87 fcb76ffa1a2723e3
+x86_64 drag 88 204f0ba555b22eff
+x86_64 drag 89 0c121ac028a111cc
+x86_64 drag 90 9f0de654847fc1c4
+x86_64 drag 91 fe1c430b25303c42
+x86_64 drag 92 e9db12d92e1f42f3
+x86_64 drag 93 19dd1fc1da4fcc2b
+x86_64 drag 94 f8818b05febaf7d1
+x86_64 drag 95 85d4d59bb03cf8b5
+x86_64 drag 96 f296e5d7f383d83c
+x86_64 drag 97 2c2cad1f0b23b477
+x86_64 drag 98 6542802dad00165c
+x86_64 drag 99 83fbc9cdd3f7305f
+x86_64 drag 100 ac83462dca7f0826
+x86_64 drag 101 5f85d44063593291
+x86_64 drag 102 aa70296acfe45cef
+x86_64 drag 103 332f971e3e257a12
+x86_64 drag 104 ddcb4f0a6228428f
+x86_64 drag 105 0a4dcda63c3b4081
+x86_64 drag 106 f9cbd62be5a235cd
+x86_64 drag 107 9ba7b7566f920275
+x86_64 drag 108 2ea85fb730905b53
+x86_64 drag 109 e4d4822faa252c9f
+x86_64 drag 110 72ec68fd84f083bc
+x86_64 drag 111 14e5908b9df5614c
+x86_64 drag 112 61256c192addbc9a
+x86_64 drag 113 94f99607aba006f8
+x86_64 drag 114 72fe96a611ba3119
+x86_64 drag 115 b6bd97b3faaf5aa4
+x86_64 drag 116 00b2af60ce6741cb
+x86_64 drag 117 ae051bd96756d5e5
+x86_64 drag 118 48a3ae5c709d05e5
+x86_64 drag 119 d6ae055218a608fb
+x86_64 drag 120 81762cf84603c9a4
+x86_64 drag 121 184e594620a8429e
+x86_64 drag 122 0f2cde17da2d3df0
+x86_64 drag 123 fd4ab9e40f021d49
+x86_64 drag 124 6644e7410fef481d
+x86_64 drag 125 e3201e2c35c7ac09
+x86_64 drag 126 5743d743147739e8
+x86_64 drag 127 d52aa3d126eae99a
+x86_64 drag 128 5fe99091c0eaac60
+x86_64 drag 129 b5a35ea6f133625d
+x86_64 drag 130 00b9a5f10410d6ca
+x86_64 drag 131 de60d32b2a6e4bd5
+x86_64 drag 132 09596e0ff83ff29e
+x86_64 drag 133 c963e3f08a093233
+x86_64 drag 134 0f952abe3cd8860b
+x86_64 drag 135 efc1a2113284da6c
+x86_64 drag 136 eb6031d3fe02e30f
+x86_64 drag 137 bd3944140d028273
+x86_64 drag 138 721118cd6df087b4
+x86_64 drag 139 348d9439934f35ee
+x86_64 drag 140 3fb1820906184eed
+x86_64 drag 141 b1e33be0d440e7c6
+x86_64 drag 142 7f1ebdf4646a764e
+x86_64 drag 143 4c7a91df7d272195
+x86_64 drag 144 6825a6a336c80e9a
+x86_64 drag 145 09ce25628e5131d5
+x86_64 drag 146 41687afe1ff278cc
+x86_64 drag 147 56fa46e115ce7cde
+x86_64 drag 148 9731a8550d94adca
+x86_64 drag 149 54373626d93fdd33
+x86_64 drag 150 1614b00b6cd2741e
+x86_64 drag 151 c0c57b4d16a4df1a
+x86_64 drag 152 b57a9eefbab5456a
+x86_64 drag 153 bb926c465177893d
+x86_64 drag 154 a022a97d6931aa20
+x86_64 drag 155 31d5aebf6304dd6a
+x86_64 drag 156 ed6bec1d0823c2c1
+x86_64 drag 157 2ac27332fb71a73c
+x86_64 drag 158 8d1c598e9d6a33ff
+x86_64 drag 159 02b0abe0b08f86ae
+x86_64 drag 160 bd789b2124ae9c08
+x86_64 drag 161 813dd62d319518f4
+x86_64 drag 162 67b7c0bb1b0f6992
+x86_64 drag 163 88fb484ff311c8ca
+x86_64 drag 164 01210cfe0c27a57f
+x86_64 drag 165 1f36b03b0959b602
+x86_64 drag 166 783cd0129ecf9b62
+x86_64 drag 167 48694c39298fc032
+x86_64 drag 168 95178493634dbe23
+x86_64 drag 169 b731ebbde1ed9ba9
+x86_64 drag 170 b50937a61fdcb319
+x86_64 drag 171 0db72756032ae6e0
+x86_64 drag 172 c0352132c1b3ca55
+x86_64 drag 173 ac5fe6cbdb8614d0
+x86_64 drag 174 42fbce25c2ab7157
+x86_64 drag 175 22fca047ee495267
+x86_64 drag 176 8e54b5fbbed60d30
+x86_64 drag 177 2e69ab1203ff633a
+x86_64 drag 178 b20890074902cea6
+x86_64 drag 179 33b3d72f9f462d06
+x86_64 drag 180 067ce7e4862996cd
+x86_64 drag 181 40d55c4054597fe0
+x86_64 drag 182 a995677b822c2380
+x86_64 drag 183 36f425467f9fe678
+x86_64 drag 184 c9b1a31079b2ac61
+x86_64 drag 185 55be4e40e37bb748
+x86_64 drag 186 ab0e67c99193e81d
+x86_64 drag 187 9eeadc6ac9976e11
+x86_64 drag 188 f1a019529daf4f9c
+x86_64 drag 189 37c4b0ccb5d32b64
+x86_64 drag 190 6e4947b7bc1c11b2
+x86_64 drag 191 a7f64e70e305a45e
+x86_64 drag 192 701cd33f9f8de71a
+x86_64 drag 193 19cfbd9d60b93903
+x86_64 drag 194 4604a73c9de85d53
+x86_64 drag 195 01eb5baf3f6fd6c0
+x86_64 drag 196 7c3ec13915263bd9
+x86_64 drag 197 d05dbe5b34f84f88
+x86_64 drag 198 fefe2642f7afa14d
+x86_64 drag 199 bc8fad81efc893ae
+x86_64 drag 200 49b334199061650a
+x86_64 drag 201 2dd74b96c465cd5f
+x86_64 drag 202 ea344acc3de913fc
+x86_64 drag 203 bab538d7dd92b8ca
+x86_64 drag 204 fd1fafa622bc75f0
+x86_64 drag 205 6db9936ef95b4476
+x86_64 drag 206 c6aa110706556a74
+x86_64 drag 207 b033854b56a57a83
+x86_64 drag 208 05af90e4177fe8b4
+x86_64 drag 209 5fbb0eb5ac0c8cf8
+x86_64 drag 210 f46f8d12c7a8bdfb
+x86_64 drag 211 8b21eca281411022
+x86_64 drag 212 b7f1c3cfac300b95
+x86_64 drag 213 e3369937aca3b07f
+x86_64 drag 214 fd708df5628d1f1c
+x86_64 drag 215 4006dc3affe02a9e
+x86_64 drag 216 bfce684a3312c822
+x86_64 drag 217 ee52c3477b3e8b09
+x86_64 drag 218 7789b86fffc52996
+x86_64 drag 219 53e34a737425acf3
+x86_64 drag 220 648451767dad84dd
+x86_64 drag 221 adc964f52bdeedae
+x86_64 drag 222 dfc93b767ea37bd1
+x86_64 drag 223 1e6d2bebf895e519
+x86_64 drag 224 f9499146ae0ca9ea
+x86_64 drag 225 9737067c715c4187
+x86_64 drag 226 20b0503428a8d95b
+x86_64 drag 227 677251d761bb42eb
+x86_64 drag 228 0c91d6879e7763b4
+x86_64 drag 229 8ebe208c9305ed75
+x86_64 drag 230 cf926f6eb3d06b66
+x86_64 drag 231 5133c17e03af86c6
+x86_64 drag 232 688d2e073cd12b13
+x86_64 drag 233 ec8b3255c06b4ae9
+x86_64 drag 234 6a57d16c6a7a75a9
+x86_64 drag 235 ec712c153bf2696d
+x86_64 drag 236 bee670af93dba57b
+x86_64 drag 237 0531afa458932c93
+x86_64 drag 238 7e9854c47d4446bb
+x86_64 drag 239 df0025470e9a9044
+x86_64 drag 240 14cafdf85893191b
+x86_64 drag 241 e22b1f6366e68f97
+x86_64 drag 242 87aee724d2e90d32
+x86_64 drag 243 a78b660f8dfa252f
+x86_64 drag 244 d2d6de5f8d8f401e
+x86_64 drag 245 3a9c5b95d9ea568e
+x86_64 drag 246 0484fd685e1d84f6
+x86_64 drag 247 ef01767e8d5670f0
+x86_64 drag 248 96993b19afd09432
+x86_64 drag 249 d07e771bd37ddd99
+x86_64 drag 250 72faec843f5cf3da
+x86_64 drag 251 7b0f5b90ff7596f4
+x86_64 drag 252 dee312a499a19c15
+x86_64 drag 253 20997d5070357a8e
+x86_64 drag 254 c296842fa315d772
+x86_64 drag 255 12e7b905c4606eaf
+x86_64 drag 256 a2bc2316921dd427
+x86_64 drag 257 c66dab9b5e1e862e
+x86_64 drag 258 93afd3470c466f36
+x86_64 drag 259 557c95d3652408ba
+x86_64 drag 260 661ec373c8238f34
+x86_64 drag 261 026baa1b37c5a8d0
+x86_64 drag 262 ac3cdd256871a5ec
+x86_64 drag 263 a19c5b1bbd8bba05
+x86_64 drag 264 e67d0e5f3834ffd9
+x86_64 drag 265 36b81058e20f158d
+x86_64 drag 266 a91dffe7f1a95991
+x86_64 drag 267 b4b692079ab6c5d6
+x86_64 drag 268 0b902bc8a1838b04
+x86_64 drag 269 b462fa155dc688d3
+x86_64 drag 270 15fb3e1a9fa3c9b6
+x86_64 drag 271 61cd841757dd3527
+x86_64 drag 272 2f357a37e522f257
+x86_64 drag 273 d087cc41b7d4638d
+x86_64 drag 274 216c3238661564ab
+x86_64 drag 275 b513e8fdb586df95
+x86_64 drag 276 a3be4050607b739c
+x86_64 drag 277 e4b2b40607499c56
+x86_64 drag 278 4a0fc3cac5567ab3
+x86_64 drag 279 dbadc99be997dd1e
+x86_64 drag 280 78e9fc8a04ba7e6b
+x86_64 drag 281 ab536438259d0396
+x86_64 drag 282 716d39078085d5ba
+x86_64 drag 283 ed4f1605a7191e88
+x86_64 drag 284 e6ec80eab9b41d3a
+x86_64 drag 285 6241b44250a1af2e
+x86_64 drag 286 5880ffa6f9fd7203
+x86_64 drag 287 515616a49e3d9e36
+x86_64 drag 288 e160cdd61b819e0a
+x86_64 drag 289 9e634d25b5c11029
+x86_64 drag 290 ce489199ba665429
+x86_64 drag 291 2b77408e8a187db9
+x86_64 drag 292 ec2ebed3fd4a4ef9
+x86_64 drag 293 c3280f92e91edaa1
+x86_64 drag 294 aa8eddc3123ec514
+x86_64 drag 295 c18b8187442e65b4
+x86_64 drag 296 f9363aa2de6d44f0
+x86_64 drag 297 28e52e1690cd083f
+x86_64 drag 298 caf79d92d849bf70
+x86_64 drag 299 7b29b15bcfa84cdf
+x86_64 drag 300 d5666e8982b1ea44
+x86_64 drag 301 57f36751c8df90ec
+x86_64 drag 302 d62c73e74347827e
+x86_64 drag 303 9208832d09e10f09
+x86_64 drag 304 ff31f04679e2eeb3
+x86_64 drag 305 4a5515d56b31ddcc
+x86_64 drag 306 26817a3f37290876
+x86_64 drag 307 1ed7bf98724d5f99
+x86_64 drag 308 d35d4c0c0c4eda9a
+x86_64 drag 309 cfad84225ec9a8dc
+x86_64 drag 310 6ac877f82dedafab
+x86_64 drag 311 aa6a97961335aba4
+x86_64 drag 312 e2260a2514bfb1e3
+x86_64 drag 313 8f7e965fd308aad9
+x86_64 drag 314 3de8035f97b2d362
+x86_64 drag 315 0a5f34ed6d505ae4
+x86_64 drag 316 d01894ca056633ba
+x86_64 drag 317 1c2f3e90d252b652
+x86_64 drag 318 85852dccff542d3f
+x86_64 drag 319 a326ee768a1c8c55
+x86_64 drag 320 92a7f9a39f89b894
+x86_64 drag 321 81e7b641cfe678e3
+x86_64 drag 322 97008488e4ff2539
+x86_64 drag 323 d3d5aa92153433a6
+x86_64 drag 324 d5b0f61004655e27
+x86_64 drag 325 5b70480b5311ea2b
+x86_64 drag 326 d9b819abf754f13f
+x86_64 drag 327 3ea19928eac6016d
+x86_64 drag 328 00723cd33a161e1e
+x86_64 drag 329 b1c6adad9f6f636b
+x86_64 drag 330 3b099b8589b9ce9a
+x86_64 drag 331 ac34f4e79ecedf0e
+x86_64 drag 332 94494559c08d1977
+x86_64 drag 333 52f8382dbf5cd122
+x86_64 drag 334 4df7f0599b47763a
+x86_64 drag 335 b52feab2b731ec50
+x86_64 drag 336 3f9bfb3e587409b3
+x86_64 drag 337 7d570ee706f6d1b3
+x86_64 drag 338 6670dec9760dac45
+x86_64 drag 339 0084df4412542374
+x86_64 drag 340 0b1df4fd8955dfe5
+x86_64 drag 341 6f6c39fbc97e130b
+x86_64 drag 342 89a032bb2b93411f
+x86_64 drag 343 41d861b87c7ef7c8
+x86_64 drag 344 5a0b57d9ad7573a4
+x86_64 drag 345 396fa1518a5f4fc9
+x86_64 drag 346 ead6639aa82a7fc0
+x86_64 drag 347 1729b8983a5a7695
+x86_64 drag 348 af873912901b3a0d
+x86_64 drag 349 ee176bc4c3168df8
+x86_64 drag 350 eb66f46ec0658c46
+x86_64 drag 351 49fb6dfacda48427
+x86_64 drag 352 3b15891ecd69e646
+x86_64 drag 353 9ff52d40312010e7
+x86_64 drag 354 b4496d9a662e009e
+x86_64 drag 355 903aa10012e1f612
+x86_64 drag 356 c01c6a950f3e6f10
+x86_64 drag 357 cb336d9fd8139314
+x86_64 drag 358 4df5d660e84d499e
+x86_64 drag 359 7b7bdd549d29afee
+x86_64 drag 360 067ce7e4862996cd
+x86_64 drag 361 45b0c7469d08a10e
+x86_64 drag 362 4751550b69048479
+x86_64 drag 363 0cfd0c4a1c495e35
+x86_64 drag 364 e720ff5165a49ea6
+x86_64 drag 365 7d84b6cbbe10e844
+x86_64 drag 366 70c81c1464fe0203
+x86_64 drag 367 bf284720044f96ce
+x86_64 drag 368 42af2718ee767b70
+x86_64 drag 369 a79115a732fb41ad
+x86_64 drag 370 8e4a14d7d58d2aa3
+x86_64 drag 371 3d4e9dd294e3fbad
+x86_64 drag 372 da8fce365be2fbc8
+x86_64 drag 373 1b9c12de4f50ea8e
+x86_64 drag 374 afbc2a5af82dd018
+x86_64 drag 375 277664c46fe88b61
+x86_64 drag 376 a5f7a787b3648661
+x86_64 drag 377 8f4267dff90f9e54
+x86_64 drag 378 a11abdaccd8b9ff3
+x86_64 drag 379 4ff5b4072775f7bf
+x86_64 drag 380 3262476e84603313
+x86_64 drag 381 57c4638317706f80
+x86_64 drag 382 2919ee17cfa69a37
+x86_64 drag 383 8d22092a71a0c4ff
+x86_64 drag 384 7bdbd9f9d361d783
+x86_64 drag 385 ab5a5151bbe2bc23
+x86_64 drag 386 c4441eb1c81ac29b
+x86_64 drag 387 151e320ab61b3002
+x86_64 drag 388 2d0683fd11625b3b
+x86_64 drag 389 0ee1d1a20faba7c1
+x86_64 drag 390 d0cc1ca36a8e4137
+x86_64 drag 391 ccc1ea31b5a9074b
+x86_64 drag 392 39847e4711f0df69
+x86_64 drag 393 3264e1dd39d6de26
+x86_64 drag 394 4b0d4cb33df190ec
+x86_64 drag 395 ce042530fdd3073c
+x86_64 drag 396 567522e0c410e87f
+x86_64 drag 397 dfab45fbad50f901
+x86_64 drag 398 5c30eaff8ef6e537
+x86_64 drag 399 63eb231eb9b6c492
+x86_64 drag 400 6cf1b438b347b8a7
+x86_64 drag 401 abbf7de6bcd88e96
+x86_64 drag 402 166ed8c951878fe6
+x86_64 drag 403 6d7b5b5e8cc1841a
+x86_64 drag 404 c17cb96949080cb3
+x86_64 drag 405 1b20d265747c6978
+x86_64 drag 406 a20ae71aabd0960b
+x86_64 drag 407 b7cc9a631dd9cc83
+x86_64 drag 408 712287187d1c28d8
+x86_64 drag 409 5341d5ae9993b92c
+x86_64 drag 410 e3446152a1a1a1e9
+x86_64 drag 411 3990586232482370
+x86_64 drag 412 98684a5469c84012
+x86_64 drag 413 5c3f6a50ec25f968
+x86_64 drag 414 f041ea64bb9c7deb
+x86_64 drag 415 5cbe600652d37abf
+x86_64 drag 416 bf0581f3f370e2b7
+x86_64 drag 417 d3c44cb0dbb3383a
+x86_64 drag 418 dd8cc786d70c76a0
+x86_64 drag 419 582285199af32693
+x86_64 drag 420 812cc89471153ca3
+x86_64 drag 421 555d01075564efde
+x86_64 drag 422 ec68d1cfb03b257e
+x86_64 drag 423 fa1a5ecf32184ae9
+x86_64 drag 424 57a058b3ebfeb614
+x86_64 drag 425 986fe689256e6872
+x86_64 drag 426 e096cf13d3884856
+x86_64 drag 427 fdd358918c3679e5
+x86_64 drag 428 3b82d914c08b434a
+x86_64 drag 429 bf6fcf4891d2d3fe
+x86_64 drag 430 77cf56641addf648
+x86_64 drag 431 3e0a59244d2c4793
+x86_64 drag 432 adea336f57d88f24
+x86_64 drag 433 fd6d1e03482701f9
+x86_64 drag 434 6e3460dc2bdba5ed
+x86_64 drag 435 5ecc9eb8978e576e
+x86_64 drag 436 e0f6db9f59e242b8
+x86_64 drag 437 cbe410d46ab74459
+x86_64 drag 438 6b56c5a29b4cbea1
+x86_64 drag 439 11970554708ff04f
+x86_64 drag 440 44dad9f879a19f04
+x86_64 drag 441 117b3e2edd1f8c41
+x86_64 drag 442 23412fab765a329c
+x86_64 drag 443 8bd6614296ee7f82
+x86_64 drag 444 ee93fc1d94d1b8cb
+x86_64 drag 445 dcfdbae79c480477
+x86_64 drag 446 cf1dc2c3b3eb2523
+x86_64 drag 447 fcb76ffa1a2723e3
+x86_64 drag 448 204f0ba555b22eff
+x86_64 drag 449 0c121ac028a111cc
+x86_64 drag 450 9f0de654847fc1c4
+x86_64 drag 451 fe1c430b25303c42
+x86_64 drag 452 e9db12d92e1f42f3
+x86_64 drag 453 19dd1fc1da4fcc2b
+x86_64 drag 454 f8818b05febaf7d1
+x86_64 drag 455 85d4d59bb03cf8b5
+x86_64 drag 456 f296e5d7f383d83c
+x86_64 drag 457 2c2cad1f0b23b477
+x86_64 drag 458 6542802dad00165c
+x86_64 drag 459 83fbc9cdd3f7305f
+x86_64 drag 460 ac83462dca7f0826
+x86_64 drag 461 5f85d44063593291
+x86_64 drag 462 aa70296acfe45cef
+x86_64 drag 463 332f971e3e257a12
+x86_64 drag 464 ddcb4f0a6228428f
+x86_64 drag 465 0a4dcda63c3b4081
+x86_64 drag 466 f9cbd62be5a235cd
+x86_64 drag 467 9ba7b7566f920275
+x86_64 drag 468 2ea85fb730905b53
+x86_64 drag 469 e4d4822faa252c9f
+x86_64 drag 470 72ec68fd84f083bc
+x86_64 drag 471 14e5908b9df5614c
+x86_64 drag 472 61256c192addbc9a
+x86_64 drag 473 94f99607aba006f8
+x86_64 drag 474 72fe96a611ba3119
+x86_64 drag 475 b6bd97b3faaf5aa4
+x86_64 drag 476 00b2af60ce6741cb
+x86_64 drag 477 ae051bd96756d5e5
+x86_64 drag 478 48a3ae5c709d05e5
+x86_64 drag 479 d6ae055218a608fb
+x86_64 drag 480 bd2a45b6225160ae
+x86_64 text 0 4aceedc23ab08101
+x86_64 text 1 d34fb0ef6530a3ee
+x86_64 text 2 f728696f56cfcff9
+x86_64 text 3 1ee082d8121faa1e
+x86_64 text 4 a1bb963ead7b22f5
+x86_64 text 5 8cbe73d1cfbe56f5
+x86_64 text 6 852ec3edd5c3938d
+x86_64 text 7 537ce0a6d1093451
+x86_64 text 8 22e151ccbf866e6d
+x86_64 text 9 e85b848a40169585
+x86_64 text 10 1aeee0c36b0c8b39
+x86_64 text 11 963d71288b755b4f
+x86_64 text 12 2aa92a884ccb1291
+x86_64 text 13 502d3e3645796f85
+x86_64 text 14 f0930152085af80e
+x86_64 text 15 e9c8d22044022bc0
+x86_64 text 16 f3e431d1649076ef
+x86_64 text 17 dcbf061f2d0b704f
+x86_64 text 18 6ab66516565c815a
+x86_64 text 19 02cead94f78911fc
+x86_64 text 20 a4036d9ac6e6386e
+x86_64 text 21 13d461e032332a1b
+x86_64 text 22 3f1a8bedec32dd86
+x86_64 text 23 244dedde43b7546d
+x86_64 text 24 848930ed66c541ce
+x86_64 text 25 1099381f0b0ce362
+x86_64 text 26 d8894eb9a79aaf08
+x86_64 text 27 8ea83253cf7a4a61
+x86_64 text 28 082b3b454ade5189
+x86_64 text 29 93f9410e74163ab1
+x86_64 text 30 03e0015c8e01a8d5
+x86_64 text 31 098615442b38b579
+x86_64 text 32 fd53d5f0d437e2de
+x86_64 text 33 a0bfd7e0996664ae
+x86_64 text 34 ee1a00b286133de3
+x86_64 text 35 f4546f1613f843e4
+x86_64 text 36 d1c63d9fb521a54a
+x86_64 text 37 504e39e31eafb3a5
+x86_64 text 38 619a4c7f995d48cc
+x86_64 text 39 d202307af633e30f
+x86_64 text 40 8bde48e05f98c7ec
+x86_64 text 41 3be54532a7467070
+x86_64 text 42 d762007658f6db21
+x86_64 text 43 683583dd6780afa5
+x86_64 text 44 63f29707cda41569
+x86_64 text 45 ce8549f38c494cd3
+x86_64 text 46 f02792f95ec3faca
+x86_64 text 47 adb0af8b3b3269ed
+x86_64 text 48 2eeb22bb91365abc
+x86_64 text 49 74193d8248189077
+x86_64 text 50 e05713e8cdf6bb0d
+x86_64 text 51 bc621a283ad4d85b
+x86_64 text 52 f80e981af8e57288
+x86_64 text 53 77eb009f74c03608
+x86_64 text 54 b6e42f0d9b7cb998
+x86_64 text 55 e6c4a47a81d90e83
+x86_64 text 56 974726b37f1df7a6
+x86_64 text 57 1c9243893d09ce0c
+x86_64 text 58 a7150239848fbe0a
+x86_64 text 59 582285199af32693
+x86_64 text 60 d57bfe67c3133e4f
+x86_64 child 0 806504ab5e919d55
+x86_64 child 1 1213595f1e6ae33a
+x86_64 child 2 11bcace786959715
+x86_64 child 3 8ec5ce50ad292746
+x86_64 child 4 ba96bd70a1458a1d
+x86_64 child 5 82c2f6bb33e2bfa5
+x86_64 child 6 17687928203a21cd
+x86_64 child 7 a4c834368d4c32bb
+x86_64 child 8 38ae625a6b4327a3
+x86_64 child 9 2988bf72b14afdcb
+x86_64 child 10 2f0870ec6ce20bb7
+x86_64 child 11 e539bc1c7e878d39
+x86_64 child 12 887a9294503ede3b
+x86_64 child 13 f61ac6fd9e5cdf83
+x86_64 child 14 d11093d6e6df04d4
+x86_64 child 15 098a76dcde66d46a
+x86_64 child 16 dccae17cde33b8d9
+x86_64 child 17 148b6fc6ed067595
+x86_64 child 18 819fd1ce309bbd90
+x86_64 child 19 35f5e67ad7c378fe
+x86_64 child 20 3f034d1c46f536d4
+x86_64 child 21 76027499db145229
+x86_64 child 22 cdf9b311cffe75f6
+x86_64 child 23 21593fb992556a7d
+x86_64 child 24 4260cacbfc19cc7e
+x86_64 child 25 15c8b6b75a9202ea
+x86_64 child 26 90b2f3767f010590
+x86_64 child 27 f33e16247af352e9
+x86_64 child 28 5ab2c993aeed3db1
+x86_64 child 29 118bebfa1e532641
+x86_64 child 30 952859b53ec3c9a5
+x86_64 child 31 28a8dc2994c9abc9
+x86_64 child 32 f46a9b51e274cb76
+x86_64 child 33 d4e31fb0551234d6
+x86_64 child 34 1e6a1fb7b38e8b8b
+x86_64 child 35 4b25d1eebd254774
+x86_64 child 36 572a4d804570327a
+x86_64 child 37 0a9708840665fa3f
+x86_64 child 38 e0ea0dcbbd3febe2
+x86_64 child 39 d0165d231455140d
+x86_64 child 40 d23db5a634625d62
+x86_64 child 41 df5faaafe42f4096
+x86_64 child 42 76bb9516b21ffed3
+x86_64 child 43 32d1e4908106b57f
+x86_64 child 44 a187401c43e4d9a3
+x86_64 child 45 a6cdf9e8ecf16835
+x86_64 child 46 59c14dcf2e3510d0
+x86_64 child 47 f973e05526656d67
+x86_64 child 48 50b059962c78f26e
+x86_64 child 49 bb814ae9bb22e26d
+x86_64 child 50 cdba7fbc8e2e0707
+x86_64 child 51 994f0ad8ba467699
+x86_64 child 52 86581cd9c4df38f0
+x86_64 child 53 6807fe9e38c54168
+x86_64 child 54 529416cc55444798
+x86_64 child 55 195f7c63d9b9157b
+x86_64 child 56 805ad8abe838ac26
+x86_64 child 57 15258ac1bc2a405c
+x86_64 child 58 2d81aafe2532a27a
+x86_64 child 59 966e8a005c9dc5c3
+x86_64 child 60 272798c755017c5f
+x86_64 term 0 98f247d81f5d58a8
+x86_64 term 1 bce70fe60ba57e75
+x86_64 term 2 5f48490192f7dcfc
+x86_64 term 3 c1506bedf8832d6d
+x86_64 term 4 8880a96ebb59520e
+x86_64 term 5 a5df42f071911a6f
+x86_64 term 6 88ef9c3d1cefbe66
+x86_64 term 7 dbe0443311c1ef2f
+x86_64 term 8 bd56ab1c43d0e2a2
+x86_64 term 9 327e72cc210382a2
+x86_64 term 10 b7550133476ac048
+x86_64 term 11 a49ddd522b538a64
+x86_64 term 12 9e59768457ceb352
+x86_64 term 13 ff6296b65a2fcbe9
+x86_64 term 14 fc7e6681a84b23de
+x86_64 term 15 f76db6c7d7c5d38b
+x86_64 term 16 90f22f8f774ebcaa
+x86_64 term 17 71a504b5732a06a7
+x86_64 term 18 7be04e564d62ef5d
+x86_64 term 19 a93a08ba6f0370c6
+x86_64 term 20 84e3f0b92fe30126
+x86_64 term 21 4a124ca893da8f52
+x86_64 term 22 7981d275daec01af
+x86_64 term 23 e116cef36981e4c8
+x86_64 term 24 4bf4d85f9e5098a2
+x86_64 term 25 25f39048558ce687
+x86_64 term 26 f87b57a52349bea7
+x86_64 term 27 8f7f3d47a6fd5972
+x86_64 term 28 6328ef202b84add7
+x86_64 term 29 2496123a0f563114
+x86_64 term 30 fa9cfd6506608de1
+x86_64 term 31 2cbf267d3342d827
+x86_64 term 32 22a30e40f450b65b
+x86_64 term 33 cd5d23c75842f4b1
+x86_64 term 34 eb53de5b69451003
+x86_64 term 35 51aa9e41d9d70adc
+x86_64 term 36 82abb7cb4e63ace6
+x86_64 term 37 2ef28e5bce6e2486
+x86_64 term 38 415bc416fda57eb8
+x86_64 term 39 fffc5866fb37e7d7
+x86_64 term 40 abdba756a432994c
+x86_64 term 41 a5bd1d9b3a3c7bea
+x86_64 term 42 7b82133d9b164c43
+x86_64 term 43 79197d990942a16c
+x86_64 term 44 2652c87d023df778
+x86_64 term 45 2215ee245421fabf
+x86_64 term 46 197644c0a0e94284
+x86_64 term 47 94544469126ac09f
+x86_64 term 48 929f23725e98ae82
+x86_64 term 49 5b07295e1dd41902
+x86_64 term 50 b073f16f521bf71b
+x86_64 term 51 0f8d342329df2fe6
+x86_64 term 52 04f52913a402f6b7
+x86_64 term 53 1131a8febe8a223f
+x86_64 term 54 0833ce2a4fd84b5a
+x86_64 term 55 ad7548f56bd58e24
+x86_64 term 56 a3b732f3faec244d
+x86_64 term 57 af70603fd75333c2
+x86_64 term 58 8da778af376bbdc8
+x86_64 term 59 608cf68a9d220ea9
+x86_64 term 60 ee92ce77a8fb3a9b
+x86_64 edge 0 697cdefe0bda9d6c
+x86_64 edge 1 ea17ef32ff35ff8b
+x86_64 edge 2 e140310164738763
+x86_64 edge 3 c9bea621d855a5b8
+x86_64 edge 4 1fb002e2fa99a442
+x86_64 edge 5 3f88eef887d86912
+x86_64 edge 6 a4845c9831492445
+x86_64 edge 7 897a17162c028f25
+x86_64 edge 8 473176feb26efa16
+x86_64 edge 9 e954025b6b71a661
+x86_64 edge 10 5fd85fb7b0c15fa1
+x86_64 edge 11 ef78d4a10fc4d5d2
+x86_64 edge 12 c5323e8139ce87fe
+x86_64 edge 13 5f5948e1093cdd5d
+x86_64 edge 14 c5fc3ad33b0c3b30
+x86_64 edge 15 da29fbd6707ec884
+x86_64 edge 16 42354cd70f5b9587
+x86_64 edge 17 ed956a4419b82caa
+x86_64 edge 18 3511d26514df08d6
+x86_64 edge 19 61fff332724c26a4
+x86_64 edge 20 36bc9aa2f12b95bc
+x86_64 edge 21 03f2485c76076b75
+x86_64 edge 22 79eafeccd23d7aef
+x86_64 edge 23 842c38fef9d1ed6c
+x86_64 edge 24 47bcb5c93a7398b6
+x86_64 edge 25 5bde59cd23d6ca1a
+x86_64 edge 26 35fd2f2e64777de5
+x86_64 edge 27 cc9968e4adb304b7
+x86_64 edge 28 9930a0a4efad98b9
+x86_64 edge 29 98587fdb51c0090d
+x86_64 edge 30 576a488bb6401aae
+x86_64 edge 31 aba6da6eba0c3bb7
+x86_64 edge 32 1572939f4be97a55
+x86_64 edge 33 9099c4284f5a0360
+x86_64 edge 34 c38915e6e1d7e09d
+x86_64 edge 35 d58bd95ce0cfac31
+x86_64 edge 36 d77394f076e5679c
+x86_64 edge 37 c0f7e31ca81ec2e8
+x86_64 edge 38 6cdd5799d151f80f
+x86_64 edge 39 924ee0b69038cb62
+x86_64 edge 40 8c9090ae4a8846d5
+x86_64 edge 41 39f575b8900bc6fd
+x86_64 edge 42 4fb4a234f0654433
+x86_64 edge 43 564cdbe5dea80d13
+x86_64 edge 44 f5d51899269a820f
+x86_64 edge 45 eff248ab9b3ce81b
+x86_64 edge 46 872470ba1519f008
+x86_64 edge 47 3ddb33af62c46fd7
+x86_64 edge 48 e52d4a5652ea5622
+x86_64 edge 49 b325df8704212063
+x86_64 edge 50 1a7a68fd672121f8
+x86_64 edge 51 589577fdbc91d4e9
+x86_64 edge 52 759d6f5a34d83f7e
+x86_64 edge 53 e4ff15cfbf945e87
+x86_64 edge 54 6a92305c6aeacf4b
+x86_64 edge 55 bb7c2379c2444154
+x86_64 edge 56 e88de45be242bfcb
+x86_64 edge 57 406eac01704df7ab
+x86_64 edge 58 edaa2dd8b5019fd4
+x86_64 edge 59 126ee14e877dd553
+x86_64 edge 60 6c285a9ccaeb404f
diff --git a/server/tests/drag_golden_gpu.txt b/server/tests/drag_golden_gpu.txt
new file mode 100644
index 0000000..1ca053b
--- /dev/null
+++ b/server/tests/drag_golden_gpu.txt
@@ -0,0 +1,728 @@
+# engine-test test_drag_exact, gpu path: FNV-1a hash of every frame of the dragged window.
+# Written by `make drag-golden` on the code before the drag-frame optimizations
+# (001633b); later code must give the same pixels. Lines: architecture, run, frame, hash.
+x86_64 drag 0 16b358d6ecdc9df7
+x86_64 drag 1 f1235995ebdc856e
+x86_64 drag 2 9922ce18b760bce2
+x86_64 drag 3 38f4b86c325362e3
+x86_64 drag 4 9bdd124080c9bac7
+x86_64 drag 5 92d1eb2c7410f783
+x86_64 drag 6 8f5a5d36aef7efe4
+x86_64 drag 7 04631c5e4fdab504
+x86_64 drag 8 bd313bd6931a623c
+x86_64 drag 9 bca644175f2a4657
+x86_64 drag 10 59f766354d7ff86c
+x86_64 drag 11 8c8efda6ed18e08a
+x86_64 drag 12 e11b3016822687fe
+x86_64 drag 13 c57618b394eddbca
+x86_64 drag 14 4268fc8abcc5279b
+x86_64 drag 15 f5b1726820511b21
+x86_64 drag 16 32411ee6566fa734
+x86_64 drag 17 8f3cab04168f65a3
+x86_64 drag 18 2cca49ddadfb10c2
+x86_64 drag 19 2476aa2ed55d7099
+x86_64 drag 20 2d1bb397933e7fa6
+x86_64 drag 21 1abb0d872cbd4104
+x86_64 drag 22 ef050034b3c7e64e
+x86_64 drag 23 c65fe68238b30d65
+x86_64 drag 24 33fa97f115f8830c
+x86_64 drag 25 617b7ac071647ba7
+x86_64 drag 26 591a6c46af6c21f6
+x86_64 drag 27 ec4d6c3c27b3fff6
+x86_64 drag 28 e874ecec6ebab6c1
+x86_64 drag 29 230acc311e2fb510
+x86_64 drag 30 b402c9e0ac4ad5a8
+x86_64 drag 31 7e99e9dcc074e9e1
+x86_64 drag 32 cae6af7902f4140f
+x86_64 drag 33 881bea324c598698
+x86_64 drag 34 84d835dc72ef207d
+x86_64 drag 35 e3b0f896dc27081b
+x86_64 drag 36 ed1d4e370921a2b6
+x86_64 drag 37 b66b498309f98525
+x86_64 drag 38 b3154ff7c706cac0
+x86_64 drag 39 718efde85431cf3b
+x86_64 drag 40 409cea13de8db278
+x86_64 drag 41 2ba3f71ba3dedf05
+x86_64 drag 42 30b1e2331a99c0aa
+x86_64 drag 43 102bd057386bc23e
+x86_64 drag 44 2c5dc71ddd079e45
+x86_64 drag 45 2a061536d0eb693c
+x86_64 drag 46 ed1cf4a7bd2c706b
+x86_64 drag 47 4f74bfc995017029
+x86_64 drag 48 389bc24535552ec0
+x86_64 drag 49 8f453656516a7f91
+x86_64 drag 50 fdfda193e1907f37
+x86_64 drag 51 15ea51bb6971bf32
+x86_64 drag 52 e1357862bb348f16
+x86_64 drag 53 72b9e2cf3671e46d
+x86_64 drag 54 c8c65a5706373632
+x86_64 drag 55 28c7c39223192eef
+x86_64 drag 56 eb75e9776675cc35
+x86_64 drag 57 631a887a3625b095
+x86_64 drag 58 f562149c7f643d4c
+x86_64 drag 59 81c69e2e1ca757b3
+x86_64 drag 60 dc52183fe2be6c93
+x86_64 drag 61 a5ea04d6f2c5940a
+x86_64 drag 62 280aff30b70de715
+x86_64 drag 63 5bea8063ced00b18
+x86_64 drag 64 8f5ceb412cddc04f
+x86_64 drag 65 50bb2fc0709242f0
+x86_64 drag 66 fbc9b40622116ebf
+x86_64 drag 67 345f16a27bf4612e
+x86_64 drag 68 60324926433dbbf2
+x86_64 drag 69 342c70a9fcc9f103
+x86_64 drag 70 7ec6f038b6cc6b2e
+x86_64 drag 71 d9974a44a54126af
+x86_64 drag 72 57035226524b2f33
+x86_64 drag 73 223addd9ed94b3b0
+x86_64 drag 74 2ceb0b033a05161b
+x86_64 drag 75 86e40c2646041f64
+x86_64 drag 76 60411988cbe89e39
+x86_64 drag 77 db813f27c59a3f6f
+x86_64 drag 78 6e737b26cf1c9367
+x86_64 drag 79 5977b1c17000295c
+x86_64 drag 80 a6dae16fa5621c32
+x86_64 drag 81 93c3815f44f562ef
+x86_64 drag 82 c29bbd2f36d4e614
+x86_64 drag 83 142b93de8ea5f5d8
+x86_64 drag 84 6793dca1f936a13e
+x86_64 drag 85 bb14cd1500b3495e
+x86_64 drag 86 9a1fe11abb9aaea3
+x86_64 drag 87 1ddd654d0acd2764
+x86_64 drag 88 76048073d00bc93f
+x86_64 drag 89 189f24ff2d029847
+x86_64 drag 90 4d38038cba73f395
+x86_64 drag 91 13518edaeed4b7cc
+x86_64 drag 92 613fa2fb3ce87e1a
+x86_64 drag 93 9e551f62f81381a1
+x86_64 drag 94 329eed4c0b5278e5
+x86_64 drag 95 3138fd63f833f538
+x86_64 drag 96 f1cad6cc03bbbc7f
+x86_64 drag 97 5844c0e1d675280c
+x86_64 drag 98 9b0d355a1628a6dd
+x86_64 drag 99 d1050eb710bc6cb2
+x86_64 drag 100 fc0d384ee80f4e64
+x86_64 drag 101 e23e9cbd716ba50f
+x86_64 drag 102 3c589d46ed3f5ffd
+x86_64 drag 103 66bf0d547175d687
+x86_64 drag 104 c729616a5e184fee
+x86_64 drag 105 7a8cac40ca477220
+x86_64 drag 106 8eb6fe1ccaf61f70
+x86_64 drag 107 885cdab050c5d351
+x86_64 drag 108 a80e2ba0ffe078f4
+x86_64 drag 109 6a867dafdeed1f8f
+x86_64 drag 110 0e3f49723aec3197
+x86_64 drag 111 a00cafbc5289bf4e
+x86_64 drag 112 4e0f87990fb93710
+x86_64 drag 113 7339be6fb08df220
+x86_64 drag 114 221ed8e3d29e2729
+x86_64 drag 115 1b8561e52753b105
+x86_64 drag 116 1658b1a4beb763fc
+x86_64 drag 117 8e1499e60dc3c262
+x86_64 drag 118 3bb25b103ffd2b83
+x86_64 drag 119 0866df8b23d73234
+x86_64 drag 120 2f5ffde18edbc2ff
+x86_64 drag 121 bb00284786d7e6df
+x86_64 drag 122 611e7016e11c2e12
+x86_64 drag 123 d03fc8b6facf7b9d
+x86_64 drag 124 ebdb0077b3d0a843
+x86_64 drag 125 452db99d562a8a05
+x86_64 drag 126 b39512d30c0d5539
+x86_64 drag 127 3413e59034553d52
+x86_64 drag 128 63f86472c1581b28
+x86_64 drag 129 76218430025daeb1
+x86_64 drag 130 358387f1774833a1
+x86_64 drag 131 871d20b141631376
+x86_64 drag 132 858b8e6c375f5dea
+x86_64 drag 133 27e05679fe0dfafa
+x86_64 drag 134 cf0e1c1b32d7359a
+x86_64 drag 135 7b6fa59322b307f8
+x86_64 drag 136 a79bf33e34fe5735
+x86_64 drag 137 c08b24b50e5a130a
+x86_64 drag 138 b774f12f0a9dc108
+x86_64 drag 139 3e0edce84e02dddd
+x86_64 drag 140 962ef62741c82c5b
+x86_64 drag 141 1ba0c0f817d0033c
+x86_64 drag 142 91c626d35820aa5a
+x86_64 drag 143 95dc8d4682f2266c
+x86_64 drag 144 ab4c63df66517490
+x86_64 drag 145 b6b950720192fcf1
+x86_64 drag 146 dc60e54398aa3cfb
+x86_64 drag 147 f5db9c7cd108e08f
+x86_64 drag 148 5b884714eb4b04dd
+x86_64 drag 149 afc481eff6e45f56
+x86_64 drag 150 194a89f17aa101ed
+x86_64 drag 151 295fbfd32527eb91
+x86_64 drag 152 822152972865f1a6
+x86_64 drag 153 ba031259c7f2d8a8
+x86_64 drag 154 f7d2d8423ddc434f
+x86_64 drag 155 009cfe514ce22246
+x86_64 drag 156 9813802795f53264
+x86_64 drag 157 ab2115c426471919
+x86_64 drag 158 b9a6948d1687f6eb
+x86_64 drag 159 05f8a69edcca633a
+x86_64 drag 160 851434fef595bd4e
+x86_64 drag 161 b2c1acabe2725ca7
+x86_64 drag 162 23a025daaaeb4437
+x86_64 drag 163 3eb71b96f30647ff
+x86_64 drag 164 8941488d621542f3
+x86_64 drag 165 a2a2f0f3550ec807
+x86_64 drag 166 558806307d610d67
+x86_64 drag 167 4464aa2ae29ed7ec
+x86_64 drag 168 ccc9e3b1250b8af3
+x86_64 drag 169 a745579cbb104fd0
+x86_64 drag 170 0fc9b69a9d8cbb93
+x86_64 drag 171 4a57af8044ad656e
+x86_64 drag 172 0aefb352cd76a380
+x86_64 drag 173 6bc2eb25289abd64
+x86_64 drag 174 fa9f689fb5ef1303
+x86_64 drag 175 91ef96f5c38672cd
+x86_64 drag 176 596c59e338811d2b
+x86_64 drag 177 9b96e4634c4640e3
+x86_64 drag 178 68cedfae2fd301c3
+x86_64 drag 179 5ec2a4214a816bba
+x86_64 drag 180 55588a6b2b6c6bfc
+x86_64 drag 181 1f424d6140c54b6c
+x86_64 drag 182 8f73570ae26521a6
+x86_64 drag 183 dd0c84662b61dac3
+x86_64 drag 184 bc3ae530b5d5039b
+x86_64 drag 185 eca89e305816c276
+x86_64 drag 186 3e9c17ec95cd74d8
+x86_64 drag 187 454063d061e0c743
+x86_64 drag 188 5a7bce58789223a1
+x86_64 drag 189 4d27a636cf161fee
+x86_64 drag 190 f403d3cbd7e33af9
+x86_64 drag 191 4d02dd3adbc19338
+x86_64 drag 192 d4b0793e0753c0f0
+x86_64 drag 193 41922b8548aff7e4
+x86_64 drag 194 8c83ee2dbda47359
+x86_64 drag 195 5633b490cc57ff08
+x86_64 drag 196 85647aae7a998fcc
+x86_64 drag 197 f900b99823f9915f
+x86_64 drag 198 9722b3f7957201f6
+x86_64 drag 199 22f23706a47b7922
+x86_64 drag 200 61da43697a4fc934
+x86_64 drag 201 0d6f1ad4ae58c6d5
+x86_64 drag 202 dab61031b8373eae
+x86_64 drag 203 c714d772d14f2cac
+x86_64 drag 204 e0b7c1eecdc3e99a
+x86_64 drag 205 0eb40acde46deeee
+x86_64 drag 206 0982d76ce3dd0ce0
+x86_64 drag 207 d18c2c84fe10e638
+x86_64 drag 208 3271998ff978c90e
+x86_64 drag 209 1f8a18d1f6d222e1
+x86_64 drag 210 738765a64e42f45a
+x86_64 drag 211 2be74a54d4856c4c
+x86_64 drag 212 329ffa3377b6afeb
+x86_64 drag 213 125491100adae527
+x86_64 drag 214 d64b5c84512dae04
+x86_64 drag 215 ebd058ded2db0c4b
+x86_64 drag 216 9e89fea40c444b20
+x86_64 drag 217 7b894031050e787f
+x86_64 drag 218 8aea19c0399f9d55
+x86_64 drag 219 27a6c84c394ffe89
+x86_64 drag 220 ccefd93d60e30aff
+x86_64 drag 221 4708936616249908
+x86_64 drag 222 2a7014806fef78fe
+x86_64 drag 223 19bebc4d31ba21c1
+x86_64 drag 224 78b2a8e33656a35b
+x86_64 drag 225 4e07432a14b81648
+x86_64 drag 226 f347f6b94d793d7a
+x86_64 drag 227 83b43203621d4fc5
+x86_64 drag 228 61be1cc72a6deb36
+x86_64 drag 229 5c2a950936d88f77
+x86_64 drag 230 552f07d58baeaa1b
+x86_64 drag 231 0bd14dfaf287e07e
+x86_64 drag 232 b5aa8e97960c8fff
+x86_64 drag 233 e0af9f291c03e766
+x86_64 drag 234 531455fde1566fba
+x86_64 drag 235 1f9d1d5cbd7eaba7
+x86_64 drag 236 e51f2265a648e742
+x86_64 drag 237 1dc56f9aa17f888c
+x86_64 drag 238 73e11e479c63361e
+x86_64 drag 239 b5ee11cedc91f1b9
+x86_64 drag 240 bb94c495404fddf5
+x86_64 drag 241 8ec0585d8d04a055
+x86_64 drag 242 3ec1e2e2c61b4928
+x86_64 drag 243 262ff43528b9d78e
+x86_64 drag 244 da144e669baefec3
+x86_64 drag 245 c5a6eefd5856841b
+x86_64 drag 246 2a2ee40490f54d6b
+x86_64 drag 247 b0ecb69faae735ef
+x86_64 drag 248 d709b1baa32dec7a
+x86_64 drag 249 c3db7a80f8c11b01
+x86_64 drag 250 28c10f982dc170dd
+x86_64 drag 251 fb5716da62059834
+x86_64 drag 252 728ffeb539e3ab22
+x86_64 drag 253 30ae1460d29841b8
+x86_64 drag 254 359d7232ebdfa564
+x86_64 drag 255 204eb9d428806e4a
+x86_64 drag 256 0443f82a76975c12
+x86_64 drag 257 f08b30d846083588
+x86_64 drag 258 80d918ca83edbcaf
+x86_64 drag 259 7b46dc826962d9ba
+x86_64 drag 260 f71928f84a9ce97f
+x86_64 drag 261 64c80cd4bba20a5b
+x86_64 drag 262 f7a2e56651bad27a
+x86_64 drag 263 95e50e1a612e16f2
+x86_64 drag 264 eede1321c125ac87
+x86_64 drag 265 d20b4e7979a8e3e5
+x86_64 drag 266 d9a20391ccf49b24
+x86_64 drag 267 8141e9dc2ffb3010
+x86_64 drag 268 1248c4312926b179
+x86_64 drag 269 cc7a20aad4754133
+x86_64 drag 270 a8f8c6b23088a131
+x86_64 drag 271 536af7faee5aedfa
+x86_64 drag 272 602b1daa8ccd242f
+x86_64 drag 273 26fe43b02dd53ab2
+x86_64 drag 274 7e7d7346d31ee8d1
+x86_64 drag 275 ddde7a3d70040c2b
+x86_64 drag 276 5dc9a0e731e59920
+x86_64 drag 277 1daa3e42937ca296
+x86_64 drag 278 1844b1cd00e9aaf2
+x86_64 drag 279 8fb94bebbfa555d2
+x86_64 drag 280 74053d64eb611269
+x86_64 drag 281 86a33baa96c73588
+x86_64 drag 282 5899e86570cd5511
+x86_64 drag 283 ee589b309fbb9f4d
+x86_64 drag 284 d4e6081ea6833cbd
+x86_64 drag 285 54cd903f325ddc78
+x86_64 drag 286 232fc150a70fb0aa
+x86_64 drag 287 d0d1592e12857ef4
+x86_64 drag 288 6234790c05b1dbbf
+x86_64 drag 289 e41b64a9a35fba73
+x86_64 drag 290 360e44f805dcad50
+x86_64 drag 291 00f34e9b5481ab5d
+x86_64 drag 292 98a2b1202c7232da
+x86_64 drag 293 4c785152de6478b1
+x86_64 drag 294 10e4a9ebdd8cf06f
+x86_64 drag 295 3d91fc7c3df91d2d
+x86_64 drag 296 e595e245e5d2d916
+x86_64 drag 297 6ee68edf2b6fe1e6
+x86_64 drag 298 f8fcd86c908b9887
+x86_64 drag 299 94e2f75632bc6dd3
+x86_64 drag 300 f30b9cd4176a25cf
+x86_64 drag 301 38852bd266fa414a
+x86_64 drag 302 ad31e5da90a458e7
+x86_64 drag 303 be0c83b2f2ef4c04
+x86_64 drag 304 f4f3ab74d8638d99
+x86_64 drag 305 eda70a644d08be96
+x86_64 drag 306 e7bee9a7c99d4db8
+x86_64 drag 307 0c3d13f79981f185
+x86_64 drag 308 88371f14bb6ca0ab
+x86_64 drag 309 d292c35108681e07
+x86_64 drag 310 b10eb9d865cc586c
+x86_64 drag 311 2600f50a769e1a28
+x86_64 drag 312 0624c53182c8fe90
+x86_64 drag 313 fe15807a6e3b6c54
+x86_64 drag 314 dcec48df8ea5f982
+x86_64 drag 315 704b7ed1ac8ddbbf
+x86_64 drag 316 5835a571ead2bef2
+x86_64 drag 317 445835e8c84a7de4
+x86_64 drag 318 edfda6f7b3bed298
+x86_64 drag 319 6dce4f62e4aa99bd
+x86_64 drag 320 2b7f116ffb4dfba1
+x86_64 drag 321 771f5961b7915a7a
+x86_64 drag 322 82dcec80a96d6553
+x86_64 drag 323 547df60028bc530b
+x86_64 drag 324 6f359c8e9427ecc7
+x86_64 drag 325 ae349305ca7fc0ac
+x86_64 drag 326 cb24ccb13f895c20
+x86_64 drag 327 bbcead3236ae36a4
+x86_64 drag 328 75f0efaff7be2d67
+x86_64 drag 329 0468075987bafcb2
+x86_64 drag 330 177b7d57a19b7315
+x86_64 drag 331 4f877b3671304f3f
+x86_64 drag 332 631362089d754757
+x86_64 drag 333 48bfe21e4c4801e5
+x86_64 drag 334 b97fa930dc3060e2
+x86_64 drag 335 a3960b4545562395
+x86_64 drag 336 cbbbab1059e98385
+x86_64 drag 337 77b08820839ca938
+x86_64 drag 338 5178c3538f44d5f1
+x86_64 drag 339 2115ec0cfaa390bb
+x86_64 drag 340 bd34b795da367ebf
+x86_64 drag 341 efe5211d4359e2db
+x86_64 drag 342 13473c90f7ed3141
+x86_64 drag 343 c0122a09404a32b9
+x86_64 drag 344 d129e895b441850a
+x86_64 drag 345 ebd7bf91f3baec0f
+x86_64 drag 346 3a484d4628f35163
+x86_64 drag 347 b36b9f21218c207e
+x86_64 drag 348 ff7251939b8cba2f
+x86_64 drag 349 029997bab5f0b0b6
+x86_64 drag 350 ca8bd45c8a186167
+x86_64 drag 351 4974454e917737ab
+x86_64 drag 352 559fe9ec393300fa
+x86_64 drag 353 41490117950c840c
+x86_64 drag 354 5f1a493e4fcc2f9a
+x86_64 drag 355 155c3927e79c0bd6
+x86_64 drag 356 2c67038ec64960fa
+x86_64 drag 357 314bb58884e5750d
+x86_64 drag 358 5b6129799c091121
+x86_64 drag 359 13f65e9b404eeed9
+x86_64 drag 360 55588a6b2b6c6bfc
+x86_64 drag 361 f1235995ebdc856e
+x86_64 drag 362 9922ce18b760bce2
+x86_64 drag 363 38f4b86c325362e3
+x86_64 drag 364 9bdd124080c9bac7
+x86_64 drag 365 92d1eb2c7410f783
+x86_64 drag 366 8f5a5d36aef7efe4
+x86_64 drag 367 04631c5e4fdab504
+x86_64 drag 368 bd313bd6931a623c
+x86_64 drag 369 bca644175f2a4657
+x86_64 drag 370 59f766354d7ff86c
+x86_64 drag 371 8c8efda6ed18e08a
+x86_64 drag 372 e11b3016822687fe
+x86_64 drag 373 c57618b394eddbca
+x86_64 drag 374 4268fc8abcc5279b
+x86_64 drag 375 f5b1726820511b21
+x86_64 drag 376 32411ee6566fa734
+x86_64 drag 377 8f3cab04168f65a3
+x86_64 drag 378 2cca49ddadfb10c2
+x86_64 drag 379 2476aa2ed55d7099
+x86_64 drag 380 2d1bb397933e7fa6
+x86_64 drag 381 1abb0d872cbd4104
+x86_64 drag 382 ef050034b3c7e64e
+x86_64 drag 383 c65fe68238b30d65
+x86_64 drag 384 33fa97f115f8830c
+x86_64 drag 385 617b7ac071647ba7
+x86_64 drag 386 591a6c46af6c21f6
+x86_64 drag 387 ec4d6c3c27b3fff6
+x86_64 drag 388 e874ecec6ebab6c1
+x86_64 drag 389 230acc311e2fb510
+x86_64 drag 390 b402c9e0ac4ad5a8
+x86_64 drag 391 7e99e9dcc074e9e1
+x86_64 drag 392 cae6af7902f4140f
+x86_64 drag 393 881bea324c598698
+x86_64 drag 394 84d835dc72ef207d
+x86_64 drag 395 e3b0f896dc27081b
+x86_64 drag 396 ed1d4e370921a2b6
+x86_64 drag 397 b66b498309f98525
+x86_64 drag 398 b3154ff7c706cac0
+x86_64 drag 399 718efde85431cf3b
+x86_64 drag 400 409cea13de8db278
+x86_64 drag 401 2ba3f71ba3dedf05
+x86_64 drag 402 30b1e2331a99c0aa
+x86_64 drag 403 102bd057386bc23e
+x86_64 drag 404 2c5dc71ddd079e45
+x86_64 drag 405 2a061536d0eb693c
+x86_64 drag 406 ed1cf4a7bd2c706b
+x86_64 drag 407 4f74bfc995017029
+x86_64 drag 408 389bc24535552ec0
+x86_64 drag 409 8f453656516a7f91
+x86_64 drag 410 fdfda193e1907f37
+x86_64 drag 411 15ea51bb6971bf32
+x86_64 drag 412 e1357862bb348f16
+x86_64 drag 413 72b9e2cf3671e46d
+x86_64 drag 414 c8c65a5706373632
+x86_64 drag 415 28c7c39223192eef
+x86_64 drag 416 eb75e9776675cc35
+x86_64 drag 417 631a887a3625b095
+x86_64 drag 418 f562149c7f643d4c
+x86_64 drag 419 81c69e2e1ca757b3
+x86_64 drag 420 dc52183fe2be6c93
+x86_64 drag 421 a5ea04d6f2c5940a
+x86_64 drag 422 280aff30b70de715
+x86_64 drag 423 5bea8063ced00b18
+x86_64 drag 424 8f5ceb412cddc04f
+x86_64 drag 425 50bb2fc0709242f0
+x86_64 drag 426 fbc9b40622116ebf
+x86_64 drag 427 345f16a27bf4612e
+x86_64 drag 428 60324926433dbbf2
+x86_64 drag 429 342c70a9fcc9f103
+x86_64 drag 430 7ec6f038b6cc6b2e
+x86_64 drag 431 d9974a44a54126af
+x86_64 drag 432 57035226524b2f33
+x86_64 drag 433 223addd9ed94b3b0
+x86_64 drag 434 2ceb0b033a05161b
+x86_64 drag 435 86e40c2646041f64
+x86_64 drag 436 60411988cbe89e39
+x86_64 drag 437 db813f27c59a3f6f
+x86_64 drag 438 6e737b26cf1c9367
+x86_64 drag 439 5977b1c17000295c
+x86_64 drag 440 a6dae16fa5621c32
+x86_64 drag 441 93c3815f44f562ef
+x86_64 drag 442 c29bbd2f36d4e614
+x86_64 drag 443 142b93de8ea5f5d8
+x86_64 drag 444 6793dca1f936a13e
+x86_64 drag 445 bb14cd1500b3495e
+x86_64 drag 446 9a1fe11abb9aaea3
+x86_64 drag 447 1ddd654d0acd2764
+x86_64 drag 448 76048073d00bc93f
+x86_64 drag 449 189f24ff2d029847
+x86_64 drag 450 4d38038cba73f395
+x86_64 drag 451 13518edaeed4b7cc
+x86_64 drag 452 613fa2fb3ce87e1a
+x86_64 drag 453 9e551f62f81381a1
+x86_64 drag 454 329eed4c0b5278e5
+x86_64 drag 455 3138fd63f833f538
+x86_64 drag 456 f1cad6cc03bbbc7f
+x86_64 drag 457 5844c0e1d675280c
+x86_64 drag 458 9b0d355a1628a6dd
+x86_64 drag 459 d1050eb710bc6cb2
+x86_64 drag 460 fc0d384ee80f4e64
+x86_64 drag 461 e23e9cbd716ba50f
+x86_64 drag 462 3c589d46ed3f5ffd
+x86_64 drag 463 66bf0d547175d687
+x86_64 drag 464 c729616a5e184fee
+x86_64 drag 465 7a8cac40ca477220
+x86_64 drag 466 8eb6fe1ccaf61f70
+x86_64 drag 467 885cdab050c5d351
+x86_64 drag 468 a80e2ba0ffe078f4
+x86_64 drag 469 6a867dafdeed1f8f
+x86_64 drag 470 0e3f49723aec3197
+x86_64 drag 471 a00cafbc5289bf4e
+x86_64 drag 472 4e0f87990fb93710
+x86_64 drag 473 7339be6fb08df220
+x86_64 drag 474 221ed8e3d29e2729
+x86_64 drag 475 1b8561e52753b105
+x86_64 drag 476 1658b1a4beb763fc
+x86_64 drag 477 8e1499e60dc3c262
+x86_64 drag 478 3bb25b103ffd2b83
+x86_64 drag 479 0866df8b23d73234
+x86_64 drag 480 bd2a45b6225160ae
+x86_64 text 0 4aceedc23ab08101
+x86_64 text 1 da8171dbfdda69d2
+x86_64 text 2 8ba895ea2352c716
+x86_64 text 3 b9894b9e43d23c0c
+x86_64 text 4 ef44c82adfd98df4
+x86_64 text 5 8b19e5268f3f94be
+x86_64 text 6 8e9477c036780926
+x86_64 text 7 9c4877d0f4c524eb
+x86_64 text 8 27b5f854f23dda8d
+x86_64 text 9 306d3cb52fa8a813
+x86_64 text 10 34f27012d1199e26
+x86_64 text 11 71c05f1c8e47a580
+x86_64 text 12 8544e2d35b74885b
+x86_64 text 13 c53c4a676d7a3495
+x86_64 text 14 7080017201716af9
+x86_64 text 15 7807d454d560e3fc
+x86_64 text 16 d2b5a8e4f1f26ee6
+x86_64 text 17 085ec410c984d6d4
+x86_64 text 18 c59aa7ddf2788327
+x86_64 text 19 afe2ac46feefee3e
+x86_64 text 20 669a886b28d5a073
+x86_64 text 21 02b81c6b9e9fdd73
+x86_64 text 22 25a97b8039b80673
+x86_64 text 23 0e67be9b9efdc62b
+x86_64 text 24 b9254f3b5baf9475
+x86_64 text 25 e42b01582e75b526
+x86_64 text 26 98f72884602b415d
+x86_64 text 27 294f2ff1ad785865
+x86_64 text 28 c8cb683d4400c437
+x86_64 text 29 69550a9668ec6de8
+x86_64 text 30 3e5774ccaa7d3ca6
+x86_64 text 31 a12a10b0b36d3da3
+x86_64 text 32 f56cd6b757cbd29c
+x86_64 text 33 c0eda031b72c1544
+x86_64 text 34 b12a9bf9cdad2c3e
+x86_64 text 35 f90bb13e8df55fe3
+x86_64 text 36 2337537580595473
+x86_64 text 37 854cdfcbbc7f6359
+x86_64 text 38 f633121f491eec23
+x86_64 text 39 065aa7674b074e72
+x86_64 text 40 63d7e365388366db
+x86_64 text 41 3865da19b345a4e3
+x86_64 text 42 b1b821b47fc30dad
+x86_64 text 43 7dc92dbb12ebd18d
+x86_64 text 44 111c2cd56e93423f
+x86_64 text 45 2646fd26c71841fb
+x86_64 text 46 9c28ff1b3efdd02e
+x86_64 text 47 73968622b8b7551b
+x86_64 text 48 d848b40c11cfd994
+x86_64 text 49 e7286c736988df06
+x86_64 text 50 95ac09c4415a600b
+x86_64 text 51 c42a44428f52c4e1
+x86_64 text 52 9576c92bdbe60b78
+x86_64 text 53 b3779a5b19e29515
+x86_64 text 54 55bc3f4d2bb7eef9
+x86_64 text 55 092a1b6e6a7a8913
+x86_64 text 56 32bb9cdc7609d194
+x86_64 text 57 cd7eabee178a5fff
+x86_64 text 58 10a33a1c0c2d4276
+x86_64 text 59 81c69e2e1ca757b3
+x86_64 text 60 d57bfe67c3133e4f
+x86_64 child 0 806504ab5e919d55
+x86_64 child 1 3980134b83019802
+x86_64 child 2 b566e4aeec11a79a
+x86_64 child 3 69bdb7332e19fdfc
+x86_64 child 4 57a643ec8ecdb4d4
+x86_64 child 5 a13f34bb34472b9e
+x86_64 child 6 50b0ef29cd230696
+x86_64 child 7 fdf11de4b80bdbf1
+x86_64 child 8 8d84b4e0f5077247
+x86_64 child 9 6261d55545531bad
+x86_64 child 10 4a24b4bb235c6f0c
+x86_64 child 11 b13780f4f3c4766a
+x86_64 child 12 142cf3ddc1d0beb9
+x86_64 child 13 d0021cded6b8ff43
+x86_64 child 14 811063c27b0c2ecf
+x86_64 child 15 1f1456097ccfb57e
+x86_64 child 16 8baf75bb5a5e5d10
+x86_64 child 17 b79b96d3e00576c6
+x86_64 child 18 e48d5e3376c82239
+x86_64 child 19 b5c4290d2f46ed48
+x86_64 child 20 06ba77fa379eb445
+x86_64 child 21 eb28b759868a4fed
+x86_64 child 22 9bae0cd83d4fd683
+x86_64 child 23 85ccda0a24ec12cb
+x86_64 child 24 e672f4253553f465
+x86_64 child 25 445626b9bb412796
+x86_64 child 26 ade6a5825511664d
+x86_64 child 27 6e9b106671f1bd35
+x86_64 child 28 6c8dda22daa977a7
+x86_64 child 29 bc3819cd8ae9a778
+x86_64 child 30 55cdfd2185ecbc06
+x86_64 child 31 593876b1592e7e93
+x86_64 child 32 e0830a46bfec740c
+x86_64 child 33 fa12892d84647b14
+x86_64 child 34 8b7a781d0e49f6ce
+x86_64 child 35 9465da3403f2fa23
+x86_64 child 36 2586874ce8859a23
+x86_64 child 37 fe10440554ed2aab
+x86_64 child 38 9ba83e65e3a555d5
+x86_64 child 39 07e3e27bd3373194
+x86_64 child 40 3787fecb50a3d979
+x86_64 child 41 ff05c0b677abe545
+x86_64 child 42 cf202383a3da6297
+x86_64 child 43 5af3f49edeabca37
+x86_64 child 44 4697039a11137575
+x86_64 child 45 f15e1f73f838d231
+x86_64 child 46 e41ceb251a76df14
+x86_64 child 47 c10d3f0f6f4eebc5
+x86_64 child 48 b9981ac9880be8da
+x86_64 child 49 2cfea1b3fd2dffac
+x86_64 child 50 bb9c86c61514285d
+x86_64 child 51 d1ee382a180cd2bf
+x86_64 child 52 02068fab670f5618
+x86_64 child 53 29aa9e885e1cbe0d
+x86_64 child 54 3b1363ec23ab7b59
+x86_64 child 55 47322ddb4484ed13
+x86_64 child 56 9acba70afb0b3314
+x86_64 child 57 1f91772bca40235f
+x86_64 child 58 ce4bc500776fbe4e
+x86_64 child 59 33d08f8466973fab
+x86_64 child 60 272798c755017c5f
+x86_64 term 0 98f247d81f5d58a8
+x86_64 term 1 815357ad64a2c895
+x86_64 term 2 e89952d1ad238397
+x86_64 term 3 90bb69ea5762e432
+x86_64 term 4 a6de7d0cf53709bd
+x86_64 term 5 7a20a0516ee27864
+x86_64 term 6 590e0e19bd3fb16d
+x86_64 term 7 dd33a17e6c257606
+x86_64 term 8 3cff5659205b1082
+x86_64 term 9 ac984ff6827d89d4
+x86_64 term 10 6e8c31c44ab573a7
+x86_64 term 11 672dae4c348051c1
+x86_64 term 12 be31353d51d7a0ec
+x86_64 term 13 a7774b809c55f699
+x86_64 term 14 f471814e15949a5d
+x86_64 term 15 d26c18a769160985
+x86_64 term 16 75022c879be62f7f
+x86_64 term 17 1fe901bf1301e260
+x86_64 term 18 2d0253a7efa54f39
+x86_64 term 19 5834d337547765e4
+x86_64 term 20 18d82e061723258b
+x86_64 term 21 55541b2c9d41c56e
+x86_64 term 22 5cdb2c79885951ba
+x86_64 term 23 9a6f4c7975da0f56
+x86_64 term 24 9a8b4b3c63ba9885
+x86_64 term 25 d3a94c4a185a529e
+x86_64 term 26 5d5bf75e92f5ce31
+x86_64 term 27 a8e8870307fbb666
+x86_64 term 28 fa9125adc215468b
+x86_64 term 29 2333a2f34ba7a834
+x86_64 term 30 dc14214bd8fd5e34
+x86_64 term 31 171b463ec67ac782
+x86_64 term 32 278bee9ae9c86cd9
+x86_64 term 33 18a5d1ea5fb7e099
+x86_64 term 34 6738ee9831ee9cc6
+x86_64 term 35 e19fcd7014f1a2fc
+x86_64 term 36 44dda11d49eaa60b
+x86_64 term 37 13fbc335498abbc2
+x86_64 term 38 2e96f23ddc14a3b8
+x86_64 term 39 dbc6f000cb738797
+x86_64 term 40 05ecf3de7b3b44f7
+x86_64 term 41 f06d590978d96e39
+x86_64 term 42 48af0add29946a80
+x86_64 term 43 4bc478ea8e46de0f
+x86_64 term 44 b3ce09d0ed581c8e
+x86_64 term 45 686055e4877b1ca0
+x86_64 term 46 0012313b60f3f70d
+x86_64 term 47 53aea4611c762867
+x86_64 term 48 c4528ea3fd070a76
+x86_64 term 49 56b6e98b4d2c95ea
+x86_64 term 50 8728aef1bc7757a1
+x86_64 term 51 dee28fffef99091c
+x86_64 term 52 b106cda27c89c220
+x86_64 term 53 d8b1df8e35304323
+x86_64 term 54 508487494e936343
+x86_64 term 55 e2f563c1387db518
+x86_64 term 56 34a60b77acd1ba5d
+x86_64 term 57 87a7ba66ce95f8a6
+x86_64 term 58 97c1bdb44f8dd69c
+x86_64 term 59 98a11a4fd94e117f
+x86_64 term 60 ee92ce77a8fb3a9b
+x86_64 edge 0 697cdefe0bda9d6c
+x86_64 edge 1 eeb94bc2b849b8b7
+x86_64 edge 2 68188d118e520890
+x86_64 edge 3 7de37e5d24811d86
+x86_64 edge 4 955087028b72176b
+x86_64 edge 5 0623f57565861ec1
+x86_64 edge 6 60dd9f3740faa572
+x86_64 edge 7 c8c4bfa638b861bf
+x86_64 edge 8 814d3f8e33e01b86
+x86_64 edge 9 d63ee9d68c3dbb27
+x86_64 edge 10 1763b2421d8c9412
+x86_64 edge 11 3045cbe1b2304d6d
+x86_64 edge 12 02c78bdc40d80078
+x86_64 edge 13 84891e6c20074949
+x86_64 edge 14 c10a29556aff76d7
+x86_64 edge 15 7561d37ca5ad0fb8
+x86_64 edge 16 db90f6fa6c2325fa
+x86_64 edge 17 ed336fce4a66fe4d
+x86_64 edge 18 d66667e0fb0dd88f
+x86_64 edge 19 8033c8a72c28a772
+x86_64 edge 20 e77d547bfd44de31
+x86_64 edge 21 f156c4a9a86c6101
+x86_64 edge 22 52d23ef3eebef2a2
+x86_64 edge 23 321fd5a040e081b6
+x86_64 edge 24 aae7c75982122015
+x86_64 edge 25 da852cf73a1aa7ae
+x86_64 edge 26 106cd05d6b9b8280
+x86_64 edge 27 26594373b51dadbb
+x86_64 edge 28 8643764709e40dd3
+x86_64 edge 29 b66a9f16549a8448
+x86_64 edge 30 d16a4cdd2e2515c5
+x86_64 edge 31 f0ed999830a6171d
+x86_64 edge 32 222d6fed5144d9af
+x86_64 edge 33 20771a1dd94c8792
+x86_64 edge 34 a94307e4a9a0e300
+x86_64 edge 35 c81f15ca0e892efe
+x86_64 edge 36 854369cd6cd854ed
+x86_64 edge 37 6f30d54e317bcc64
+x86_64 edge 38 7fcfcdcf9beb18c4
+x86_64 edge 39 bc7112e279273af7
+x86_64 edge 40 2a770f7799f66e4a
+x86_64 edge 41 64db4dd2378abebe
+x86_64 edge 42 29e1f96c3512a5d3
+x86_64 edge 43 7d3faf233183f1c3
+x86_64 edge 44 42ca658895ad8ab5
+x86_64 edge 45 e4d1d380bf4f23eb
+x86_64 edge 46 25516c867f51f278
+x86_64 edge 47 3a9f06ef6663fb09
+x86_64 edge 48 b04fe7cddc8fc442
+x86_64 edge 49 7d59bd2cda2c3bb6
+x86_64 edge 50 55b277f16a5cc8aa
+x86_64 edge 51 a659dd2b1024c2ff
+x86_64 edge 52 6498f7a8904ae1e6
+x86_64 edge 53 b3ffa54166e0327a
+x86_64 edge 54 67cea588d5fe24f6
+x86_64 edge 55 e4833ee2b558b090
+x86_64 edge 56 238fd7dc05e02be5
+x86_64 edge 57 514a035729871488
+x86_64 edge 58 66e640ed2d45bf24
+x86_64 edge 59 3ada2bae9396781b
+x86_64 edge 60 6c285a9ccaeb404f
diff --git a/server/tests/engine_test.c b/server/tests/engine_test.c
index 0af964e..110a064 100644
--- a/server/tests/engine_test.c
+++ b/server/tests/engine_test.c
@@ -5,6 +5,7 @@
* media and GPU hooks of paint.c are stubbed out.
* build/engine-test runs the tests
* build/engine-test bench times layout and paint of a 2000-row list and a window drag
+ * make drag-golden writes test_drag_exact's golden hashes (only on the reference code)
* Fallback fonts are looked up as in LordOS (DejaVu Sans covers Arabic and Hebrew in the build
* container); the checks don't depend on which font draws a script. */
#include <math.h>
@@ -13,12 +14,26 @@
#include <string.h>
#include <time.h>
+#include "bench/lbinput.h"
+#include "outputs.h"
#include "ui/fonts.h"
#include "ui/ui.h"
#include "ui/unicode.h"
/* ---- stubs for what paint.c reaches outside the UI engine ---- */
-void term_paint(Canvas *c, int id, float x, float y, float w, float h, float op) { (void)c; (void)id; (void)x; (void)y; (void)w; (void)h; (void)op; }
+/* the terminal (test_drag_exact): a dark box with a cursor block; where it was painted is noted in
+ * logical px, as term_paint.c notes s->gx… for term_damage */
+static int term_cursor;
+static Box term_at;
+void term_paint(Canvas *c, int id, float x, float y, float w, float h, float op) {
+ (void)id;
+ const float k = paint_view.k;
+ uint32_t a = (uint32_t)(op * 255 + 0.5f) << 24;
+ canvas_rrect(c, x, y, w, h, 0, a | 0x101014);
+ if (term_cursor) canvas_rrect(c, x + 8 * k, y + 8 * k, 9 * k, 16 * k, 0, a | 0xd0d0d0);
+ float lx = (x - paint_view.dx) / k + paint_view.x, ly = (y - paint_view.dy) / k + paint_view.y;
+ term_at = (Box){ lx, ly, lx + w / k, ly + h / k };
+}
void wl_paint(Canvas *c, int id, int node, float x, float y, float w, float h, float op) { (void)c; (void)id; (void)node; (void)x; (void)y; (void)w; (void)h; (void)op; }
void wl_paint_holes(int on) { (void)on; }
void wl_paint_kept(void) {}
@@ -27,11 +42,14 @@ void wl_paint_begin(void) {}
void wl_paint_popups(Canvas *c) { (void)c; }
void media_paint(Canvas *c, int id, int node, float x, float y, float w, float h, float r, float op) { (void)c; (void)id; (void)node; (void)x; (void)y; (void)w; (void)h; (void)r; (void)op; }
int media_cover_node(float x0, float y0, float x1, float y1) { (void)x0; (void)y0; (void)x1; (void)y1; return 0; }
-int gpu_active(void) { return 0; }
+static int test_gpu; /* test_drag_exact: paint.c's GPU path on the same canvas */
+int gpu_active(void) { return test_gpu; }
+void lbf_input(uint64_t ev_ns) { (void)ev_ns; } /* bench/lbinput.c: only lbi_path is used */
void paint_layer_begin(int node, int resize);
void paint_layer_end(void);
void paint_layer_stats(long *renders, long *blits);
+long paint_layer_parts(void);
void paint_tf_stats(long *renders, long *composites);
int text_layout_visual(const char *s, int font, float size, int *cps, int max);
@@ -220,8 +238,7 @@ static void render(Node *root, int w, int h) {
layout_root(root, (float)w, (float)h);
paint_damage(root);
ui.damage = (Box){ 0, 0, (float)w, (float)h };
- canvas_clear(&frame, 0);
- paint_root(&frame, root);
+ paint_root_clear(&frame, root, 0);
ui.damage = (Box){ 0, 0, 0, 0 };
}
static uint32_t pix(int x, int y) { return fb[y * FW + x] & 0xffffff; }
@@ -425,8 +442,7 @@ static void test_backdrop_band(void) {
ui.damage = d;
Rect r = { (int)fmaxf(0, floorf(d.x0)), (int)fmaxf(0, floorf(d.y0)), (int)fminf(160, ceilf(d.x1)), (int)fminf(100, ceilf(d.y1)) };
canvas_set_clip(&frame, r);
- canvas_clear(&frame, 0);
- paint_root(&frame, root);
+ paint_root_clear(&frame, root, 0);
canvas_set_clip(&frame, (Rect){ 0, 0, 160, 100 });
ui.damage = (Box){ 0, 0, 0, 0 };
uint32_t *partial = malloc(160 * 28 * 4);
@@ -467,8 +483,7 @@ static int paint_partial(Node *root, int w, int h, int *nrects, float *area) {
*area += (float)(r.x1 - r.x0) * (r.y1 - r.y0);
ui.damage = (Box){ (float)r.x0, (float)r.y0, (float)r.x1, (float)r.y1 };
canvas_set_clip(&frame, r);
- canvas_clear(&frame, 0);
- paint_root(&frame, root);
+ paint_root_clear(&frame, root, 0);
}
canvas_set_clip(&frame, (Rect){ 0, 0, w, h });
ui.damage = (Box){ 0, 0, 0, 0 };
@@ -483,8 +498,7 @@ static int full_differs(Node *root, int w, int h, int *where) {
Canvas rc;
canvas_init(&rc, ref, w, h, w);
ui.damage = (Box){ 0, 0, (float)w, (float)h };
- canvas_clear(&rc, 0);
- paint_root(&rc, root);
+ paint_root_clear(&rc, root, 0);
ui.damage = (Box){ 0, 0, 0, 0 };
int worst = 0;
for (int i = 0; i < w * h; i++)
@@ -1324,8 +1338,7 @@ static void test_transform_paint_hit(void) {
layout_root(root, 160, 100);
paint_damage(root);
ui.damage = (Box){ 0, 0, 160, 100 };
- canvas_clear(&frame, 0);
- paint_root(&frame, root);
+ paint_root_clear(&frame, root, 0);
paint_view = keep;
/* b: 60×10 at (70,45) scaled 2 around (100,50) → x 40..160, y 40..60 logical → 60..240, 60..90 physical */
int soft = 0;
@@ -1424,6 +1437,390 @@ static void test_overlay_scrollbar(void) {
CHECK(pix((int)(sv->ax + 200 - 5), ty) != 0x808080, "RTL thumb still on the right");
}
+/* ---- The dragged window, pixel for pixel (test_drag_exact) ----
+ * LordBench's desktop scene (apps/sysinfo/scene.jsx: a 760×480 window, a 72 px square turning inside
+ * it, six cards with shadows and text; a rounded window below; a menu bar and a Dock with backdrop
+ * blur) moved along LordBench's figure of eight (lbi_path, one step a frame as grab_script_tick does
+ * by the clock) for 480 frames, the square turning 6° a frame through lord.setStyle's C path
+ * (node_restyled; with 'rotate', what runtime/style.js makes of a transform: scene.jsx's own
+ * setStyle(n, 'transform', …) is not a key lord.setStyle takes), and painted as main.c paints a frame
+ * (paint_ui, then paint_out on one display).
+ * Every frame's pixels are hashed (FNV-1a over the 32-bit pixels) and compared with
+ * tests/drag_golden_cpu.txt and tests/drag_golden_gpu.txt, written from the code before the drag-frame
+ * optimizations (001633b): those must give exactly the same pixels. "gpu" is the same run with
+ * gpu_active() on: paint.c's GPU path (the layer's sentinel, the app holes, no skipped nodes) on the
+ * same CPU canvas the GPU uploads. Four shorter runs cover what makes the layer paint again: a text
+ * that changes a child's size, a child moving inside the window, a terminal whose cursor blinks
+ * (damage from outside the tree) and a square turning across the window's edge.
+ * The pixels that differ from a full repaint (paint_root_full, as LORD_PAINT_VERIFY) are printed as a
+ * second number, which may only go down (today: black pixels at the dragged window's own rounded top
+ * corners on the CPU path, its shadow one level darker on the GPU path).
+ * build/engine-test checks the hashes (skipped without hashes for this architecture)
+ * make drag-golden writes this architecture's hashes: only on the reference code */
+#if defined(__x86_64__)
+#define GOLD_ARCH "x86_64"
+#elif defined(__aarch64__)
+#define GOLD_ARCH "aarch64"
+#else
+#define GOLD_ARCH "other"
+#endif
+
+enum { DW = 1024, DH = 640, DRAG_FRAMES = 480, CASE_FRAMES = 60, FULL_EVERY = 16 };
+enum { DC_DRAG, DC_TEXT, DC_CHILD, DC_TERM, DC_EDGE, DC_N };
+static const char *const dc_name[DC_N] = { "drag", "text", "child", "term", "edge" };
+static const int dc_frames[DC_N] = { DRAG_FRAMES, CASE_FRAMES, CASE_FRAMES, CASE_FRAMES, CASE_FRAMES };
+#define DC_HASHES (DRAG_FRAMES + 4 * CASE_FRAMES + DC_N) /* each run: its frames and the one after the drag */
+
+typedef struct { OutView v; Canvas c, ref; uint32_t *px, *rpx; } DOut;
+typedef struct { Node *root, *win, *spin, *edge, *child, *term, *caption; } DScene;
+
+static uint64_t frame_hash(const Canvas *c) {
+ uint64_t h = 1469598103934665603ull;
+ for (int y = 0; y < c->h; y++) {
+ const uint32_t *row = c->px + (size_t)y * c->stride;
+ for (int x = 0; x < c->w; x++) { h ^= row[x]; h *= 1099511628211ull; }
+ }
+ return h;
+}
+
+/* lord.setStyle with a number (js.c): set, then node_restyled decides what to place or repaint */
+static void js_set(Node *n, const char *k, double v) {
+ Style before = n->s;
+ StyleExt xb;
+ if (n->s.ext) memcpy(&xb, n->s.ext, STYLE_EXT_VALUES);
+ if (style_set_number(&n->s, k, v)) { printf("unknown style %s\n", k); fails++; }
+ node_restyled(n, &before, before.ext ? &xb : NULL);
+}
+
+/* main.c's frame on one display: paint_ui (layout, damage, the layer's display), then paint_out (the
+ * damaged box in physical px, cleared and painted with paint_root_clear) */
+static void drag_paint(Node *root, DOut *o) {
+ if (!ui.dirty) return;
+ ui.dirty = 0;
+ layout_root(root, DW, DH);
+ Box d = { 0, 0, 0, 0 };
+ if (paint_damage(root)) d = ui.damage;
+ ui.damage = (Box){ 0, 0, 0, 0 };
+ if (paint_layer_node()) paint_layer_view(0);
+ if (d.x1 <= d.x0 || d.y1 <= d.y0) return;
+ Rect pr = out_phys_rect(&o->v, d.x0, d.y0, d.x1, d.y1);
+ if (pr.x1 <= pr.x0 || pr.y1 <= pr.y0) return;
+ float lx0, ly0, lx1, ly1;
+ out_logical_box(&o->v, pr, &lx0, &ly0, &lx1, &ly1);
+ paint_view = (PaintView){ (float)o->v.x, (float)o->v.y, (float)o->v.k, (float)o->v.dx, (float)o->v.dy, 0 };
+ ui.damage = (Box){ lx0, ly0, lx1, ly1 };
+ canvas_set_clip(&o->c, pr);
+ paint_root_clear(&o->c, root, 0x000000);
+ canvas_set_clip(&o->c, (Rect){ 0, 0, o->c.w, o->c.h });
+ ui.damage = (Box){ 0, 0, 0, 0 };
+ paint_view = (PaintView){ 0, 0, 1, 0, 0, 0 };
+}
+
+/* Pixels of the frame that differ from a full repaint of the tree (paint_root_full); *worst: the
+ * largest difference of a channel seen so far. */
+static long drag_full_diff(Node *root, DOut *o, int *worst) {
+ Box keep = term_at; /* the terminal notes where it was painted: not this check */
+ canvas_clear(&o->ref, 0x000000);
+ paint_view = (PaintView){ (float)o->v.x, (float)o->v.y, (float)o->v.k, (float)o->v.dx, (float)o->v.dy, 0 };
+ paint_root_full(&o->ref, root);
+ paint_view = (PaintView){ 0, 0, 1, 0, 0, 0 };
+ term_at = keep;
+ long n = 0;
+ for (size_t i = 0; i < (size_t)o->c.w * o->c.h; i++) {
+ if (o->px[i] == o->rpx[i]) continue;
+ n++;
+ for (int sh = 0; sh < 32; sh += 8) {
+ int d = abs((int)((o->px[i] >> sh) & 255) - (int)((o->rpx[i] >> sh) & 255));
+ if (d > *worst) *worst = d;
+ }
+ }
+ return n;
+}
+
+static Node *dview(Node *parent, float w, float h, uint32_t bg, float radius) {
+ Node *n = view(parent);
+ if (w > 0) sn(n, "width", w);
+ if (h > 0) sn(n, "height", h);
+ if (bg) sn(n, "backgroundColor", bg);
+ if (radius > 0) sn(n, "borderRadius", radius);
+ return n;
+}
+static Node *dtext(Node *parent, const char *s, float size, float weight, uint32_t color) {
+ Node *t = text(parent, s, size);
+ sn(t, "color", color);
+ if (weight > 0) sn(t, "fontWeight", weight);
+ return t;
+}
+static void dshadow(Node *n, uint32_t color, float y, float blur) {
+ sn(n, "shadowColor", color);
+ sn(n, "shadowOffsetY", y);
+ sn(n, "shadowBlur", blur);
+}
+
+/* The desktop and LordBench's scene window at (x, y), with what case dc adds to it. */
+static DScene drag_scene(int dc, float x, float y) {
+ static const uint32_t accents[6] = { 0xff0a84ff, 0xff30d158, 0xffff9f0a, 0xffbf5af2, 0xffff453a, 0xff64d2ff };
+ DScene s = { 0 };
+ ui_reset();
+ s.root = view(NULL);
+ ui.root = s.root;
+ sn(s.root, "backgroundColor", 0xff2b3a4f);
+ for (int i = 0; i < 5; i++) { /* desktop icons with their names */
+ Node *ic = box_in(s.root, 24, 50 + i * 100, 64, 64, accents[i]);
+ sn(ic, "borderRadius", 14);
+ Node *l = dtext(s.root, "Documents", 12, 0, 0xffffffff);
+ ss(l, "position", "absolute");
+ sn(l, "left", 16); sn(l, "top", 118 + i * 100); sn(l, "width", 80);
+ ss(l, "textAlign", "center");
+ }
+ /* a window below: rounded, overflow hidden, with a shadow (its corners are restored around the drag) */
+ Node *below = box_in(s.root, 110, 330, 520, 280, 0xff1e1e20);
+ ss(below, "overflow", "hidden");
+ sn(below, "borderRadius", 12);
+ dshadow(below, 0x66000000, 16, 40);
+ Node *bt = dview(below, 0, 28, 0xff3a3a3c, 0);
+ dtext(bt, "Files", 13, 600, 0xffe0e0e0);
+ for (int i = 0; i < 8; i++) {
+ Node *row = dview(below, 0, 30, i & 1 ? 0xff252528 : 0, 0);
+ ss(row, "flexDirection", "row"); ss(row, "alignItems", "center");
+ sn(row, "paddingLeft", 12); sn(row, "gap", 8);
+ dview(row, 16, 16, 0xff5b8def, 3);
+ dtext(row, "Quarterly report, final version.pdf", 13, 0, 0xffd0d0d0);
+ }
+ /* the scene window: the theme's frame (title bar) and scene.jsx's content */
+ s.win = box_in(s.root, x, y, 760, 480, 0xff2c2c2e);
+ ss(s.win, "overflow", "hidden");
+ sn(s.win, "borderRadius", 12);
+ sn(s.win, "borderWidth", 1);
+ sn(s.win, "borderColor", 0x30ffffff);
+ dshadow(s.win, 0x73000000, 24, 56);
+ Node *title = dview(s.win, 0, 28, 0xff3a3a3c, 0);
+ ss(title, "alignItems", "center"); ss(title, "justifyContent", "center");
+ dtext(title, "System Information", 13, 600, 0xffe0e0e0);
+ Node *body = view(s.win);
+ sn(body, "flexGrow", 1);
+ sn(body, "paddingLeft", 20); sn(body, "paddingRight", 20); sn(body, "paddingTop", 20); sn(body, "paddingBottom", 20);
+ sn(body, "gap", 12);
+ ss(body, "alignItems", "center"); ss(body, "justifyContent", "center");
+ s.spin = dview(body, 72, 72, 0xff0a84ff, 16);
+ ss(s.spin, "alignItems", "center"); ss(s.spin, "justifyContent", "center");
+ dview(s.spin, 24, 24, 0xffffffff, 12);
+ Node *cards = view(body);
+ ss(cards, "flexDirection", "row"); ss(cards, "flexWrap", "wrap"); ss(cards, "justifyContent", "center");
+ sn(cards, "gap", 12);
+ for (int i = 0; i < 6; i++) {
+ Node *c = dview(cards, 180, 96, 0x14ffffff, 12);
+ sn(c, "paddingLeft", 12); sn(c, "paddingRight", 12); sn(c, "paddingTop", 12); sn(c, "paddingBottom", 12);
+ sn(c, "gap", 4);
+ dshadow(c, 0x40000000, 2, 8);
+ dview(c, 28, 28, accents[i], 8);
+ dtext(c, "Desktop impact", 15, 600, 0xffffffff);
+ char label[32];
+ snprintf(label, sizeof label, "Card %d", i + 1);
+ Node *cap = dtext(c, label, 12, 0, 0x99ffffff);
+ if (!i) s.caption = cap;
+ }
+ if (dc == DC_CHILD) { /* a badge that slides inside the window */
+ s.child = box_in(s.win, 40, 44, 14, 14, 0xffff453a);
+ sn(s.child, "borderRadius", 7);
+ }
+ if (dc == DC_TERM) { /* a terminal, its cursor blinking */
+ s.term = node_new(NODE_TERM);
+ s.term->term = 1;
+ node_append(s.win, s.term);
+ ss(s.term, "position", "absolute");
+ sn(s.term, "left", 16); sn(s.term, "top", 412); sn(s.term, "width", 320); sn(s.term, "height", 52);
+ }
+ if (dc == DC_EDGE) { /* a turning square across the window's right edge */
+ s.edge = box_in(s.win, 732, 120, 40, 40, 0xffbf5af2);
+ sn(s.edge, "borderRadius", 6);
+ }
+ /* the Dock and the menu bar: shell layers above the windows, with backdrop blur */
+ Node *dockl = layer_node(s.root, 10, DW, DH);
+ Node *dock = box_in(dockl, (DW - 600) / 2, DH - 72, 600, 64, 0x80303034);
+ sn(dock, "borderRadius", 16);
+ sn(dock, "backdropBlur", 20);
+ for (int i = 0; i < 6; i++) dview(dock, 48, 48, accents[i], 12);
+ ss(dock, "flexDirection", "row"); ss(dock, "alignItems", "center"); ss(dock, "justifyContent", "center");
+ sn(dock, "gap", 12);
+ Node *barl = layer_node(s.root, 20, DW, DH);
+ Node *bar = box_in(barl, 0, 0, DW, 28, 0x99202024);
+ sn(bar, "backdropBlur", 20);
+ ss(bar, "flexDirection", "row"); ss(bar, "alignItems", "center");
+ sn(bar, "paddingLeft", 14); sn(bar, "gap", 18);
+ dtext(bar, "LordOS", 13, 700, 0xffffffff);
+ dtext(bar, "File", 13, 0, 0xffffffff);
+ dtext(bar, "Edit", 13, 0, 0xffffffff);
+ return s;
+}
+
+/* One run: case dc's scene, the drag (n frames), then the frame after it ends. hash gets n + 1
+ * values; the largest count of pixels that differed from a full repaint goes to *full, the largest
+ * difference of a channel to *worst. */
+static void drag_run(int dc, DOut *o, uint64_t *hash, long *full, int *worst) {
+ const int n = dc_frames[dc];
+ const float x0 = (DW - 760) / 2, y0 = 28 + (DH - 28 - 480) / 2; /* scenePath: centered in the work area */
+ const float rx = (DW - 760) / 2 - 20, ry = (DH - 28 - 480) - 40;
+ DScene s = drag_scene(dc, x0, y0);
+ term_cursor = 1;
+ term_at = (Box){ 0, 0, 0, 0 };
+ canvas_set_clip(&o->c, (Rect){ 0, 0, o->c.w, o->c.h });
+ canvas_clear(&o->c, 0x000000);
+ damage_add((Box){ 0, 0, DW, DH });
+ ui.dirty = 1;
+ drag_paint(s.root, o);
+ paint_layer_begin(s.win->id, 0); /* grab.c's setup */
+ float gx = x0, gy = y0, rot = 0;
+ *full = 0;
+ *worst = 0;
+ for (int f = 0; f < n; f++) {
+ float dx, dy;
+ lbi_path(rx, ry, 6000, f * (1000.0 / 60), &dx, &dy);
+ float x = x0 + roundf(dx), y = y0 + roundf(dy); /* grab_motion */
+ if (x != gx || y != gy) {
+ gx = x; gy = y;
+ s.win->s.pos[EDGE_L] = (Dim){ x, UNIT_PX };
+ s.win->s.pos[EDGE_T] = (Dim){ y, UNIT_PX };
+ node_moved(s.win);
+ ui.dirty = 1;
+ }
+ rot = fmodf(rot + 6, 360); /* scene.jsx's square, every 16 ms */
+ if (dc == DC_DRAG) js_set(s.spin, "rotate", rot); /* the others: only their own change */
+ if (dc == DC_EDGE) js_set(s.edge, "rotate", rot);
+ if (dc == DC_CHILD) js_set(s.child, "left", 40 + (f * 5) % 640);
+ if (dc == DC_TEXT && f % 15 == 7) /* lord.setText on the caption: one line or two */
+ node_set_text(s.caption->first, (f / 15) & 1 ? "Card 1" : "Card 1, measured while a busy app runs");
+ if (dc == DC_TERM && f % 10 == 5 && term_at.x1 > term_at.x0) {
+ term_cursor = !term_cursor; /* term_damage: the cursor's row, where it was painted */
+ damage_add((Box){ floorf(term_at.x0), floorf(term_at.y0 + 8 - 2), ceilf(term_at.x1), ceilf(term_at.y0 + 24 + 2) });
+ ui.dirty = 1;
+ }
+ drag_paint(s.root, o);
+ hash[f] = frame_hash(&o->c);
+ if (f % FULL_EVERY == FULL_EVERY - 1) { long d = drag_full_diff(s.root, o, worst); if (d > *full) *full = d; }
+ }
+ paint_layer_end(); /* grab_finish */
+ ui.dirty = 1;
+ drag_paint(s.root, o);
+ hash[n] = frame_hash(&o->c);
+ long d = drag_full_diff(s.root, o, worst);
+ if (d > *full) *full = d;
+}
+
+/* The golden file: lines "<architecture> <run> <frame> <hash>"; # starts a comment. */
+static char *read_file(const char *path) {
+ FILE *f = fopen(path, "rb");
+ if (!f) return NULL;
+ fseek(f, 0, SEEK_END);
+ long len = ftell(f);
+ fseek(f, 0, SEEK_SET);
+ char *b = len >= 0 ? malloc((size_t)len + 1) : NULL;
+ if (b && fread(b, 1, (size_t)len, f) != (size_t)len) { free(b); b = NULL; }
+ if (b) b[len] = 0;
+ fclose(f);
+ return b;
+}
+
+static int gold_find(const char *file, const char *run, int frame, uint64_t *h) {
+ char key[64];
+ int kl = snprintf(key, sizeof key, "%s %s %d ", GOLD_ARCH, run, frame);
+ for (const char *p = file; p && *p; ) {
+ if (!strncmp(p, key, (size_t)kl)) {
+ unsigned long long v;
+ if (sscanf(p + kl, "%llx", &v) == 1) { *h = v; return 1; }
+ }
+ p = strchr(p, '\n');
+ if (p) p++;
+ }
+ return 0;
+}
+
+/* Writes this architecture's lines, keeping the other architectures' and the comments. */
+static int gold_write(const char *path, const char *variant, const uint64_t *hash) {
+ char *old = read_file(path);
+ char tmp[256];
+ snprintf(tmp, sizeof tmp, "%s.tmp", path);
+ FILE *f = fopen(tmp, "w");
+ if (!f) { free(old); return -1; }
+ if (!old || !*old)
+ fprintf(f, "# engine-test test_drag_exact, %s path: FNV-1a hash of every frame of the dragged window.\n"
+ "# Written by `make drag-golden` on the code before the drag-frame optimizations\n"
+ "# (001633b); later code must give the same pixels. Lines: architecture, run, frame, hash.\n", variant);
+ size_t al = strlen(GOLD_ARCH);
+ for (const char *p = old; p && *p; ) {
+ const char *e = strchr(p, '\n');
+ size_t len = e ? (size_t)(e - p) : strlen(p);
+ if (len && !(len > al && !strncmp(p, GOLD_ARCH, al) && p[al] == ' ')) fprintf(f, "%.*s\n", (int)len, p);
+ p = e ? e + 1 : NULL;
+ }
+ int k = 0;
+ for (int dc = 0; dc < DC_N; dc++)
+ for (int fr = 0; fr <= dc_frames[dc]; fr++) fprintf(f, "%s %s %d %016llx\n", GOLD_ARCH, dc_name[dc], fr, (unsigned long long)hash[k++]);
+ free(old);
+ if (fclose(f) || rename(tmp, path)) return -1;
+ return 0;
+}
+
+static void test_drag_exact(int write) {
+ static const char *const variant[2] = { "cpu", "gpu" };
+ DOut o = { 0 };
+ o.v = out_view(0, 0, DW, DH, 100);
+ o.px = calloc((size_t)DW * DH, 4);
+ o.rpx = calloc((size_t)DW * DH, 4);
+ uint64_t *hash = malloc(sizeof *hash * DC_HASHES);
+ if (!o.px || !o.rpx || !hash) { CHECK(0, "drag-exact: out of memory"); free(o.px); free(o.rpx); free(hash); return; }
+ canvas_init(&o.c, o.px, DW, DH, DW);
+ canvas_init(&o.ref, o.rpx, DW, DH, DW);
+ for (int g = 0; g < 2; g++) {
+ test_gpu = g;
+ char path[64];
+ snprintf(path, sizeof path, "tests/drag_golden_%s.txt", variant[g]);
+ long fullw[DC_N];
+ int worst[DC_N];
+ long parts = 0, renders = 0, blits = 0;
+ int k = 0;
+ paint_layer_parts();
+ paint_layer_stats(&renders, &blits);
+ for (int dc = 0; dc < DC_N; dc++) {
+ drag_run(dc, &o, hash + k, &fullw[dc], &worst[dc]);
+ k += dc_frames[dc] + 1;
+ }
+ parts = paint_layer_parts();
+ paint_layer_stats(&renders, &blits);
+ printf("drag-exact %s: %d frames; layer: %ld renders (%ld of them parts, %ld rebuilds of what is below), %ld copies\n",
+ variant[g], k, renders % 1000, parts, renders / 1000, blits);
+ printf("drag-exact %s: most pixels differing from a full repaint (largest difference):", variant[g]);
+ for (int dc = 0; dc < DC_N; dc++) printf(" %s %ld (%d)", dc_name[dc], fullw[dc], worst[dc]);
+ printf("\n");
+ if (write) {
+ CHECK(!gold_write(path, variant[g], hash), "drag-exact: can't write %s", path);
+ printf("drag-exact %s: wrote %d hashes for %s to %s\n", variant[g], k, GOLD_ARCH, path);
+ continue;
+ }
+ char *file = read_file(path);
+ uint64_t h;
+ if (!file || !gold_find(file, dc_name[0], 0, &h)) {
+ printf("drag-exact %s: skipped: needs golden hashes for %s in %s (make drag-golden on the reference code)\n",
+ variant[g], GOLD_ARCH, path);
+ free(file);
+ continue;
+ }
+ k = 0;
+ for (int dc = 0; dc < DC_N; dc++) {
+ int bad = 0, first = -1;
+ for (int fr = 0; fr <= dc_frames[dc]; fr++, k++)
+ if (!gold_find(file, dc_name[dc], fr, &h) || h != hash[k]) { if (first < 0) first = fr; bad++; }
+ CHECK(!bad, "drag-exact %s, run %s: %d of %d frames differ from %s (the first: frame %d)",
+ variant[g], dc_name[dc], bad, dc_frames[dc] + 1, path, first);
+ }
+ free(file);
+ }
+ test_gpu = 0;
+ free(o.px);
+ free(o.rpx);
+ free(hash);
+}
+
#endif
/* ---- benchmark: a Files-like list and a window drag (docs/DESIGN.md, Engine notes) ---- */
@@ -1469,8 +1866,7 @@ static void frame_paint(Node *root, Disp *d, int nd) {
if (r.y1 > d[i].h) r.y1 = d[i].h;
ui.damage = b;
canvas_set_clip(&d[i].c, r);
- canvas_clear(&d[i].c, 0);
- paint_root(&d[i].c, root);
+ paint_root_clear(&d[i].c, root, 0);
canvas_set_clip(&d[i].c, (Rect){ 0, 0, d[i].w, d[i].h });
}
paint_view = (PaintView){ 0, 0, 1, 0, 0, 0 };
@@ -1557,8 +1953,7 @@ static void bench(void) {
for (int i = 0; i < N; i++) {
ui.damage = (Box){ 0, 0, 1280, 800 };
double a = now_ms();
- canvas_clear(&d[0].c, 0);
- paint_root(&d[0].c, root);
+ paint_root_clear(&d[0].c, root, 0);
v[i] = now_ms() - a;
}
printf("list: 2000 rows; layout cold %.2f ms, warm %.2f ms; full paint %.2f ms\n", cold, warm, median(v, N));
@@ -1615,6 +2010,8 @@ int main(int argc, char **argv) {
#ifdef ENGINE_BEFORE
return 0;
#else
+ if (argc > 1 && !strcmp(argv[1], "drag-golden")) { test_drag_exact(1); return fails ? 1 : 0; }
+ test_drag_exact(0); /* first: the transform cache is keyed by node id */
test_ellipsis();
test_borders();
test_logical();
diff --git a/third_party/quickjs/quickjs.c b/third_party/quickjs/quickjs.c
index adfd93e..16b4040 100644
--- a/third_party/quickjs/quickjs.c
+++ b/third_party/quickjs/quickjs.c
@@ -6280,6 +6280,13 @@ static void compute_value_size(JSValueConst val, JSMemoryUsage_helper *hp)
}
}
+/* LordOS patch: the malloc_size that JS_ComputeMemoryUsage reports, without
+ walking every object (lord.stats() polls it) */
+size_t JS_GetMallocSize(JSRuntime *rt)
+{
+ return rt->malloc_state.malloc_size;
+}
+
void JS_ComputeMemoryUsage(JSRuntime *rt, JSMemoryUsage *s)
{
struct list_head *el, *el1;
diff --git a/third_party/quickjs/quickjs.h b/third_party/quickjs/quickjs.h
index 8814222..40e08e6 100644
--- a/third_party/quickjs/quickjs.h
+++ b/third_party/quickjs/quickjs.h
@@ -443,6 +443,7 @@ typedef struct JSMemoryUsage {
} JSMemoryUsage;
void JS_ComputeMemoryUsage(JSRuntime *rt, JSMemoryUsage *s);
+size_t JS_GetMallocSize(JSRuntime *rt); /* LordOS patch */
void JS_DumpMemoryUsage(FILE *fp, const JSMemoryUsage *s, JSRuntime *rt);
/* atom support */