Extract draw merge erase branch helper
This commit is contained in:
@@ -1439,10 +1439,10 @@ void Canvas::draw_merge(bool draw_checkerboard, std::array<bool, 6> faces /*= SI
|
||||
m_current_stroke && m_show_tmp && m_current_layer_idx == layer_index,
|
||||
use_blend,
|
||||
pp::panopainter::LegacyCanvasDrawMergeLayerCompositeExecution {
|
||||
.execute_temporary_erase = [&] {
|
||||
.execute_temporary_erase = [&] {
|
||||
pp::panopainter::execute_legacy_canvas_draw_merge_temporary_composite(
|
||||
pp::panopainter::LegacyCanvasDrawMergeTemporaryCompositeExecution {
|
||||
.setup = [&] {
|
||||
pp::panopainter::make_legacy_canvas_draw_merge_temporary_erase_composite(
|
||||
[&] {
|
||||
//ShaderManager::u_vec2(kShaderUniform::Resolution, zw(m_box) / zoom);
|
||||
//ShaderManager::u_int(kShaderUniform::Lock, m_layers[layer_index]->m_alpha_locked);
|
||||
pp::panopainter::setup_legacy_stroke_erase_shader(
|
||||
@@ -1455,12 +1455,12 @@ void Canvas::draw_merge(bool draw_checkerboard, std::array<bool, 6> faces /*= SI
|
||||
.mask_enabled = m_smask_active,
|
||||
});
|
||||
},
|
||||
.bind_samplers = [&] {
|
||||
[&] {
|
||||
m_sampler.bind(0);
|
||||
m_sampler.bind(1);
|
||||
m_sampler.bind(2);
|
||||
},
|
||||
.bind_textures = [&] {
|
||||
[&] {
|
||||
set_active_texture_unit(0);
|
||||
m_layers[layer_index]->rtt(plane_index).bindTexture();
|
||||
set_active_texture_unit(1);
|
||||
@@ -1468,17 +1468,16 @@ void Canvas::draw_merge(bool draw_checkerboard, std::array<bool, 6> faces /*= SI
|
||||
set_active_texture_unit(2);
|
||||
m_smask.rtt(plane_index).bindTexture();
|
||||
},
|
||||
.draw = [&] {
|
||||
[&] {
|
||||
m_plane.draw_fill();
|
||||
},
|
||||
.unbind_textures = [&] {
|
||||
[&] {
|
||||
m_smask.rtt(plane_index).unbindTexture();
|
||||
set_active_texture_unit(1);
|
||||
m_tmp[plane_index].unbindTexture();
|
||||
set_active_texture_unit(0);
|
||||
m_layers[layer_index]->rtt(plane_index).unbindTexture();
|
||||
},
|
||||
});
|
||||
}));
|
||||
},
|
||||
.execute_temporary_paint = [&] {
|
||||
const auto stroke_material = canvas_stroke_material_plan(*b, false);
|
||||
|
||||
Reference in New Issue
Block a user