Route stroke dirty mutation through helper
This commit is contained in:
@@ -716,16 +716,16 @@ void Canvas::stroke_draw()
|
||||
|
||||
m_tmp[i].unbindFramebuffer();
|
||||
|
||||
const auto dirty_update = pp::panopainter::plan_legacy_canvas_stroke_face_dirty_update(
|
||||
const auto dirty_update = pp::panopainter::apply_legacy_canvas_stroke_face_dirty_update(
|
||||
pp::panopainter::LegacyCanvasStrokeFaceDirtyRequest {
|
||||
.extent = stroke_extent,
|
||||
.previous_accumulated_dirty_box = m_dirty_box[i],
|
||||
.previous_pass_dirty_box = box_face[i],
|
||||
.sample_dirty_box = box_sample,
|
||||
.include_in_committed_dirty_box = true,
|
||||
});
|
||||
m_dirty_box[i] = dirty_update.accumulated_dirty_box;
|
||||
box_face[i] = dirty_update.pass_dirty_box;
|
||||
},
|
||||
m_dirty_box[i],
|
||||
&box_face[i]);
|
||||
// TODO: maybe average color?
|
||||
pad_color = f.col;
|
||||
});
|
||||
@@ -820,16 +820,17 @@ void Canvas::stroke_draw()
|
||||
m_tmp_dual[i].unbindFramebuffer();
|
||||
|
||||
// this mode overflows the main brush boundries
|
||||
const auto dirty_update = pp::panopainter::plan_legacy_canvas_stroke_face_dirty_update(
|
||||
pp::panopainter::LegacyCanvasStrokeFaceDirtyRequest {
|
||||
.extent = stroke_extent,
|
||||
.previous_accumulated_dirty_box = m_dirty_box[i],
|
||||
.previous_pass_dirty_box = box_sample,
|
||||
.sample_dirty_box = box_sample,
|
||||
.include_in_committed_dirty_box =
|
||||
stroke_material.composite_pass.dual_blend_mode == 0,
|
||||
});
|
||||
m_dirty_box[i] = dirty_update.accumulated_dirty_box;
|
||||
[[maybe_unused]] const auto dirty_update =
|
||||
pp::panopainter::apply_legacy_canvas_stroke_face_dirty_update(
|
||||
pp::panopainter::LegacyCanvasStrokeFaceDirtyRequest {
|
||||
.extent = stroke_extent,
|
||||
.previous_accumulated_dirty_box = m_dirty_box[i],
|
||||
.previous_pass_dirty_box = box_sample,
|
||||
.sample_dirty_box = box_sample,
|
||||
.include_in_committed_dirty_box =
|
||||
stroke_material.composite_pass.dual_blend_mode == 0,
|
||||
},
|
||||
m_dirty_box[i]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -246,6 +246,27 @@ std::size_t execute_legacy_canvas_stroke_frame_faces(
|
||||
};
|
||||
}
|
||||
|
||||
[[nodiscard]] inline LegacyCanvasStrokeFaceDirtyResult apply_legacy_canvas_stroke_face_dirty_update(
|
||||
const LegacyCanvasStrokeFaceDirtyRequest& request,
|
||||
glm::vec4& accumulated_dirty_box,
|
||||
glm::vec4* pass_dirty_box = nullptr,
|
||||
bool* committed_dirty = nullptr,
|
||||
bool* pass_dirty = nullptr) noexcept
|
||||
{
|
||||
const auto result = plan_legacy_canvas_stroke_face_dirty_update(request);
|
||||
accumulated_dirty_box = result.accumulated_dirty_box;
|
||||
if (pass_dirty_box) {
|
||||
*pass_dirty_box = result.pass_dirty_box;
|
||||
}
|
||||
if (committed_dirty) {
|
||||
*committed_dirty = result.committed_dirty;
|
||||
}
|
||||
if (pass_dirty) {
|
||||
*pass_dirty = result.pass_dirty;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
[[nodiscard]] inline LegacyCanvasStrokePadExecutionResult execute_legacy_canvas_stroke_pad_faces(
|
||||
const LegacyCanvasStrokePadExecutionRequest& request)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user