`is_empty_pixel_layer` took any layer without stored tiles for empty, so a
layer opaque only through its default pixel (as KRA imports it,
`Surface::with_default`) or a blank video layer became the Pattern Fill
(and the Stamp Visible target) instead of getting one above. It now
needs a transparent default pixel (alpha only: a mode or profile
conversion gives an empty layer's default pixel other colour bytes) and
no video.
Co-authored-by: Hodd <32705043+hodd1444@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main split crates/engine/src/vector_cmds.rs into cmd/vector_cmds.rs and
cmd/vector_cmds/paths.rs, moved the shortcuts tests into
input/shortcuts/tests.rs and PhotocraftApp::run into app/commands.rs.
The PR's change is ported as it is to the new places; its text-field
test now draws the field every frame, as main's egui drops the focus of
a field that isn't drawn.
Main split the files this PR changes: transform_tool.rs into tools/transform_tool/ (begin,
commit, drag_modes, draw, pointer, tests), canvas.rs into canvas/ (display, tool_input,
transform_controls, transform_controls_tests, snap_ui), and transform_cmds.rs into
cmd/transform_cmds.rs + tests.rs. The PR's changes are carried into the new modules as they
were. One adaptation: rotate_dir on main takes the live gesture (#5405), so the shared box's
gesture is passed through a new live_gesture helper instead of the PR's `rotating` bool.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Row strips of a very wide source still allocated whole 256-row tiles
across the full width for every few rows (about 293 MiB per strip of a
300000 px RGBA8 source). Blocks are now whole tiles, at most 4096 px wide
and 1 Mpx in all, and their tiles move into the result without a copy.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Port grouped gradient browsers and style previews into current modular sidebar/options controls. Keep current transactional stop preview, drag/drop ownership and sidebar activation semantics; add compact Properties preset picker without replacing stop engine. Preserve accessibility Role metadata and all approved regressions.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Reconcile captured Pen and Freeform targets with current resumed-subpath, Type Path, Path Operation and draft recovery behavior. Valid source-owned tab switches commit to captured original target; invalid snapshots cancel with a diagnostic; refused commits retain draft and suppress automatic retries. Preserve current Saved(index) API and hidden-work-path protections, register all new ownership/gesture tests and add original-target tab-switch/deleted-target cases. Includes verified compile/API corrections from prior checkpoints.
The cap is now a function of the stored value and the target, so native
tests check values below, at and above it; the native-only assertions are
gated to native targets.
Rounding the strip height up to the compositor's 256-row tile let a very
wide source (300000 px) composite 76.8 Mpx in one strip. Strips are now as
many rows as fit in the budget, at least one; the equivalence test also
covers strips off the tile grid.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Port transparent-margin trim into current authorized streaming export report, retaining skipped-layer reasons and stable numbering. Measure alpha in bounded render bands, including masks/effects; keep empty-layer canvas and source document immutable. Preserve original regressions.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Add bounded deterministic suggestions via current error/session/control modules while preserving authorization/modal checks. Register hints and all original tests; fix scrollbar choice import and updated PSD image fixture field found by 100-head check.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Current compositor already preserves plain CMYK inks, tagged profile separation and uncropped merge bounds. Keep stronger native CMYK/Lab paths and current merge API; apply profile context to style rasterization and retain approved tagged-CMYK regression fixtures.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Port visibility preference, choice registration, live panel style and canvas override. Keep current animated camera and toolbar exclusions. Relocate misplaced persistence regression to prefs tests; retain current parity score counts.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Preserve current spatial Mixer Brush Alt-click sampling and live transaction architecture; add compatible point-sample command without foreground mutation. Retain sample across automatic reload until foreground changes and preserve all new regressions.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Port arbitrary-stop editor into current responsive dialog. Preserve source interpolation and exact model colors; unchanged dense imported snapshot lists roundtrip while edited lists retain 256-stop cap. Retain both validation guards and all original regression tests. Correct saved-path callers, floating-window and crop fixtures found by frozen 88-head all-target check.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Integrated independent exact shape paints and atomic pattern clipboard snapshots into current modules, preserving current soft-mask coverage, shape cache keys and gradient stop caps. Shared bounded COW pattern sampling now retains minification filtering; shapes/clipboards resolve lazy catalog entries to full pixels. Preserved CPU/GPU/depth/model regression matrices; also corrected missing glow-test enum imports found by the 80-head check.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Integrated bounded atomic CSH set parsing, unique shape/group naming and native Shapes panel import with inline-data authorization guards; preserved duplicate-name, inner-hole, malformed-second-record and preferences-reload regressions. Combined independent catalog additions and retained current parity metadata.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Added Alt guide rotation in current ruler/tool-input modules and engine Move Guide, retaining click-versus-drag selection, deletion on either ruler, colors, ruler-origin units and snapping. Selection follows the new orientation/index after a successful turn; original guide-turn/deletion regressions retained.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Ported Behind paint across engine/render and shared options-bar/canvas mode menus, preserving Clear and current popup ownership. Added localized responsive picker title/width and File Info multiline fields without dropping ordered fields, Browse or camera metadata; ported Pen anchor repositioning, copy cursor, grayscale-target sampling and authorized select-under-cursor dispatch into current modules with original regressions.
The default Memory Usage is 8 GiB per document, above the 4 GiB a
wasm module can address, so on the web the History budget could never
be reached and trimming never ran.
Performance::effective_memory_usage_mb caps the stored preference at
1536 MB on wasm32 and returns it unchanged elsewhere. The History
budget, the transform budget and the canvas allowance in the UI read
it. The stored preference and its default are untouched, so a saved
8192 still loads and still means 8192 on desktop.
History counted a document's pixel tiles but not the file bytes a
smart object embeds (SmartSource::Embedded). A document of large
embedded sources was far over its memory budget without trimming
ever noticing, and every Replace Contents kept the old bytes alive in
the undo states unaccounted.
The four counters (add, remove, bytes_with and the uncounted walk)
now visit one shared list of blocks: the tiles as before plus each
embedded source's Arc, keyed by address. States, snapshots and
duplicated layers that share an Arc count it once, and trimming the
last state that holds an old source releases it.
The cache estimated an entry at channels * 4 bytes a pixel, four times
too much for 8-bit, always kept a single oversize entry, recovered a
poisoned lock by disabling itself, and nothing ever cleared it.
Count each entry's real tile bytes once when it is cached, and do not
cache a source larger than the whole budget (as the stage cache does).
Web builds keep 4 entries and 384 MiB instead of 32 and 1 GiB, and the
smart filter stage cache 256 MiB instead of 768 MiB. A poisoned lock
is recovered rather than ignored.
Edit > Purge > All now clears the cache and reports it, and enables on
it alone. Closing a document that has smart objects clears it too:
entries are shared by content hash, so other documents just decode
again on their next re-render.
The first re-render of a smart object (Free Transform commit, Image
Size, a filter edit) flattened its source into one full-size RGBA
float buffer (16 bytes a pixel) and then converted it into a second
f32 vector before the surface was built, about 32 bytes a pixel on top
of the decoded document.
Composite the source in strips of about a megapixel straight into the
target pixel format instead. RGB, Grayscale and the depth conversions
give the same pixels as before (checked bit for bit, including masks,
blend modes and layer effects). CMYK and Lab composite natively in the
banded compositor and land up to 16 and 1 steps (8-bit) off the buffer
path, so sources in those modes keep the buffer path.
A 4096x4096 RGBA8 source now peaks +191 MiB (12.0 B/px) instead of
+655 MiB (41.0 B/px); tests/smart_source_peak.rs holds it under 16 B/px.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Ported hanging punctuation into current line placement and kerning modules, preserving forced breaks, bounded edge-tip row merging, justified-last-line behavior, area exclusions and independent Roman orientation shaping; kept PSD/engine/UI regression coverage.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Ported upright Roman classification, independent unkerned/unligated em advances and tab reflow into current Para/VerticalPiece shaping modules; preserved area and paragraph flow; retained vertical geometry and PSD BaselineDirection regressions.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Ported mappings and smart Save into current modules, preserving bounded authorized playback; migrated legacy PAT by committing validated per-pattern assets before atomic authoritative index; preserved same-ID replacements and builtin edits; added temporary-store interruption, corruption, duplicate ID/name and restart regression coverage. Current all-target compilation passed before final ownership guard refinement; focused tests pending.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Preflight existing render-cap helper before allocation, retain post-render completeness checks, and preserve the oversized Trim/Duplicate atomic-refusal regression.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Reuse current ExactLong refusal for Ripple/Crystallize, preserve command-specific rounding rules, improve the diagnostic and retain all fractional/whole-value regression cases.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Persist and restore Color panel options through the current dock/startup modules and regenerate the scorecard from current source.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Port responsive three-column Layer Style with owned right-side actions, preserve saved defaults/Blend If and current Curves/modal routing, and keep all original layout/Cancel tests registered.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Register starter actions and bounded background-blur command in current modules; preserve persistent migration marker and portable JSON defaults compatibility.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Resolve recorded visibility targets before both engine and shell authorization, preserving bounded playback, paused dialogs and existing journal coalescing; retain ActionState take generation.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Keep action-definition undo separate from document history and preserve upstream panel routing and layout.
Port behavior and regression coverage into current modules; preserve current upstream behavior.
Register bounded Actions JSON module in current command tree; preserve all ambient path restrictions and inline-data allowances with regressions.