Skip to content

v0.2.22

Choose a tag to compare

@TIMER-err TIMER-err released this 20 Jul 09:47

qml4j 0.2.22

Crisp raster in the picture cache at high DPI

The per-boundary SkPicture cache recorded subtrees in logical coordinates, so a raster
backing inside a cached boundary (a Canvas FBO, a saveLayer/layer.effect offscreen, a
blur/DropShadow/Glow) rasterized at logical size and was upscaled on replay -> blurry at high
DPI (crisp while animating, soft once cached). Boundaries are now recorded at the target
canvas' device scale (rc.scale(sf)), replayed with scale(1/sf), and a GUI-scale / DPI
change forces one re-record. Net size/position is unchanged; vector content stays pixel-exact.
Downstream can now enable setPictureCache on Canvas/effect views too.

Incremental layout removed -> always whole-tree measure

The Qt-style per-Item incremental (polish-queue) layout is gone. It had a first-appearance
reflow bug (a collapsed section expanded for the first time with a nested RowLayout landed
at y=0 / didn't grow until a full relayout), and measure was never the frame-rate bottleneck
(draw is, which the picture cache targets). The whole tree is measured every settle again, with
the existing multi-pass binding-settle loop and the opt-in Item.cachedLayout static-subtree
fast path. Removed: PolishQueue, Renderer.setIncrementalLayout / requestFullLayout /
settleLayoutIncremental / measureSelf, Item dirty bits + markLayout* + anchor-dependent
tracking + layoutDerivesSizeFromChildren, and the -Dqml4j.incrementalLayout flag. Hosts that
set setIncrementalLayout(false) can drop the call -- it's now the only behaviour.

Code-quality sweep (Qodana)

Resolved the full Qodana report: folded manual min/max, removed redundant type args/casts,
migrated deprecated skija APIs (makeFromEncoded -> makeDeferredFromEncodedBytes,
makeRasterN32Premul -> makeRaster(ImageInfo.makeN32Premul)), and suppressed justified false
positives. Includes a real fix: Renderer.culled() leaked a native Paint per frame for
layer-effected nodes (allocated via layerEffectPaint and discarded) -- now closed.

Compatibility

No consumer API breakage beyond the removed opt-in incremental-layout knobs. The draw-phase
picture cache remains opt-in (-Dqml4j.pictureCache=true), off by default.

Tests

603 green. New device-scale coverage (deviceScaleRecordedAndInvalidatesOnScaleChange,
highDpiVectorPixelsMatchDirectPaint). Incremental-layout tests removed with the feature.

Full Changelog: v0.2.21...v0.2.22