Extract UI state and Win32 window shell
This commit is contained in:
@@ -656,68 +656,16 @@ void NodeStrokePreview::draw_stroke_immediate()
|
||||
.mvp = ortho_proj,
|
||||
});
|
||||
const bool copy_stroke_destination = pass_orchestration.copy_stroke_destination;
|
||||
const auto& material = pass_orchestration.material;
|
||||
pp::panopainter::setup_legacy_stroke_shader(pass_orchestration.stroke_shader);
|
||||
|
||||
const bool sequence_ok = pp::panopainter::execute_legacy_node_stroke_preview_immediate_pass_sequence(
|
||||
pp::panopainter::LegacyNodeStrokePreviewImmediatePassSequenceRequest {
|
||||
.execute_dual_pass = [&] {
|
||||
if (!pass_orchestration.material.dual_pass.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
pp::panopainter::setup_legacy_stroke_dual_shader(
|
||||
pass_orchestration.material.dual_pass.uses_pattern);
|
||||
bind_stroke_preview_dual_pass_textures(*dual_brush);
|
||||
execute_stroke_draw_immediate_dual_pass(
|
||||
m_dual_stroke,
|
||||
*b,
|
||||
pass_orchestration,
|
||||
std::move(dual_brush),
|
||||
copy_stroke_destination,
|
||||
zoom,
|
||||
size);
|
||||
},
|
||||
.capture_background = [&] {
|
||||
execute_stroke_preview_background_capture_pass(
|
||||
size,
|
||||
pass_orchestration.background_colorize,
|
||||
m_tex_background,
|
||||
[&] {
|
||||
m_plane.draw_fill();
|
||||
});
|
||||
},
|
||||
.execute_main_live_pass = [&]() -> bool {
|
||||
return pp::panopainter::execute_legacy_node_stroke_preview_main_live_pass(
|
||||
make_stroke_draw_immediate_main_live_pass_request(
|
||||
m_stroke,
|
||||
*b,
|
||||
pass_orchestration,
|
||||
copy_stroke_destination,
|
||||
zoom,
|
||||
size));
|
||||
},
|
||||
.execute_final_composite = [&]() -> bool {
|
||||
return pp::panopainter::execute_legacy_node_stroke_preview_final_composite(
|
||||
size,
|
||||
glm::vec2(b->m_pattern_scale),
|
||||
*b,
|
||||
material.composite_pass,
|
||||
m_tex_background,
|
||||
m_tex,
|
||||
m_tex_dual,
|
||||
m_tex_preview,
|
||||
m_sampler_linear,
|
||||
m_sampler_linear_repeat,
|
||||
[&] {
|
||||
b->m_pattern_texture ? b->m_pattern_texture->bind() : unbind_texture_2d();
|
||||
},
|
||||
[&] {
|
||||
m_plane.draw_fill();
|
||||
});
|
||||
},
|
||||
});
|
||||
assert(sequence_ok);
|
||||
execute_stroke_draw_immediate_pass_sequence(
|
||||
m_stroke,
|
||||
m_dual_stroke,
|
||||
*b,
|
||||
std::move(dual_brush),
|
||||
pass_orchestration,
|
||||
copy_stroke_destination,
|
||||
zoom,
|
||||
size);
|
||||
|
||||
m_rtt.unbindFramebuffer();
|
||||
|
||||
@@ -811,6 +759,78 @@ void NodeStrokePreview::execute_stroke_draw_immediate_dual_pass(
|
||||
});
|
||||
}
|
||||
|
||||
void NodeStrokePreview::execute_stroke_draw_immediate_pass_sequence(
|
||||
Stroke& stroke,
|
||||
Stroke& dual_stroke,
|
||||
const Brush& brush,
|
||||
std::shared_ptr<Brush> dual_brush,
|
||||
const pp::panopainter::LegacyNodeStrokePreviewPassOrchestrationPlan& pass_orchestration,
|
||||
bool copy_stroke_destination,
|
||||
float zoom,
|
||||
const glm::vec2& size)
|
||||
{
|
||||
const auto& material = pass_orchestration.material;
|
||||
const bool sequence_ok = pp::panopainter::execute_legacy_node_stroke_preview_immediate_pass_sequence(
|
||||
pp::panopainter::LegacyNodeStrokePreviewImmediatePassSequenceRequest {
|
||||
.execute_dual_pass = [&] {
|
||||
if (!material.dual_pass.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
pp::panopainter::setup_legacy_stroke_dual_shader(
|
||||
material.dual_pass.uses_pattern);
|
||||
bind_stroke_preview_dual_pass_textures(*dual_brush);
|
||||
execute_stroke_draw_immediate_dual_pass(
|
||||
dual_stroke,
|
||||
brush,
|
||||
pass_orchestration,
|
||||
std::move(dual_brush),
|
||||
copy_stroke_destination,
|
||||
zoom,
|
||||
size);
|
||||
},
|
||||
.capture_background = [&] {
|
||||
execute_stroke_preview_background_capture_pass(
|
||||
size,
|
||||
pass_orchestration.background_colorize,
|
||||
m_tex_background,
|
||||
[&] {
|
||||
m_plane.draw_fill();
|
||||
});
|
||||
},
|
||||
.execute_main_live_pass = [&]() -> bool {
|
||||
return pp::panopainter::execute_legacy_node_stroke_preview_main_live_pass(
|
||||
make_stroke_draw_immediate_main_live_pass_request(
|
||||
stroke,
|
||||
brush,
|
||||
pass_orchestration,
|
||||
copy_stroke_destination,
|
||||
zoom,
|
||||
size));
|
||||
},
|
||||
.execute_final_composite = [&]() -> bool {
|
||||
return pp::panopainter::execute_legacy_node_stroke_preview_final_composite(
|
||||
size,
|
||||
glm::vec2(brush.m_pattern_scale),
|
||||
brush,
|
||||
material.composite_pass,
|
||||
m_tex_background,
|
||||
m_tex,
|
||||
m_tex_dual,
|
||||
m_tex_preview,
|
||||
m_sampler_linear,
|
||||
m_sampler_linear_repeat,
|
||||
[&] {
|
||||
brush.m_pattern_texture ? brush.m_pattern_texture->bind() : unbind_texture_2d();
|
||||
},
|
||||
[&] {
|
||||
m_plane.draw_fill();
|
||||
});
|
||||
},
|
||||
});
|
||||
assert(sequence_ok);
|
||||
}
|
||||
|
||||
void NodeStrokePreview::execute_stroke_draw_immediate_main_live_sample_pass(
|
||||
const Brush& brush,
|
||||
bool copy_stroke_destination,
|
||||
|
||||
Reference in New Issue
Block a user