Narrow stroke execution planning helpers

This commit is contained in:
2026-06-13 06:28:21 +02:00
parent 493282264d
commit 13f334ae55
8 changed files with 226 additions and 35 deletions

View File

@@ -12,11 +12,11 @@
#include "legacy_canvas_stroke_preview_services.h"
#include "legacy_canvas_stroke_shader_services.h"
#include "legacy_canvas_stroke_services.h"
#include "legacy_node_stroke_preview_execution_services.h"
#include "legacy_ui_gl_dispatch.h"
#include "paint_renderer/compositor.h"
#include "renderer_gl/opengl_capabilities.h"
#include "util.h"
#include <algorithm>
#include <array>
#include <cstdint>
@@ -31,21 +31,10 @@ pp::paint_renderer::CanvasStrokeFeedbackPlan stroke_preview_destination_feedback
int width,
int height) noexcept
{
const auto plan = pp::paint_renderer::plan_canvas_stroke_feedback(
return pp::panopainter::plan_legacy_node_stroke_preview_feedback(
stroke_preview_render_device_features(),
pp::renderer::Extent2D {
.width = static_cast<std::uint32_t>(std::max(width, 0)),
.height = static_cast<std::uint32_t>(std::max(height, 0)),
});
if (plan) {
return plan.value();
}
pp::paint_renderer::CanvasStrokeFeedbackPlan fallback;
fallback.compatibility_fallback = true;
fallback.path = pp::paint_renderer::StrokeCompositePath::ping_pong_textures;
fallback.requires_auxiliary_texture = true;
return fallback;
width,
height);
}
pp::paint_renderer::CanvasStrokeMaterialPlan stroke_preview_material_plan(
@@ -452,12 +441,10 @@ void NodeStrokePreview::draw_stroke_immediate()
const auto stroke_feedback = stroke_preview_destination_feedback_plan(m_rtt.getWidth(), m_rtt.getHeight());
const bool copy_stroke_destination = !stroke_feedback.reads_destination_color;
const auto material = stroke_preview_material_plan(*b, copy_stroke_destination);
const auto preview_composite_plan = pp::paint_renderer::plan_stroke_preview_composite(
pp::paint_renderer::StrokePreviewCompositeRequest {
.uses_mixer = b->m_tip_mix > 0.0f,
.uses_dual = material.composite_pass.use_dual,
.uses_pattern = material.composite_pass.use_pattern,
});
const auto preview_composite_plan = pp::panopainter::plan_legacy_node_stroke_preview_composite(
b->m_tip_mix > 0.0f,
material.composite_pass.use_dual,
material.composite_pass.use_pattern);
pp::panopainter::setup_legacy_stroke_shader(
pp::panopainter::LegacyStrokeShaderSetupUniforms {
.resolution = size,