gammaInitialized = PR_TRUE;
extern "C" NS_GFX_(void) NS_InitializeGamma(void){  nsresult result;  nsCOMPtr<nsIScreenManager> screenmgr =    do_GetService("@mozilla.org/gfx/screenmanager;1", &result);  if (NS_SUCCEEDED(result)) {    nsCOMPtr<nsIScreen> screen;    screenmgr->GetPrimaryScreen(getter_AddRefs(screen));    if (screen)      screen->GetGammaValue(&gammaValue);  }  double gamma = 2.2/gammaValue;  for (int i=0; i<256; i++) {    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;  }}