14.2: RAW import rounds to 8 bits with fine noise, in the kernel; the develop sheet shows Importing… until the layer lands

This commit is contained in:
ZacharyZhang-NY committed 2026-10-11 02:38:04 -04:00
1 parent 5aad975e8b
commit c04d1fb6e4
14 files changed
+470 -65

No files matched your search

+18 -3
View File
@@ -208,13 +208,25 @@ void EditorSession::developRaw(const QString &path, std::function<void(std::opti
void EditorSession::finishRawDevelop(std::optional<RawDevelopSettings> settings)
{
// Importing, the sheet waits for the develop; Cancel closes it.
if (settings && m_rawAnswer) {
m_rawImporting = true;
notify();
} else {
endRawDevelop();
}
// The import resumes from the event loop, as a task.
if (const auto answer = std::exchange(m_rawAnswer, {}))
QMetaObject::invokeMethod(this, [answer, settings] { answer(settings); }, Qt::QueuedConnection);
}
void EditorSession::endRawDevelop()
{
m_rawImporting = false;
m_rawDevelop = std::nullopt;
notify();
// Frees the preview's decode on a worker, behind any preview.
(void)QtConcurrent::run([] { RawImporter::Queue::shared().release(); });
// The import resumes from the event loop, as a task.
if (const auto answer = std::exchange(m_rawAnswer, {}))
QMetaObject::invokeMethod(this, [answer, settings] { answer(settings); }, Qt::QueuedConnection);
}
void EditorSession::finishDecode()
@@ -224,6 +236,9 @@ void EditorSession::finishDecode()
insert(*decoded.asset, m_importPoint);
else
m_importFailures << decoded.failure;
// Swift's defer: the develop sheet goes once the frame lands.
if (m_rawImporting)
endRawDevelop();
m_importIndex += 1;
decodeNext();
}