Bug 137685 - gamma correction causing black backgrounds in embedding.

r=brendan, sr=hyatt
This commit is contained in:
tor%cs.brown.edu 2002-04-23 23:21:25 +00:00
Родитель 10cadaaf81
Коммит c45bbd713a
4 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -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();
}