Extract draw merge layer composite orchestration
This commit is contained in:
@@ -1403,9 +1403,13 @@ void Canvas::draw_merge(bool draw_checkerboard, std::array<bool, 6> faces /*= SI
|
||||
m_merge_rtt.clear();
|
||||
}
|
||||
|
||||
if (m_current_stroke && m_current_mode == kCanvasMode::Erase && m_show_tmp && m_current_layer_idx == layer_index)
|
||||
{
|
||||
pp::panopainter::execute_legacy_canvas_stroke_temporary_composite(
|
||||
pp::panopainter::execute_legacy_canvas_draw_merge_layer_composite(
|
||||
m_current_stroke && m_current_mode == kCanvasMode::Erase && m_show_tmp && m_current_layer_idx == layer_index,
|
||||
m_current_stroke && m_show_tmp && m_current_layer_idx == layer_index,
|
||||
use_blend,
|
||||
pp::panopainter::LegacyCanvasDrawMergeLayerCompositeExecution {
|
||||
.execute_temporary_erase = [&] {
|
||||
pp::panopainter::execute_legacy_canvas_stroke_temporary_composite(
|
||||
[&] {
|
||||
//ShaderManager::u_vec2(kShaderUniform::Resolution, zw(m_box) / zoom);
|
||||
//ShaderManager::u_int(kShaderUniform::Lock, m_layers[layer_index]->m_alpha_locked);
|
||||
@@ -1442,15 +1446,14 @@ void Canvas::draw_merge(bool draw_checkerboard, std::array<bool, 6> faces /*= SI
|
||||
set_active_texture_unit(0);
|
||||
m_layers[layer_index]->rtt(plane_index).unbindTexture();
|
||||
});
|
||||
}
|
||||
else if (m_current_stroke && m_show_tmp && m_current_layer_idx == layer_index)
|
||||
{
|
||||
const auto stroke_material = canvas_stroke_material_plan(*b, false);
|
||||
glm::vec2 patt_scale = glm::vec2(b->m_pattern_scale);
|
||||
if (b->m_pattern_flipx) patt_scale.x *= -1.f;
|
||||
if (b->m_pattern_flipy) patt_scale.y *= -1.f;
|
||||
},
|
||||
.execute_temporary_paint = [&] {
|
||||
const auto stroke_material = canvas_stroke_material_plan(*b, false);
|
||||
glm::vec2 patt_scale = glm::vec2(b->m_pattern_scale);
|
||||
if (b->m_pattern_flipx) patt_scale.x *= -1.f;
|
||||
if (b->m_pattern_flipy) patt_scale.y *= -1.f;
|
||||
|
||||
pp::panopainter::execute_legacy_canvas_stroke_temporary_composite(
|
||||
pp::panopainter::execute_legacy_canvas_stroke_temporary_composite(
|
||||
[&] {
|
||||
pp::panopainter::setup_legacy_stroke_composite_shader(
|
||||
pp::panopainter::LegacyStrokeCompositeUniforms {
|
||||
@@ -1512,10 +1515,9 @@ void Canvas::draw_merge(bool draw_checkerboard, std::array<bool, 6> faces /*= SI
|
||||
set_active_texture_unit(0);
|
||||
m_layers[layer_index]->rtt(plane_index).unbindTexture();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
pp::panopainter::execute_legacy_canvas_draw_merge_layer_texture(
|
||||
},
|
||||
.execute_layer_texture = [&] {
|
||||
pp::panopainter::execute_legacy_canvas_draw_merge_layer_texture(
|
||||
pp::panopainter::LegacyCanvasDrawMergeTextureAlphaUniforms {
|
||||
.mvp = ortho,
|
||||
.texture_slot = 0,
|
||||
@@ -1537,11 +1539,9 @@ void Canvas::draw_merge(bool draw_checkerboard, std::array<bool, 6> faces /*= SI
|
||||
m_layers[layer_index]->rtt(plane_index).unbindTexture();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (use_blend)
|
||||
{
|
||||
pp::panopainter::execute_legacy_canvas_draw_merge_layer_blend(
|
||||
},
|
||||
.execute_layer_blend = [&] {
|
||||
pp::panopainter::execute_legacy_canvas_draw_merge_layer_blend(
|
||||
pp::panopainter::LegacyCanvasDrawMergeLayerBlendUniforms {
|
||||
.shader = {
|
||||
.mvp = ortho,
|
||||
@@ -1584,7 +1584,8 @@ void Canvas::draw_merge(bool draw_checkerboard, std::array<bool, 6> faces /*= SI
|
||||
m_merge_rtt.unbindTexture();
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (use_blend)
|
||||
|
||||
Reference in New Issue
Block a user