76 Commits

Author SHA1 Message Date
daiqingshuang
5a8d62f841 Refactor Push Constants and Add Dual Stage Support
- Removed legacy push constant structures and functions for better clarity and maintainability.
- Introduced new `text_push_constants_t` structure for text rendering with optimized layout.
- Implemented dual stage push constant analysis to support separate layouts for vertex and fragment shaders.
- Added functions to generate push constant structures and fill functions based on shader reflection.
- Enhanced static checks for push constant layouts to ensure compatibility and correctness.
- Updated templates to accommodate new dual stage push constant generation.
- Added support detection for procedural vertex shaders based on push constant layout.
2025-12-25 21:04:39 +08:00
daiqingshuang
630864663a 完全迁移mask到新框架,移除非必要的新框架迁移 2025-12-25 17:18:11 +08:00
023f8099f0 Refactor shader widget system and add new post-processing effects
- Removed the existing procedural_shader_widget.h file and re-added it with minor adjustments.
- Introduced new blur_widget.h for Gaussian blur effects with customizable parameters.
- Added chromatic_aberration_widget.h to implement chromatic aberration effects.
- Created color_adjust_widget.h for color adjustments including brightness, contrast, saturation, and gamma.
- Implemented color_tint_widget.h for tint mapping effects with various blending modes.
- Added noise_widget.h for film grain noise effects, supporting static and animated modes.
- Introduced vignette_widget.h for vignette effects with adjustable radius, softness, and tint color.
- Created effects.h to consolidate all new effect widgets for easier inclusion.
2025-12-25 03:43:38 +08:00
bd8c71badd 放开push_constant限制,现在每个着色器可以更自由的配置布局 2025-12-25 03:37:50 +08:00
8a8ec6e4a8 Refactor render tree executor and custom shader widget renderer for dynamic descriptor layouts
- Removed debug output statements from render_tree_executor.cpp to clean up the code.
- Updated custom_shader_widget_renderer.cpp to prevent placeholder allocation for uniform buffers, ensuring correct descriptor updates.
- Simplified effect rectangle setting in custom_shader_widget_base.cpp by removing debug outputs.
- Adjusted descriptor binding logic in post_process_shader_widget.h for clarity and consistency.
- Introduced a comprehensive design document for dynamic descriptor layout creation, addressing existing limitations and outlining a new architecture for descriptor management.
2025-12-24 22:38:53 +08:00
9f1f798880 修复无法渲染后效 2025-12-24 22:24:35 +08:00
daiqingshuang
facb725a93 TODO 重构自定义着色器控件 2025-12-24 13:05:33 +08:00
9cbba518ec TODO 修复后效渲染Bug 2025-12-24 03:15:55 +08:00
d87c53336b Refactor rendering pipeline by removing post effect applicator
- Removed references to `post_effect_applicator` from `render_tree_executor.h`, `shared_render_resources.cpp`, and `shared_render_resources.h`.
- Eliminated `post_effect_command_t` and related functions from `render_collector.cpp` and `render_collector.h`.
- Deleted `post_process.h` and its associated implementation, simplifying the widget structure.
- Updated custom shader widgets to reflect changes in effect handling.
- Adjusted various widget classes to remove unused intrinsic size methods.
- Enhanced shader generation templates to include push constant base member information for better validation.
2025-12-24 01:35:24 +08:00
daiqingshuang
18e7ef0113 实现自动根据显卡类型设置NvidiaNativePresent,但需要重启应用程序 2025-12-23 11:51:54 +08:00
4f8695c94b fix(tooltip): adjust tooltip font size and improve code formatting 2025-12-22 23:24:43 +08:00
daiqingshuang
7de09daeb1 feat: Enhance glyph caching and tooltip management
- Added a new atomic cache versioning system to track glyph updates in glyph_cache.
- Introduced methods to check for pending glyph tasks and retrieve the current cache version.
- Improved text shaping logic to estimate glyph advances for unready glyphs, ensuring smoother rendering.
- Refactored render_thread to focus on a single target window for rendering, enhancing performance.
- Updated thread_coordinator to manage window IDs and ensure proper rendering context.
- Implemented a new tooltip management system using render_window for better rendering control.
- Enhanced tooltip display logic to dynamically create and resize tooltip windows based on content.
- Added functionality to pre-request glyphs for tooltips to ensure they are ready when displayed.
- Improved window management with additional methods for setting position, resizing, and visibility checks.
2025-12-18 14:05:36 +08:00
daiqingshuang
fb57d69456 封装窗口渲染循环 2025-12-17 20:04:12 +08:00
daiqingshuang
4fd98b32e3 文件夹整理 2025-12-17 19:21:16 +08:00
daiqingshuang
1344d36e9b 文件夹整理 2025-12-17 16:43:22 +08:00
daiqingshuang
94ca0875b0 文件夹整理 2025-12-16 14:00:16 +08:00
3629038519 fix(render): 修复纹理加载路径并更新渲染通道管理逻辑 2025-12-15 19:48:47 +08:00
daiqingshuang
a9dca86506 feat: Implement tooltip manager and window widget
- Added tooltip_manager class to manage tooltip display and hiding with delay.
- Introduced tooltip_window_widget for rendering tooltips in a floating window.
- Created tooltip_types.h for tooltip configuration and position enums.
- Implemented padding_wrapper for inner padding in tooltip content.
- Added methods for showing tooltips near widgets and at specific screen positions.
- Integrated content management for tooltips, including text and custom widgets.
- Enhanced layout and rendering logic for tooltip windows.
2025-12-15 19:26:18 +08:00
6d0db27d0b feat: 添加剪贴板支持和IME管理功能,更新相关接口和实现 2025-12-13 15:49:06 +08:00
702629bac3 Implement text model and selection management for UTF-32 text handling
- Added `text_model` class to manage text content and selection state, supporting UTF-32 storage for accurate character-level operations.
- Implemented UTF-8 to UTF-32 conversion functions for seamless text input.
- Introduced `text_selection` class to represent selection ranges using anchor/focus model.
- Added methods for text insertion, deletion, and selection management, including word boundary detection.
- Implemented maximum length constraints for text input.
- Provided callback mechanism for text change notifications.
2025-12-13 13:06:46 +08:00
db2755256b Refactor event handling by eliminating event_target interface
- Merged event_target functionality into widget_base to simplify class hierarchy and reduce complexity.
- Updated focus_manager, ime_manager, shortcut_manager, and widget_event_router to use widget_base instead of event_target.
- Removed redundant event_target inheritance from various widget classes, including overlay and scrollbar.
- Ensured proper event bubbling and visibility management by utilizing widget_base's parent pointer.
- Cleaned up related documentation and updated method signatures across the codebase.
2025-12-12 22:39:13 +08:00
daiqingshuang
9023922ef7 Refactor widget framework for thread safety and state management
- Updated v_stack.h to use threading::main_property for spacing management, ensuring automatic dirty marking on changes.
- Enhanced render_collector.h with threading::thread_bound for thread safety, added documentation for thread usage.
- Modified widget_state.h to include previous_aabb for dirty region calculations.
- Implemented update_previous_aabb method in widget_state_store to track previous AABB for widgets.
- Refactored viewport_cache to utilize threading::main_property for caching and visibility management.
- Updated widget_base.h to use threading::main_property for widget attributes, ensuring thread-safe access.
- Enhanced widget_context.h with threading::property for managing state changes.
- Refactored imager and scrollbar widgets to utilize new property management for state consistency.
- Added comprehensive documentation for thread safety and usage across the widget framework.
2025-12-12 14:04:40 +08:00
8dafa1662b feat(threading): Implement comprehensive threading framework
- Introduced `thread_bound` class for binding data to specific threads with compile-time and runtime safety checks.
- Added `thread_context` for managing and verifying thread identities using thread-local storage.
- Developed `thread_dispatcher` to facilitate task scheduling across different threads, including main, layout, and render threads.
- Defined thread tags (`main_thread_tag`, `layout_thread_tag`, `render_thread_tag`, `any_thread_tag`) for type-safe thread identification.
- Created `version_manager` and `version_tracker` for tracking and managing versioning of data sources, enabling efficient change detection and updates.
- Enhanced documentation with usage examples for each component, promoting ease of integration and understanding of the threading framework.
2025-12-12 10:01:33 +08:00
036763ef87 fix: 修复纹理加载路径和文本渲染器初始化,调整抗锯齿宽度 2025-12-11 22:43:42 +08:00
daiqingshuang
2d2c58ed65 Refactor test structure and remove obsolete tests
- Removed `render_tree_builder` and `render_tree_integration` test directories and their associated CMakeLists and source files.
- Updated `CMakeLists.txt` to exclude the removed test directories.
- Modified buffer creation templates to include `vk::Result` in expected return types for better error handling.
2025-12-11 01:47:46 +08:00
daiqingshuang
212968434e feat: Implement scroll_box container with smooth scrolling and scrollbar management
- Added scroll_box class to manage scrolling of content exceeding viewport size.
- Introduced scroll_state class to encapsulate scrolling state and calculations.
- Created scrollbar_manager class to handle scrollbar creation, layout, and updates.
- Developed smooth_scroll_animator class for smooth scrolling animations with easing functions.
- Enhanced child widget management using slots and improved event handling.
- Utilized C++23 features for better code structure and readability.
- Implemented various scrolling modes: vertical, horizontal, and both.
- Added methods for setting scroll offsets, scrolling to specific positions, and querying scroll properties.
2025-12-08 18:18:00 +08:00
daiqingshuang
3b90ba2c1b feat: 更新目标帧率配置为可选,支持使用屏幕刷新率,优化渲染线程超时计算 2025-12-08 17:54:59 +08:00
daiqingshuang
6539d59b8a feat: 优化交换链配置和帧同步机制,调整目标帧率和多线程设置 2025-12-08 17:20:20 +08:00
daiqingshuang
65ed021c7e feat: 添加自适应同步和三缓冲支持,优化渲染配置 2025-12-08 16:22:55 +08:00
daiqingshuang
91dc9a119b feat: Optimize rendering commands and visibility management
- Implemented binary search optimization for rendering commands in HStack and VStack to improve performance when rendering child widgets.
- Enhanced ScrollBox to only tick child widgets that are within the viewport, reducing unnecessary updates.
- Introduced a viewport cache to manage visibility states of widgets, allowing for efficient visibility checks and updates.
- Updated dirty state management in widget states to use a more structured approach with a new dirty_state enum, improving clarity and functionality.
- Added methods to invalidate and manage viewport cache, ensuring that visibility states are accurately maintained during layout changes.
- Marked widgets for re-rendering when their properties change, ensuring visual updates are reflected correctly.
2025-12-08 14:08:13 +08:00
66d4a07631 feat: enable vsync in application configuration 2025-12-07 22:47:21 +08:00
571f27711b TODO 多线程渲染 2025-12-07 13:11:02 +08:00
f51db4f755 feat: 在新渲染管线示例中添加插入树方法调用以支持控件初始化
refactor: 移除后效应用器中的调试模式设置方法
2025-12-07 00:29:04 +08:00
9c09d9d663 feat: implement scrollbar widget with vertical and horizontal orientations
- Added `scrollbar` class to support both vertical and horizontal scrolling.
- Implemented measurement and arrangement logic for scrollbar dimensions.
- Created rendering commands for track and thumb, including hover and active states.
- Added mouse event handling for dragging the thumb and updating scroll values.
- Introduced style configuration for scrollbar appearance, including colors and dimensions.
- Added methods to set scroll range, current value, viewport size, and content size.
- Implemented visibility strategies for the scrollbar (always, auto-hide, never).
2025-12-06 18:19:20 +08:00
d2ddf08d05 feat: Introduce renderable state for widgets and add debug rendering capabilities
- Changed visibility checks to renderable checks in various widget classes to improve rendering logic.
- Added a debug mode in post_effect_applicator to visualize widget boundaries with red rectangles.
- Implemented a new scroll_box widget to support scrolling functionality for overflowing content.
- Enhanced render_collector with a method to submit debug rectangles for visual debugging.
- Updated widget_base to manage renderable state instead of visibility.
- Refactored related widget classes to utilize the new renderable state for rendering decisions.
2025-12-06 17:41:44 +08:00
ec75b9f7e2 refactor: Update alignment enum values to lowercase and optimize measurement logic in layout components 2025-12-05 23:36:37 +08:00
daiqingshuang
08c58bdb46 加大视差效果使其更明显 2025-12-05 17:31:08 +08:00
daiqingshuang
6089d34524 修复示例程序布局不正确 2025-12-05 17:12:02 +08:00
daiqingshuang
48b5efeccc 修复多后处理渲染错误 2025-12-05 16:59:14 +08:00
06e68f60f6 feat: Enhance render tree executor with backdrop filter support and optimize mask rendering paths 2025-12-04 23:14:23 +08:00
daiqingshuang
e0ce5252fc feat: Add post-process widget with multiple effects including blur, vignette, chromatic aberration, noise, color adjust, and color tint 2025-12-04 21:48:30 +08:00
daiqingshuang
5650ac199b feat: Enhance mask widget with multiple shape support and rendering commands 2025-12-04 17:24:30 +08:00
daiqingshuang
324a1b0ef7 feat: Add image scaling modes and widget tree creation for improved layout management 2025-12-04 15:30:47 +08:00
daiqingshuang
f7cf872ffa feat: Introduce new widget system with container and slot management for flexible UI layouts 2025-12-04 15:16:32 +08:00
daiqingshuang
40ed585a43 修复渲染流程中的 begin_render_no_transition 调用,改为使用 begin_render 以确保状态正确更新;在 render_tree_executor 中添加对 Mask Pass 的支持,优化后效应用逻辑。 2025-12-03 14:13:31 +08:00
daiqingshuang
539d35d01d 重构渲染流程,使用render_tree来保证嵌套后效正确 2025-12-03 12:22:58 +08:00
daiqingshuang
059c3278a7 feat: Add Stencil Mask Renderer for advanced masking capabilities
- Introduced `stencil_mask_renderer` class to handle stencil masking operations.
- Implemented initialization, cleanup, and frame management methods.
- Added shader modules for stencil mask vertex and fragment shaders.
- Created pipelines for stencil writing and clearing.
- Enhanced existing layout and container helper functions to support new stretch-aware modifiers.
- Updated relevant files to integrate the new stencil mask renderer into the rendering pipeline.
- Refactored modifier traits to simplify stretch modifier checks.
2025-12-02 18:32:35 +08:00
daiqingshuang
6293a230a4 重构布局修饰器基类,简化子控件管理,增强类型检测和事件处理功能,新增容器辅助函数 2025-12-02 12:57:21 +08:00
daiqingshuang
9177f953fe 优化布局修饰器和后效控件,更新管道语法示例,修复清除颜色值为透明,重构遮罩修饰器以支持新功能 2025-12-02 11:17:39 +08:00
daiqingshuang
b01cf247ec Refactor mask widget and renderer for improved functionality and performance
- Removed the MASK_WIDGET_DESIGN.md documentation file as it is no longer needed.
- Updated the example pipeline to modify the corner radius of the rounded rectangle mask.
- Enhanced the mask renderer to correctly calculate UV coordinates based on viewport size for better rendering accuracy.
- Changed the get_mask_params method in circle_mask, rect_mask, and rounded_rect_mask to accept bounds by reference for efficiency.
- Adjusted the mask factory function to ensure correct parameter order.
- Refactored corner_radius method in rounded_rect_mask to accept a rect_corner_radius structure for more flexible corner radius settings.
2025-12-01 13:17:38 +08:00