зеркало из https://github.com/mozilla/gecko-dev.git
Bug 137685 - gamma correction causing black backgrounds in embedding.
r=brendan, sr=hyatt
This commit is contained in:
Родитель
10cadaaf81
Коммит
c45bbd713a
|
@ -1044,15 +1044,15 @@ NS_IMETHODIMP nsWebBrowser::Create()
|
|||
nsnull, nsnull, nsnull, &widgetInit);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell(do_CreateInstance(kWebShellCID));
|
||||
NS_ENSURE_SUCCESS(SetDocShell(docShell), NS_ERROR_FAILURE);
|
||||
|
||||
// get the system default window background colour
|
||||
{
|
||||
nsCOMPtr<nsILookAndFeel> laf = do_GetService(kLookAndFeelCID);
|
||||
laf->GetColor(nsILookAndFeel::eColor_WindowBackground, mBackgroundColor);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell(do_CreateInstance(kWebShellCID));
|
||||
NS_ENSURE_SUCCESS(SetDocShell(docShell), NS_ERROR_FAILURE);
|
||||
|
||||
// the docshell has been set so we now have our listener registrars.
|
||||
if (mListenerArray) {
|
||||
// we had queued up some listeners, let's register them now.
|
||||
|
|
|
@ -468,6 +468,10 @@ extern "C" NS_GFX_(double) NS_DisplayGammaValue(void)
|
|||
extern "C" NS_GFX_(void) NS_InitializeGamma(void)
|
||||
{
|
||||
nsresult result;
|
||||
static PRBool gammaInitialized = PR_FALSE;
|
||||
|
||||
if (gammaInitialized)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIScreenManager> screenmgr =
|
||||
do_GetService("@mozilla.org/gfx/screenmanager;1", &result);
|
||||
|
@ -484,6 +488,7 @@ extern "C" NS_GFX_(void) NS_InitializeGamma(void)
|
|||
nsGammaRamp[i] = pow(double(i)/255.0, gamma) * 255.0 + 0.5;
|
||||
nsInverseGammaRamp[i] = pow(double(i)/255.0, 1/gamma) * 255.0 + 0.5;
|
||||
}
|
||||
gammaInitialized = PR_TRUE;
|
||||
}
|
||||
|
||||
// Function to convert RGB color space into the HSV colorspace
|
||||
|
|
|
@ -111,6 +111,8 @@ void DeviceContextImpl::CommonInit(void)
|
|||
nsCOMPtr<nsIObserverService> obs(do_GetService("@mozilla.org/observer-service;1"));
|
||||
if (obs)
|
||||
obs->AddObserver(this, "memory-pressure", PR_TRUE);
|
||||
|
||||
NS_InitializeGamma();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP DeviceContextImpl::GetTwipsToDevUnits(float &aTwipsToDevUnits) const
|
||||
|
|
|
@ -120,8 +120,6 @@ Initialize(nsIModule* self)
|
|||
|
||||
nsCSSFrameConstructor::InitGlobals();
|
||||
|
||||
NS_InitializeGamma();
|
||||
|
||||
return nsTextTransformer::Initialize();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче