Plan stroke preview composite sequence
This commit is contained in:
55
src/legacy_canvas_stroke_preview_services.h
Normal file
55
src/legacy_canvas_stroke_preview_services.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
namespace pp::panopainter {
|
||||
|
||||
struct LegacyStrokePreviewCopySize {
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
};
|
||||
|
||||
template <
|
||||
typename SetupCheckerboard,
|
||||
typename DrawPlane,
|
||||
typename BindBackgroundTexture,
|
||||
typename CopyFramebufferToTexture>
|
||||
void execute_legacy_stroke_preview_background_capture(
|
||||
SetupCheckerboard&& setup_checkerboard,
|
||||
DrawPlane&& draw_plane,
|
||||
BindBackgroundTexture&& bind_background_texture,
|
||||
CopyFramebufferToTexture&& copy_framebuffer_to_texture,
|
||||
LegacyStrokePreviewCopySize copy_size)
|
||||
{
|
||||
setup_checkerboard();
|
||||
draw_plane();
|
||||
bind_background_texture();
|
||||
copy_framebuffer_to_texture(0, 0, 0, 0, copy_size.width, copy_size.height);
|
||||
}
|
||||
|
||||
template <
|
||||
typename SetupCompositeShader,
|
||||
typename BindCompositeSamplers,
|
||||
typename BindCompositeInputs,
|
||||
typename DrawPlane>
|
||||
void execute_legacy_stroke_preview_final_composite(
|
||||
SetupCompositeShader&& setup_composite_shader,
|
||||
BindCompositeSamplers&& bind_composite_samplers,
|
||||
BindCompositeInputs&& bind_composite_inputs,
|
||||
DrawPlane&& draw_plane)
|
||||
{
|
||||
setup_composite_shader();
|
||||
bind_composite_samplers();
|
||||
bind_composite_inputs();
|
||||
draw_plane();
|
||||
}
|
||||
|
||||
template <typename BindPreviewTexture, typename CopyFramebufferToTexture>
|
||||
void copy_legacy_stroke_preview_texture(
|
||||
BindPreviewTexture&& bind_preview_texture,
|
||||
CopyFramebufferToTexture&& copy_framebuffer_to_texture,
|
||||
LegacyStrokePreviewCopySize copy_size)
|
||||
{
|
||||
bind_preview_texture();
|
||||
copy_framebuffer_to_texture(0, 0, 0, 0, copy_size.width, copy_size.height);
|
||||
}
|
||||
|
||||
} // namespace pp::panopainter
|
||||
Reference in New Issue
Block a user