Bug 853169 - Initialize the output profile explicitly from within gfxPlatform::Init, and handle when we can't create one in xpcshell tests on Gtk because we don't have an X Display. r=jrmuizel

This commit is contained in:
Joe Drew 2013-03-21 23:12:30 -04:00
parent 90942b6b22
commit 169c21dee6
3 changed files with 17 additions and 2 deletions

View File

@ -384,6 +384,8 @@ gfxPlatform::Init()
} }
gPlatform->mOrientationSyncMillis = Preferences::GetUint("layers.orientation.sync.timeout", (uint32_t)0); gPlatform->mOrientationSyncMillis = Preferences::GetUint("layers.orientation.sync.timeout", (uint32_t)0);
CreateCMSOutputProfile();
} }
void void
@ -1428,8 +1430,8 @@ gfxPlatform::GetPlatformCMSOutputProfile()
return nullptr; return nullptr;
} }
qcms_profile * void
gfxPlatform::GetCMSOutputProfile() gfxPlatform::CreateCMSOutputProfile()
{ {
if (!gCMSOutputProfile) { if (!gCMSOutputProfile) {
/* Determine if we're using the internal override to force sRGB as /* Determine if we're using the internal override to force sRGB as
@ -1471,7 +1473,11 @@ gfxPlatform::GetCMSOutputProfile()
bug 444661 for details. */ bug 444661 for details. */
qcms_profile_precache_output_transform(gCMSOutputProfile); qcms_profile_precache_output_transform(gCMSOutputProfile);
} }
}
qcms_profile *
gfxPlatform::GetCMSOutputProfile()
{
return gCMSOutputProfile; return gCMSOutputProfile;
} }

View File

@ -592,6 +592,8 @@ private:
*/ */
static void Init(); static void Init();
static void CreateCMSOutputProfile();
virtual qcms_profile* GetPlatformCMSOutputProfile(); virtual qcms_profile* GetPlatformCMSOutputProfile();
nsRefPtr<gfxASurface> mScreenReferenceSurface; nsRefPtr<gfxASurface> mScreenReferenceSurface;

View File

@ -489,6 +489,13 @@ gfxPlatformGtk::GetPlatformCMSOutputProfile()
Atom edidAtom, iccAtom; Atom edidAtom, iccAtom;
Display *dpy = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); Display *dpy = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
// In xpcshell tests, we never initialize X and hence don't have a Display.
// In this case, there's no output colour management to be done, so we just
// return NULL.
if (!dpy) {
return NULL;
}
Window root = gdk_x11_get_default_root_xwindow(); Window root = gdk_x11_get_default_root_xwindow();
Atom retAtom; Atom retAtom;