Route stroke preview checkerboard setup through helper

This commit is contained in:
2026-06-13 05:13:18 +02:00
parent 14a6fc2e57
commit ac78358022
3 changed files with 16 additions and 4 deletions

View File

@@ -6,6 +6,7 @@
#include "bezier.h"
#include "canvas.h"
#include "app.h"
#include "legacy_canvas_draw_merge_services.h"
#include "legacy_canvas_stroke_composite_services.h"
#include "legacy_canvas_stroke_execution_services.h"
#include "legacy_canvas_stroke_preview_services.h"
@@ -517,10 +518,12 @@ void NodeStrokePreview::draw_stroke_immediate()
pp::panopainter::execute_legacy_stroke_preview_background_capture(
[&] {
// copy background color to tex2
ShaderManager::use(kShader::Checkerboard);
ShaderManager::u_int(kShaderUniform::Colorize, b->m_tip_mix > 0.f || b->m_blend_mode != 0);
float aspect = size.x / size.y;
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f / aspect, .5f / aspect, -1.f, 1.f));
const float aspect = size.x / size.y;
pp::panopainter::setup_legacy_canvas_draw_merge_checkerboard_shader(
pp::panopainter::LegacyCanvasDrawMergeCheckerboardUniforms {
.mvp = glm::ortho(-.5f, .5f, -.5f / aspect, .5f / aspect, -1.f, 1.f),
.colorize = b->m_tip_mix > 0.f || b->m_blend_mode != 0,
});
},
[&] {
m_plane.draw_fill();