Repository navigation
Rive support: build-time translated .riv files played in pure Java - #6286
shai-almog wants to merge 67 commits into
Conversation
…Java A build step (maven/rive-transcoder, wired into the Maven and Gradle SVG transcode steps) turns each .riv under src/main/rive into a Java class that builds the file's objects; nothing is parsed on the device. The runtime in com.codename1.impl.rive is a Java rewrite of rive-runtime (MIT): timeline animation, state machines, bones/skins/constraints, meshes through com.codename1.gpu, clipping, gradients, nested artboards, images, events, text, data binding, layouts and audio. Luau scripting is not supported. RiveView plays a file, takes inputs, view-model values and pointer input, and reports events. Docs in the SVG transcoder chapter; unit tests in core-unittests; RiveAnimated, RiveFeatures and RiveGpu screenshot tests in hellocodenameone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Golden capture finishedGoldens committed here; Golden capture re-checks this head for gaps CI is running again on the commit with the goldens. Review the images in that commit like any other golden change. Run at |
GitHub listed a dispatched windows-cross-build-run.yml run more than five minutes after creating it, and the per-workflow five-minute lookup failed the whole capture. Dispatch every workflow first, then look all the runs up together until a shared deadline (CN1SS_FIND_RUN_MINUTES, default 40), so a slow listing costs time rather than the capture. The job timeout goes to 60. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lookup that fails (bad CN1SS_GH_TOKEN, rate limit) read as "not listed yet" and waited out the whole deadline with no diagnostic. Log gh's error on the first failing pass, every tenth pass after it, and again at the deadline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rray markPath read pointCount, which counts floats, as a count of points, so any path longer than half its array threw ArrayIndexOutOfBoundsException out of draw() and the rest of the frame was lost: the GPU goldens showed the jellyfish's glow and a few strokes, never its body. A test draws a 40-point path and fails with the old loop. RiveFeatures: the form is no longer scrollable, so the 4x2 grid divides the screen; scrolling, each row took an artboard's height and only the first row was captured. The RiveGpu goldens of the GPU legs and every RiveFeatures golden are removed so the capture renders them again; the JavaScript RiveGpu golden (Graphics path) and the RiveAnimated goldens are correct and kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hello suite's cmake build ran under a fixed 80-minute deadline meant as a hang guard. Each feature added to the suite pushed a healthy build closer to it, and the Rive screens (about 700 more translation units, 7,737 steps) pushed the Linux x64 build past it at step 7,586 while still compiling. Judge progress instead: ninja prints a line per unit, so a build whose output has not grown for 15 minutes is the hang. A 125-minute cap, under the job's 140, backstops a build that prints without finishing. The Linux, Windows and macOS suites share runCmakeBuild. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
windows-latest now ships MSVC STL 14.52, whose yvals_core.h static_asserts STL1000 "expected Clang 22 or newer", beside its own LLVM 20. Every C++ unit of the native hello suite failed on x64 (cn1_windows_browser.cpp first) with no change of ours. Define _ALLOW_COMPILER_AND_STL_VERSION_MISMATCH through CXXFLAGS, which seeds CMAKE_CXX_FLAGS in the configures the tests spawn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…runs From the diagram-kanban branch's red-team pass, so both PRs carry the same scripts: - capture: the seen-runs listing is retried and never fatal under set -e; a fallback dispatch that still fails marks its workflow dead, the lookup skips it, and the step fails once the others are recorded; each run id is recorded as soon as it is found, so a later failure still cancels it. - harvest: a failed re-run of dropped jobs warns on stderr (stdout is the count) instead of ending the loop; comments that cannot be listed skip the update rather than posting a duplicate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…done - list() counted "completed" in column 2 of a runs file that holds only "workflow id", so runs=0 whenever runs existed and the harvest skipped its collect step: nothing was harvested. Counted while listing now. - An incremental harvest push restarts the capture, whose dispatch cancels the legs still rendering, losing their images. In a capture the harvest commits only once every leg has completed (a hung leg still ends at its timeout). - redo-dropped survives failing API calls and no longer pipes into grep -q (SIGPIPE under pipefail read as no match); the capture lookup deadline is capped 50 minutes after the script starts, inside the job's 60. From the diagram-kanban branch, so both PRs carry the same scripts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every Rive screenshot jumped a fresh view to its time with one advance(). A state machine starts in Entry, and its first advance only enters the first state at that animation's time 0 (as rive-runtime does), so each capture showed frame 0: the six RiveAnimated frames were identical, and trim drew nothing. The tests now advance(0) and then step 1/60 s at a time, which is what RiveView.animate() does during playback. Every Rive golden is dropped so the next capture renders the stepped frames. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runtime now ships only with applications that have .riv files, as a Maven/Gradle dependency. The hand-written classes and the public com.codename1.rive API move to maven/rive-runtime unchanged (same packages, so the transcoder's output is the same). The 546 generated Base and placeholder classes and the transcoder's RiveSchema are no longer committed: the new maven/rive-schema-gen (a Java port of scripts/rive/gen-rive-schema.py, verified byte-identical apart from the generator's name) writes them into target/generated-sources from a pinned zip of rive-runtime's generated headers (commit e2b1f234, MIT LICENSE and UPSTREAM.txt inside and beside it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Maven: the archetype and hellocodenameone add the runtime in a rive profile active on src/main/rive; transcode-svg (and its self-repair) fails with the dependency snippet when a module has .riv files and RiveFile is not on its compile class path. The Gradle plugin adds the runtime for src/main/rive and GradleConversion drops the pom's copy, as for compose-compat. - Gates: rive-runtime joins the pr.yml SpotBugs build and the SpotBugs, PMD and Checkstyle report lists, check-cast-semantics roots, the markdown-doc, package-info and since-tag gates; build_javadocs.sh generates the model and documents com.codename1.rive. - Workflows that build hellocodenameone build rive-runtime in their -pl lists and watch maven/rive-runtime and maven/rive-schema-gen; release confirms codenameone-rive-runtime and -transcoder on R2. - The Python generator and its helper are retired: the Java generator replaces them and nothing else read them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… dependencies Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The base implementation only logged 'not implemented', so GpuRiveRenderer's per-flush layer clear kept stale content on these ports. Android uses a PorterDuff CLEAR paint (queued as an AsyncOp on the async view), Linux uses CAIRO_OPERATOR_CLEAR, Windows uses ID2D1RenderTarget::Clear inside the current clip plus the requested rectangle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # .github/workflows/pr.yml
…lways outlasts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… opaque Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apple TV (tvOS / Metal)Compared 228 screenshots: 227 matched, 1 updated. |
… cleanup GpuImage attaches only for the current form's own paint, drops its placement when the form goes, moves without revalidating, and resets per paint pass. Label forwards pointer input only for presses inside the interactive image's painted rect. Graphics.clearRect is a no-op on screen graphics on every port. CSSBorder caches repeated tiles. The build removes an installed runtime when the last .riv is gone, and a cn1lib compiles against it without shipping it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e demos The demos build compiles that CSS, so juice.riv (rive-runtime test asset, MIT, licence beside it) sits next to it and the docs job installs rive-runtime for the plugin to copy in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Native fidelity (Android, Material 3)54 pairs compared -- median 95.6%, worst 91.3% ( Distribution --
Geometry vs native (bbox offset / size ratio / center offset / corner radius) -- gated separately from the visual score
Side-by-side comparisons (worst first)
|
Native fidelity (ios-27-metal)68 pairs compared -- median 94.6%, worst 74.5% ( Distribution --
Geometry vs native (bbox offset / size ratio / center offset / corner radius) -- gated separately from the visual score
Side-by-side comparisons (worst first)
|
Native fidelity (iOS Modern, Metal)68 pairs compared -- median 95.0%, worst 83.5% ( Distribution --
Geometry vs native (bbox offset / size ratio / center offset / corner radius) -- gated separately from the visual score
Side-by-side comparisons (worst first)
|
…e's own limit The poll's 30 second cap equalled the suite's per-test limit, so on Android, where no GPU frame arrived, the suite timed the test out instead of capturing. The cap is 20 seconds now, and a late poll logs the surface state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ger aborts the paint On Android, Graphics.clipRect over a shape clip goes through GeneralPath.intersect, which throws on some curves. The renderer clipped every gradient fill, clip path and mesh triangle that way, so a file like jellyfish_test threw inside every paint and the form never finished showing (RiveGpuScreenshotTest hung all three Android legs). Shape clips now go through one helper: a shape inside the clip rectangle needs no intersection, and when the intersection throws the clip falls back to the rectangle -- a gradient then fills its shape with the middle stop and a mesh triangle is skipped, rather than spilling over the rectangle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/developer-guide/languagetool-accept.txt
… runs in the Playground Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-gated GPU tests On the browser leg the 10s default ended the test while it still waited for its first GPU frame, so it captured nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # NOTICE # scripts/copyright-header-exclusions.txt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…thread on timeout The EDT blocked forever in createPeer during RiveGpu on all three Android legs, with nothing logged. A timeout now prints the UI thread's stack and falls back to Graphics, so the suite continues and the log names the cause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…te output RiveGpu wedges the app on all three Android legs and the log goes silent until the emulator drops; the dump names the blocked thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the UI thread on timeout" This reverts commit 89a0c51.
… in RiveGpu Prints (CN1GPU:) at surface construction, create, resize, each frame step and readback on Android, the ops of the first frames in GpuRiveRenderer, and the first prepareFrame calls. Removed once the cause is found. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inted The per-class layered pane is never laid out, so the placement stayed 0x0 and the surface it positions fell outside its clip. The peer was never painted, which on Android means the GLSurfaceView never reached the window (no onSurfaceCreated) and on Windows no frame was ever rendered: RiveGpu drew the Graphics fallback on every GPU port. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… emulator death Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Component.paintComponent records the repaint root in one field and the form is resolved only by Graphics.getPaintingForm(), which only a GpuImage draw asks; the form behind a dialog (BGPainter) names itself the same way. Label's paint hook is two field writes and forgets the last interactive image so a replaced icon is not held or sent pointer input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drawn images always render through Graphics. GpuImage and its layered-pane placement are gone, as are the paint-pass, painting-root and Label/Button icon-forwarding hooks in core, and the per-port clearRect implementations. RiveView hosts the GPU surface as a laid-out RenderView and is the only route for pointer events into a RiveImage (besides the app calling them). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>





















































































































































































































































































































































































Adds Rive (
.riv) support. Like Lottie, a file is translated at build time: each.rivundersrc/main/rivebecomes a Java class (com.codename1.generated.rive.<Name>Rive) that builds the file's objects, so nothing is parsed on the device and the runtime is stripped from apps without Rive files.Runtime (
com.codename1.impl.rive, a Java rewrite of rive-runtime, MIT; headers, NOTICE entry and copyright-gate exclusions included):com.codename1.gpu, with a Graphics fallbackPublic API (
com.codename1.rive):RiveFile,RiveView(plays by default; pause/play, state machine inputs, view-model values, pointer and hover input, events), andRiveEvent/RiveEventListener.Build:
maven/rive-transcoder, wired intoSvgTranscodeRunner, the Maven mojo and the Gradle task. Generated classes carry a transcoder stamp and a source CRC, so stale classes are regenerated.Tests
RiveView)Local gates: SpotBugs/PMD/Checkstyle at zero, cast semantics, control characters, author/since tags, CLDC11 and JavaAPI compile of the runtime, and a run over rive-runtime's 603 test files with no crashes. Docs: new "Rive animations" section in the SVG transcoder chapter.
🤖 Generated with Claude Code