Commit graph

532 commits

Author SHA1 Message Date
Admin
5b2e29fb74 make splats faster 2026-02-21 12:37:26 +01:00
offline-ant
209c660226
Fix some build issues + upgrade android to r28 ndk. (#862)
* fix: add **/* glob to Linux NDK unzip to match subdirectories

`*` alone doesn't match `/` on Linux unzip builds with WILD_STOP_AT_DIR,
causing only top-level files to be extracted. Adding `**/*` ensures bin/,
lib64/, sysroot/ subdirectories are included.

* Auto-bundle NDK shared library deps (e.g. libc++_shared.so) into APK

When libmakepad.so has NEEDED entries for shared libraries provided by
the NDK sysroot (like libc++_shared.so from C++ dependencies), those
libraries were not being included in the APK, causing runtime dlopen
failures on device.

Add bundle_ndk_shared_deps() which uses the NDK's llvm-readelf to scan
libmakepad.so for NEEDED entries, then copies any matching .so files
from the NDK sysroot base lib dir into the APK. System libraries
(present in the API-level subdirectory) are excluded since they are
provided by the Android OS at runtime.

The detection is general-purpose and not hardcoded to any specific
library name.

* fix: make SYS_GETTID arch-conditional (186 on x86_64, 178 on aarch64)

The constant was hardcoded to 178 (correct for aarch64 but maps to
query_module on x86_64), causing Android's seccomp filter to kill the
process immediately on x86_64 emulators.

* Upgrade Android NDK from r25 to r28, fix x86_64 seccomp crash

cargo_makepad:
- sdk.rs: NDK version 25.2.9519653 → 28.2.13676358, download URLs r25c → r28b
- sdk.rs: Update NDK_IN extract paths for all platforms (Windows, macOS, Linux)
- sdk.rs: macOS NDK extraction is now host-aware (darwin-aarch64 for Apple Silicon)
- compile.rs: MacosAarch64 uses native darwin-aarch64 prebuilt (no more Rosetta)
- compile.rs: ndk_prebuilt_dir() split for MacosX64 vs MacosAarch64

platform:
- libc_sys.rs: Make SYS_GETTID arch-conditional (186 on x86_64, 178 on aarch64)
  Was hardcoded to 178 which maps to query_module on x86_64, causing
  Android seccomp to kill the process on x86_64 emulators
- android.rs: Add pub display field on CxOs, pub make_current() on CxAndroidDisplay
  for Servo embedding support

* Fix GLSL struct constructor crash on Android GLES drivers

The r28 script-based shader backend (shader_glsl.rs) generates GLSL
struct constructor syntax in the vertex/fragment main() unpack code,
e.g.: vb_geom = QuadVertex(vec2(packed_geometry_0.x, ...));

Some GLES drivers (notably Android emulator ANGLE/SwiftShader) reject
this with 'Structure constructor arguments do not match structure
fields', even though it's valid per the GLES 3.0 spec.

This is a regression from r28. The old r25 shader compiler
(generate_glsl.rs) used VarUnpacker::unpack_var which generated direct
swizzle assignments (vb_geom.xy = packed_geometry_0.xy), never struct
constructors in the unpack path. The r25 branch is not affected.

Fix: generate per-sub-field assignments for struct-typed variables in
the main() geometry/instance/varying unpack code, matching the r25
behavior. Struct constructors in user shader function bodies are
unaffected.

* fix(android): Proper fullscreen support on API 30+ and FullscreenWindow/NormalizeWindow ops

Android platform changes:
- Add CxOsOp::FullscreenWindow handler: sets os.fullscreen flag and calls JNI setFullScreen
- Add CxOsOp::NormalizeWindow handler: clears os.fullscreen and exits fullscreen

MakepadActivity.java:
- onCreate: On API 30+, switch from legacy Theme.NoTitleBar.Fullscreen to
  Theme_DeviceDefault_NoActionBar to avoid FLAG_FULLSCREEN conflict
- onCreate: Call setDecorFitsSystemWindows(false) and set
  LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS before setContentView so SurfaceView
  is laid out at y=0 from the start
- Refactor setFullScreen into applyFullScreen with proper WindowInsetsController
  API on API 30+ (hide/show statusBars + navigationBars)
- Legacy path (pre-API 30) uses full immersive sticky flags
- ResizingLayout.onApplyWindowInsets: Return WindowInsets.CONSUMED to prevent
  system bar insets from offsetting child SurfaceView

* Fix Android touch radius DPI scaling and revert aggressive fullscreen inset handling

- Divide touch.radius by dpi_factor alongside touch.abs for correct touch sizing
- Return insets instead of consuming them in ResizingLayout so child views get proper insets
- Remove premature setDecorFitsSystemWindows/cutout mode override; let apps opt in via FullscreenWindow

* Make DrawImage image_scale/image_pan fields pub

Needed by external crates (e.g. servo makepad_shell) that create custom
widgets using DrawImage and need to flip the Y axis for GL render textures.

---------

Co-authored-by: ant <ant@offline.click>
2026-02-21 10:30:56 +01:00
Admin
a98c49dadd sortable drawcalls 2026-02-21 10:05:07 +01:00
Admin
f6bafb9a82 splats without sort yet 2026-02-21 08:43:52 +01:00
offline-ant
5532faabfc
Add Servo embedding support: render texture API, EGL access, Image Y-flip (#861)
Three minimal changes to support embedding Servo as a WebView:

1. windowing_backend.rs: Make opengl_cx field pub (was pub(super))
   Servo needs EGL display/context/platform handles to create a shared
   GL context. egl_platform and egl_platform_display have no EGL query
   to retrieve them — they must come from whoever created the display.
   Matches Makepad convention (Cx fields are pub, no accessors).

2. opengl.rs: Add Cx::create_gl_render_texture(width, height)
   Eagerly allocates a RenderBGRAu8 texture and returns (Texture, gl_id).
   Needed because Makepad allocates GL textures lazily during render,
   but Servo needs the GL texture ID at init to attach to its FBO.
   No existing API for eager allocation (update_render_target and
   cx.os.gl() are both pub(crate)).

3. image.rs: Add is_render() Y-flip in Image widget
   FBO render targets are Y-up in OpenGL; Makepad is Y-down.
   CachedView handles this via sample2d_rt shader, but Image widget
   was untested with render textures. set_texture() accepts them but
   displays upside-down. Fixes a genuine gap — no existing Makepad
   code puts RenderBGRAu8 into an Image widget.

Co-authored-by: ant <ant@offline.click>
2026-02-20 16:36:53 +01:00
Admin
6fdcbc923b portal list unstuck 2026-02-20 16:05:31 +01:00
Julián Montes de Oca
88abfedd24
Restore IME support (#860)
* Restore IME support

* Remove unused voice handling methods from Window
2026-02-20 14:06:02 +01:00
Admin
e14f84ee5d make voice optional 2026-02-19 21:16:57 +01:00
Admin
6335a3e660 metal otw 2026-02-19 21:00:49 +01:00
Julián Montes de Oca
2b250ff622
Restore video widget (#857) 2026-02-19 16:43:41 +01:00
Admin
909dafcaab font change 2026-02-19 15:36:56 +01:00
Admin
bc2f3fc1db voice PTT 2026-02-19 15:11:46 +01:00
Admin
a1a38a862f cleanup 2026-02-19 14:28:24 +01:00
Admin
0e845c991a voice input 2026-02-19 14:13:07 +01:00
Admin
0cf4a8e3ca nicer dots 2026-02-19 09:21:14 +01:00
Admin
2abd0c89b2 websocket jitter 2026-02-19 08:51:28 +01:00
Admin
b8f1aacfd2 file icon color 2026-02-19 08:39:25 +01:00
Admin
d23b1b06a0 git dots 2026-02-19 08:31:54 +01:00
Admin
1581943963 git dots 2026-02-19 08:03:39 +01:00
Admin
c2342aedfb ui automation 2026-02-18 21:28:46 +01:00
Admin
a5510b3f53 ui proto 2026-02-18 21:10:25 +01:00
Admin
d32b7ca004 optimize inflate/deflate 2026-02-18 13:28:39 +01:00
Admin
7656e2b537 fix selection accross items 2026-02-17 21:49:02 +01:00
Admin
a298eb62f3 terminal work/ webp 2026-02-17 18:11:36 +01:00
Admin
c6d8df41ec rounded boxes 2026-02-17 11:38:21 +01:00
Admin
7b45e69fed 3d charts otw 2026-02-17 10:21:14 +01:00
Admin
db10fc4ceb instance pbr 2026-02-17 09:52:04 +01:00
Admin
cb55db99cb windows 2026-02-16 22:00:26 +01:00
Admin
41746c0346 fix up things 2026-02-16 17:27:28 +01:00
Admin
fa114f59ef openGL 2026-02-16 17:19:02 +01:00
Admin
cd1c1753f2 gltf example! 2026-02-16 15:51:24 +01:00
Admin
e854539b2a fix warnings 2026-02-16 11:58:51 +01:00
Admin
250566d044 vulkan vendoring completed 2026-02-16 09:10:27 +01:00
Admin
e2f30f16e9 clean 2026-02-15 19:21:10 +01:00
Admin
1c8ceb4693 cleanup widget tree 2026-02-15 18:34:42 +01:00
Admin
5ad1df51f1 vulkan otw + widget fixes 2026-02-15 16:04:24 +01:00
Admin
c7fed2da23 android back 2026-02-15 13:30:18 +01:00
Admin
c2e2af5d86 headless otw 2026-02-15 11:41:33 +01:00
Admin
29b2778114 headless otw 2026-02-15 09:48:28 +01:00
Admin
bf6ba654bd web almost there 2026-02-14 22:46:32 +01:00
Admin
4d036ecdc4 otw 2026-02-14 22:14:26 +01:00
Admin
1db3ff2d08 webGL2 2026-02-14 22:07:26 +01:00
Admin
53aa1ab325 wayland working 2026-02-14 17:10:17 +01:00
Admin
476c19a473 terminal 2026-02-14 09:51:47 +01:00
Admin
a1717b781c fix tree 2026-02-13 16:11:31 +01:00
Admin
cff0582831 simple ui id system 2026-02-13 15:59:21 +01:00
Admin
0bb54c29cf refactor widget tree 2026-02-13 14:49:21 +01:00
Admin
b675e78934 image search 2026-02-12 21:56:41 +01:00
Admin
b9f957ecef todo app 2026-02-12 19:58:49 +01:00
Admin
d1fdcbe3d6 fix up widget tree search in fresh uis 2026-02-12 16:50:39 +01:00