Extract stroke commit sequence invocation
This commit is contained in:
@@ -2021,6 +2021,50 @@ void retained_stroke_commit_request_helper_preserves_dirty_face_order(pp::tests:
|
||||
PP_EXPECT(h, request.faces[4].dirty);
|
||||
}
|
||||
|
||||
void retained_stroke_commit_sequence_executor_preserves_request_shape(pp::tests::Harness& h)
|
||||
{
|
||||
const pp::panopainter::LegacyCanvasStrokeCommitCallbacks callbacks {
|
||||
.mark_commit_started = []() {},
|
||||
.capture_render_state = []() {},
|
||||
.prepare_render_state = []() {},
|
||||
.restore_render_state = []() {},
|
||||
.publish_history = []() {},
|
||||
.capture_timelapse_frame = []() {},
|
||||
.bind_layer_framebuffer = [](int) {},
|
||||
.capture_history_region = [](int) {},
|
||||
.apply_layer_dirty_region = [](int) {},
|
||||
.copy_layer_to_commit_destination = [](int) {},
|
||||
.bind_commit_inputs = [](int) {},
|
||||
.execute_erase_composite = [](int) {},
|
||||
.execute_paint_composite = [](int) {},
|
||||
.copy_committed_to_dilate_source = [](int) {},
|
||||
.execute_commit_dilate = [](int) {},
|
||||
.unbind_layer_framebuffer = [](int) {},
|
||||
};
|
||||
const auto sequence = plan_canvas_stroke_commit_sequence(
|
||||
CanvasStrokeCommitRequest {
|
||||
.erase_mode = false,
|
||||
.alpha_locked = false,
|
||||
.selection_mask_active = true,
|
||||
.dual_stroke_enabled = true,
|
||||
.pattern_enabled = true,
|
||||
});
|
||||
const std::array<pp::panopainter::LegacyCanvasStrokeCommitFace, 6> faces {
|
||||
pp::panopainter::LegacyCanvasStrokeCommitFace { .index = 0, .dirty = true },
|
||||
pp::panopainter::LegacyCanvasStrokeCommitFace { .index = 1, .dirty = true },
|
||||
pp::panopainter::LegacyCanvasStrokeCommitFace { .index = 2, .dirty = false },
|
||||
pp::panopainter::LegacyCanvasStrokeCommitFace { .index = 3, .dirty = false },
|
||||
pp::panopainter::LegacyCanvasStrokeCommitFace { .index = 4, .dirty = true },
|
||||
pp::panopainter::LegacyCanvasStrokeCommitFace { .index = 5, .dirty = false },
|
||||
};
|
||||
|
||||
const auto result = pp::panopainter::execute_legacy_canvas_stroke_commit_sequence(
|
||||
pp::panopainter::make_legacy_canvas_stroke_commit_request(faces, sequence, callbacks));
|
||||
|
||||
PP_EXPECT(h, result.ok);
|
||||
PP_EXPECT(h, result.committed_faces == 3);
|
||||
}
|
||||
|
||||
void retained_stroke_commit_dilate_copy_uses_layer_scratch_slot(pp::tests::Harness& h)
|
||||
{
|
||||
const auto sequence = plan_canvas_stroke_commit_sequence(
|
||||
|
||||
Reference in New Issue
Block a user