Extract canvas mask modes, preview draw pass, and node style shell

This commit is contained in:
2026-06-16 21:50:12 +02:00
parent c25af6f493
commit a2a67960c8
12 changed files with 916 additions and 557 deletions

View File

@@ -0,0 +1,51 @@
#pragma once
#include "brush.h"
#include "legacy_node_stroke_preview_execution_services.h"
#include "rtt.h"
#include "texture.h"
#include <array>
#include <functional>
#include <vector>
namespace pp::panopainter {
struct LegacyNodeStrokePreviewFrame {
glm::vec4 col {};
float flow = 0.0f;
float opacity = 0.0f;
std::array<vertex_t, 4> shapes {};
glm::vec4 mixer_rect {};
};
struct LegacyNodeStrokePreviewLiveRenderRequest {
const Brush& brush;
const LegacyNodeStrokePreviewPassOrchestrationPlan& pass_orchestration;
const LegacyNodeStrokePreviewPreparedStrokes& prepared_strokes;
Texture2D& stroke_texture;
RTT& mixer_rtt;
RTT& render_target;
Texture2D& background_texture;
Texture2D& dual_texture;
Texture2D& preview_texture;
Sampler& linear_sampler;
Sampler& repeat_sampler;
float zoom = 1.0f;
float min_flow = 0.0f;
bool copy_stroke_destination = false;
glm::vec2 size {};
std::function<void(const Brush&)> bind_dual_pass_textures;
std::function<void(bool)> capture_background;
std::function<std::vector<LegacyNodeStrokePreviewFrame>(const Stroke&, float)> compute_frames;
std::function<glm::vec4(std::array<vertex_t, 4>&, Texture2D&, bool)> draw_samples;
std::function<void(const glm::vec2&, const glm::vec2&)> draw_mix;
std::function<void()> unbind_mixer_texture;
std::function<void()> bind_pattern_texture;
std::function<void()> draw_composite;
};
[[nodiscard]] bool execute_legacy_node_stroke_preview_live_render_passes(
const LegacyNodeStrokePreviewLiveRenderRequest& request);
} // namespace pp::panopainter