Clean retained stroke extraction build

This commit is contained in:
2026-06-14 10:23:29 +02:00
parent 8f02e39058
commit be42224561
13 changed files with 658 additions and 287 deletions

View File

@@ -1315,6 +1315,7 @@ pp::foundation::Result<CanvasBlendGatePlan> plan_canvas_blend_gate(
CanvasBlendGateRequest request) noexcept
{
CanvasBlendGatePlan gate;
pp::paint::BlendMode first_complex_layer_blend = pp::paint::BlendMode::normal;
for (std::size_t i = 0; i < request.layer_blend_modes.size(); ++i) {
pp::paint::BlendMode layer_blend = pp::paint::BlendMode::normal;
@@ -1331,21 +1332,10 @@ pp::foundation::Result<CanvasBlendGatePlan> plan_canvas_blend_gate(
continue;
}
gate.shader_blend = true;
gate.complex_blend = true;
gate.first_complex_layer_index = static_cast<int>(i);
const auto stroke = plan_stroke_composite(
features,
StrokeCompositeRequest {
.extent = request.extent,
.layer_blend_mode = layer_blend,
});
if (stroke) {
apply_stroke_plan(gate, stroke.value());
} else {
gate.compatibility_fallback = true;
if (gate.first_complex_layer_index < 0) {
gate.first_complex_layer_index = static_cast<int>(i);
first_complex_layer_blend = layer_blend;
}
return pp::foundation::Result<CanvasBlendGatePlan>::success(gate);
}
pp::paint::StrokeBlendMode stroke_blend = pp::paint::StrokeBlendMode::normal;
@@ -1363,7 +1353,8 @@ pp::foundation::Result<CanvasBlendGatePlan> plan_canvas_blend_gate(
gate.dual_brush_complex = request.dual_brush_blend;
gate.pattern_complex = request.pattern_blend;
if (!gate.stroke_complex && !gate.dual_brush_complex && !gate.pattern_complex) {
const bool layer_complex = gate.first_complex_layer_index >= 0;
if (!layer_complex && !gate.stroke_complex && !gate.dual_brush_complex && !gate.pattern_complex) {
return pp::foundation::Result<CanvasBlendGatePlan>::success(gate);
}
@@ -1373,6 +1364,7 @@ pp::foundation::Result<CanvasBlendGatePlan> plan_canvas_blend_gate(
features,
StrokeCompositeRequest {
.extent = request.extent,
.layer_blend_mode = first_complex_layer_blend,
.stroke_blend_mode = stroke_blend,
.dual_brush_blend = request.dual_brush_blend,
.pattern_blend = request.pattern_blend,