Report depth export snapshot routing
This commit is contained in:
@@ -144,17 +144,6 @@ pp::foundation::Result<LegacyDocumentExportSnapshotReports> prepare_legacy_docum
|
||||
return pp::foundation::Result<LegacyDocumentExportSnapshotReports>::success(std::move(reports));
|
||||
}
|
||||
|
||||
void prepare_legacy_document_export_snapshot_or_continue(App& app, const char* context)
|
||||
{
|
||||
const auto prepared = prepare_legacy_document_export_snapshot(app, context);
|
||||
if (!prepared) {
|
||||
LOG(
|
||||
"%s document export snapshot bridge retained legacy export after failure: %s",
|
||||
context,
|
||||
prepared.status().message);
|
||||
}
|
||||
}
|
||||
|
||||
bool should_use_document_snapshot_writer(
|
||||
const char* context,
|
||||
pp::app::DocumentExportExecutionKind kind,
|
||||
@@ -563,7 +552,6 @@ public:
|
||||
void export_depth(std::string_view document_name) override
|
||||
{
|
||||
auto* app = &app_;
|
||||
#if !__WEB__
|
||||
const auto target = pp::app::make_document_depth_export_target(app_.work_path, document_name);
|
||||
if (target) {
|
||||
LOG(
|
||||
@@ -576,6 +564,17 @@ public:
|
||||
|
||||
const auto prepared = prepare_legacy_document_export_snapshot(app_, "export-depth");
|
||||
if (prepared) {
|
||||
const auto report = pp::app::make_document_canvas_save_snapshot_report(prepared.value().snapshot);
|
||||
const auto route = pp::app::plan_document_export_snapshot_route_for_current_platform(
|
||||
pp::app::DocumentExportExecutionKind::depth,
|
||||
report);
|
||||
if (!route.uses_document_snapshot_writer) {
|
||||
LOG(
|
||||
"export-depth document export writer retained legacy export: %.*s",
|
||||
static_cast<int>(route.fallback_reason.size()),
|
||||
route.fallback_reason.data());
|
||||
}
|
||||
#if !__WEB__
|
||||
const auto plan = pp::paint_renderer::plan_document_depth_export_render(
|
||||
pp::paint_renderer::DocumentDepthExportRenderPlanRequest {
|
||||
.document = &prepared.value().snapshot.document,
|
||||
@@ -597,14 +596,12 @@ public:
|
||||
"export-depth document export render plan retained legacy export after failure: %s",
|
||||
plan.status().message);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
LOG(
|
||||
"export-depth document export snapshot bridge retained legacy export after failure: %s",
|
||||
prepared.status().message);
|
||||
}
|
||||
#else
|
||||
prepare_legacy_document_export_snapshot_or_continue(app_, "export-depth");
|
||||
#endif
|
||||
app_.canvas->m_canvas->export_depth(std::string(document_name), [app] {
|
||||
show_export_success_dialog(
|
||||
*app,
|
||||
|
||||
Reference in New Issue
Block a user