forked from mirrors/gecko-dev
Bug 1822519 - When qcms_profile_from_memory fails, default to sRGB for display space. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D172837
This commit is contained in:
parent
0bcc307110
commit
25f19106d7
1 changed files with 23 additions and 5 deletions
|
|
@ -1749,12 +1749,30 @@ color::ColorProfileDesc DCLayerTree::QueryOutputColorProfile() {
|
||||||
|
|
||||||
const auto qcmsProfile = qcms_profile_from_memory(
|
const auto qcmsProfile = qcms_profile_from_memory(
|
||||||
outputProfileData.Elements(), outputProfileData.Length());
|
outputProfileData.Elements(), outputProfileData.Length());
|
||||||
MOZ_ASSERT(qcmsProfile);
|
const auto release = MakeScopeExit([&]() {
|
||||||
const auto release =
|
if (qcmsProfile) {
|
||||||
MakeScopeExit([&]() { qcms_profile_release(qcmsProfile); });
|
qcms_profile_release(qcmsProfile);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const bool print = gfxEnv::MOZ_GL_SPEW();
|
||||||
|
|
||||||
|
const auto ret = [&]() {
|
||||||
|
if (qcmsProfile) {
|
||||||
|
return color::ColorProfileDesc::From(*qcmsProfile);
|
||||||
|
}
|
||||||
|
if (print) {
|
||||||
|
printf_stderr(
|
||||||
|
"Missing or failed to load display color profile, defaulting to "
|
||||||
|
"sRGB.\n");
|
||||||
|
}
|
||||||
|
const auto MISSING_PROFILE_DEFAULT_SPACE = color::ColorspaceDesc{
|
||||||
|
color::Chromaticities::Srgb(),
|
||||||
|
color::PiecewiseGammaDesc::Srgb(),
|
||||||
|
};
|
||||||
|
return color::ColorProfileDesc::From(MISSING_PROFILE_DEFAULT_SPACE);
|
||||||
|
}();
|
||||||
|
|
||||||
const auto ret = color::ColorProfileDesc::From(*qcmsProfile);
|
|
||||||
bool print = gfxEnv::MOZ_GL_SPEW();
|
|
||||||
if (print) {
|
if (print) {
|
||||||
const auto gammaGuess = color::GuessGamma(ret.linearFromTf.r);
|
const auto gammaGuess = color::GuessGamma(ret.linearFromTf.r);
|
||||||
printf_stderr(
|
printf_stderr(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue