Bug 600763. Force initialization of OpenGL on OS X. r,a=joe

This is expected to regress Ts but the idea is to separate
out the costs that we have little control of (like this one)
from the costs that we have more control of.
This commit is contained in:
Jeff Muizelaar 2010-09-29 22:30:48 -04:00
parent a0affc6733
commit 4c2820c868

View File

@ -36,6 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include <OpenGL/OpenGL.h>
#include "gfxPlatformMac.h"
#include "gfxImageSurface.h"
@ -57,10 +59,34 @@
#include "qcms.h"
static void forceGLInit()
{
CGLPixelFormatAttribute attribs[] =
{
kCGLPFAAccelerated,
kCGLPFAColorSize, (CGLPixelFormatAttribute)24,
kCGLPFADepthSize, (CGLPixelFormatAttribute)16,
kCGLPFADoubleBuffer,
kCGLPFASupersample,
(CGLPixelFormatAttribute)0
};
CGLPixelFormatObj pixelFormatObj;
GLint numPixelFormats;
CGLChoosePixelFormat (attribs, &pixelFormatObj, &numPixelFormats);
}
gfxPlatformMac::gfxPlatformMac()
{
mOSXVersion = 0;
mFontAntiAliasingThreshold = ReadAntiAliasingThreshold();
/* We'll force the initialization of GL unconditionally so that we'll see
the impact on Ts. Eventually, we should be able to do this on another
thread bringing the cost down */
forceGLInit();
}
gfxPlatformMac::~gfxPlatformMac()