Extract stroke mix shell wrapper
This commit is contained in:
@@ -405,26 +405,22 @@ void Canvas::stroke_draw_mix(const glm::vec2& bb_min, const glm::vec2& bb_sz)
|
||||
const auto& b = m_current_stroke->m_brush;
|
||||
const auto mix_shell = pp::panopainter::make_legacy_canvas_stroke_mix_pass_shell(
|
||||
[&] {
|
||||
m_mixer.bindFramebuffer();
|
||||
apply_canvas_viewport(0, 0, m_mixer.getWidth(), m_mixer.getHeight());
|
||||
apply_canvas_capability(depth_test_state(), false);
|
||||
apply_canvas_capability(scissor_test_state(), true);
|
||||
apply_canvas_capability(blend_state(), false);
|
||||
apply_canvas_scissor(
|
||||
static_cast<std::int32_t>(bb_min.x),
|
||||
static_cast<std::int32_t>(bb_min.y),
|
||||
static_cast<std::int32_t>(bb_sz.x),
|
||||
static_cast<std::int32_t>(bb_sz.y));
|
||||
},
|
||||
m_mixer.bindFramebuffer();
|
||||
apply_canvas_viewport(0, 0, m_mixer.getWidth(), m_mixer.getHeight());
|
||||
apply_canvas_capability(depth_test_state(), false);
|
||||
apply_canvas_capability(scissor_test_state(), true);
|
||||
apply_canvas_capability(blend_state(), false);
|
||||
apply_canvas_scissor(
|
||||
static_cast<std::int32_t>(bb_min.x),
|
||||
static_cast<std::int32_t>(bb_min.y),
|
||||
static_cast<std::int32_t>(bb_sz.x),
|
||||
static_cast<std::int32_t>(bb_sz.y));
|
||||
},
|
||||
[&] {
|
||||
m_mixer.unbindFramebuffer();
|
||||
});
|
||||
[[maybe_unused]] const auto mix_result =
|
||||
pp::panopainter::execute_legacy_canvas_stroke_mix_pass_shell(
|
||||
mix_shell.setup.begin,
|
||||
mix_shell.setup.end,
|
||||
mix_shell.request);
|
||||
|
||||
m_mixer.unbindFramebuffer();
|
||||
});
|
||||
[[maybe_unused]] const auto mix_result = execute_canvas_stroke_mix_pass_shell(mix_shell);
|
||||
|
||||
gl.restore();
|
||||
}
|
||||
|
||||
@@ -537,6 +533,15 @@ static void execute_canvas_draw_merge_final_plane_composite(
|
||||
pp::panopainter::execute_legacy_canvas_draw_merge_final_plane_composite(uniforms, execution);
|
||||
}
|
||||
|
||||
static void execute_canvas_stroke_mix_pass_shell(
|
||||
const pp::panopainter::LegacyCanvasStrokeMixPassShell& shell)
|
||||
{
|
||||
pp::panopainter::execute_legacy_canvas_stroke_mix_pass_shell(
|
||||
shell.setup.begin,
|
||||
shell.setup.end,
|
||||
shell.request);
|
||||
}
|
||||
|
||||
glm::vec4 Canvas::stroke_draw_samples(
|
||||
int i,
|
||||
std::vector<vertex_t>& P,
|
||||
|
||||
Reference in New Issue
Block a user