Bug 1506495. Fallback to the system profile if we can't read the file for the profile. r=aosmond
authorJeff Muizelaar <jrmuizel@gmail.com>
Fri, 01 Feb 2019 14:10:22 -0500
changeset 456522 97f2cfdbba0709fa304ce77ac7eef7146f134c12
parent 456521 0c8c91068e50be5a7a04bc7d5084f461cb0828f0
child 456523 322610d2c3389b588199cde07a063443839748e3
push id35488
push userdvarga@mozilla.com
push dateSat, 02 Feb 2019 09:44:51 +0000
treeherdermozilla-central@d8cebb3b46cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1506495
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1506495. Fallback to the system profile if we can't read the file for the profile. r=aosmond This is a better default than just assuming no profile.
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2106,19 +2106,21 @@ void gfxPlatform::TransformPixel(const C
 void gfxPlatform::GetPlatformCMSOutputProfile(void*& mem, size_t& size) {
   mem = nullptr;
   size = 0;
 }
 
 void gfxPlatform::GetCMSOutputProfileData(void*& mem, size_t& size) {
   nsAutoCString fname;
   Preferences::GetCString("gfx.color_management.display_profile", fname);
+  mem = nullptr;
   if (!fname.IsEmpty()) {
     qcms_data_from_path(fname.get(), &mem, &size);
-  } else {
+  }
+  if (mem == nullptr) {
     gfxPlatform::GetPlatform()->GetPlatformCMSOutputProfile(mem, size);
   }
 }
 
 void gfxPlatform::CreateCMSOutputProfile() {
   if (!gCMSOutputProfile) {
     /* Determine if we're using the internal override to force sRGB as
        an output profile for reftests. See Bug 452125.