Plan live stroke rasterization boundaries

This commit is contained in:
2026-06-12 22:13:21 +02:00
parent 57c6128d11
commit 81726d30a5
8 changed files with 348 additions and 22 deletions

View File

@@ -0,0 +1,35 @@
#pragma once
#include "paint_renderer/compositor.h"
#include "renderer_api/renderer_api.h"
#include <algorithm>
#include <cstdint>
namespace pp::panopainter {
[[nodiscard]] inline pp::paint_renderer::CanvasStrokeRasterizationPlan plan_legacy_canvas_stroke_rasterization(
pp::renderer::RenderDeviceFeatures features,
int width,
int height) noexcept
{
const auto plan = pp::paint_renderer::plan_canvas_stroke_rasterization(
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::CanvasStrokeRasterizationPlan fallback;
fallback.feedback.compatibility_fallback = true;
fallback.feedback.path = pp::paint_renderer::StrokeCompositePath::ping_pong_textures;
fallback.feedback.requires_auxiliary_texture = true;
fallback.copy_stroke_destination = true;
fallback.compatibility_fallback = true;
return fallback;
}
} // namespace pp::panopainter