feat(wallpaper): animation rotation engine#14
Closed
Charliechen114514 wants to merge 4 commits into
Closed
Conversation
The resource-pack discovery (PR #13) landed; the wallpaper layer still swaps images instantly with no timed rotation or transition animation. Add a self-contained handoff doc for the next batch: porting CCIMXDesktop's WallPaperEngine + WallPaperAnimationHandler (Fixed/Gradient/Movement + QTimer), re-expressed for CFDesktop's backend-agnostic WallPaperLayer — compose old+new QImage per frame driven by QPropertyAnimation, repaint each frame, instead of CCIMXDesktop's QLabel double-buffer. - new document/todo/desktop/wallpaper_animation_engine.md: context, source references, target architecture, step-by-step todos, config keys, constraints (three-layer/doxygen/ownership/no-silent-fallback/ perf), verification, open decisions, file cheat-sheet. - 13_widget_apps.md: wallpaper section points to the new plan. - status/current.md: the "deferred to next batch" line now links to it.
Port CCIMXDesktop's WallPaperEngine + animation handler semantics into CFDesktop's backend-agnostic wallpaper layer, re-expressed as per-frame QImage compositing instead of QLabel double-buffering. - TransitionComposer: pure composeTransitionFrame() blends prev+cur per progress for Gradient (cross-fade), Movement (slide), Fixed. - WallPaperEngine: config-driven QTimer rotation with Sequential/Random selectors (selectNextWallpaper pure fn) and size/Fixed/disable guards. - WallPaperAccessStorage: add tokenIds() for the Random selector. - WallpaperShellLayerStrategy: transition state machine driven by QVariantAnimation; beginTransition arms state, the layer switch fires onWallpaperChanged which runs the per-frame animation. triggerNextWallpaper reuses the path for future manual switching. - wallpaper_setup: make_layer() reads scaling/background_color from config (previously hard-coded zombie keys). - Config: 6 new switch_* keys in WALLPAPER_CONFIG_TEMPLATE. - Tests: 16 cases (composer/selector/engine), all green; full suite 13/13.
- wallpaper_animation_engine.md: status -> done; append implementation record (files, 3 doc corrections, decisions, engineering choices, verification). - status/current.md: wallpaper line reflects the landed engine. - 13_widget_apps.md: wallpaper rotation section marked landed.
composeTransitionFrame allocated a new target-sized QImage (~8MB at 1080p) and filled it black on every animation frame — ~1GB of malloc/free over a 120-frame transition, the main source of stutter. - Add composeTransitionFrameInto(dst, ...) that composes in place with no fill (prev+cur fully cover dst for every mode). - WallpaperShellLayerStrategy::composeFrame now writes back into cached_scaled_image, reusing the buffer (first write detaches once, subsequent frames are in place). - composeTransitionFrame (test convenience) becomes fill + composeInto, so existing unit tests are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CFDesktop's wallpaper layer swapped images instantly with no transition or timed rotation. This ports CCIMXDesktop's
WallPaperEngine+ animation handler semantics, re-expressed as backend-agnostic per-frameQImagecompositing (noQLabel/QWidgetcoupling), driven through the shell layer strategy. Includes a follow-up perf pass to remove per-frame allocation.Changes
TransitionComposer(new): purecomposeTransitionFrame()/composeTransitionFrameInto()blend prev+cur per progress for Gradient (cross-fade) / Movement (slide) / Fixed.WallPaperEngine(new): config-drivenQTimerrotation with Sequential/Random selectors (selectNextWallpaperpure fn) andsize()>1/ Fixed /disable_animationguards.WallPaperAccessStorage: addtokenIds()for the Random selector.WallpaperShellLayerStrategy: transition state machine driven byQVariantAnimation;beginTransitionarms state, the layer switch firesonWallpaperChangedwhich runs the per-frame animation;triggerNextWallpaper()reuses the path for a future chooser UI.wallpaper_setup:make_layer()readsscaling/background_colorfrom config (previously hard-coded zombie keys).switch_*keys inWALLPAPER_CONFIG_TEMPLATE(desktop_settings.template.h.in).Decisions
switch_selector), default Sequential.disable_animation(no HWTier wiring this batch).QVariantAnimation(notQPropertyAnimation) — keeps the strategy a plainIShellLayerStrategyimpl, noQObjectmulti-inheritance / MOC /Q_PROPERTY.Perf pass
composeTransitionFrameInto()writes back intocached_scaled_image(reusing the buffer — no per-frame ~8MB allocation at 1080p) and drops the redundantfill(black). First frame detaches once; subsequent frames are in-place.Verification
🤖 Generated with Claude Code