Bug 888899: Allow fast iterations of the refresh driver on OS X. r=jrmuizel

This commit is contained in:
Avi Halachmi 2013-07-09 03:06:14 +03:00
Родитель ed8016f18d
Коммит 5d2c672668
3 изменённых файлов: 15 добавлений и 1 удалений

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

@ -136,7 +136,12 @@ public:
if (mContext) {
[mContext makeCurrentContext];
GLint swapInt = 1;
// Use blocking swap only with the default frame rate.
// If swapInt is 1, then glSwapBuffers will block and wait for a vblank signal.
// While this is fine for the default refresh rate, if the user chooses some
// other rate, and specifically if this rate is higher than the screen refresh rate,
// then we want a non-blocking glSwapBuffers, which will happen when swapInt==0.
GLint swapInt = gfxPlatform::GetPrefLayoutFrameRate() == -1 ? 1 : 0;
[mContext setValues:&swapInt forParameter:NSOpenGLCPSwapInterval];
}
return true;

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

@ -1836,6 +1836,7 @@ static bool sPrefLayersAccelerationForceEnabled = false;
static bool sPrefLayersAccelerationDisabled = false;
static bool sPrefLayersPreferOpenGL = false;
static bool sPrefLayersPreferD3D9 = false;
static int sPrefLayoutFrameRate = -1;
void InitLayersAccelerationPrefs()
{
@ -1849,6 +1850,7 @@ void InitLayersAccelerationPrefs()
sPrefLayersAccelerationDisabled = Preferences::GetBool("layers.acceleration.disabled", false);
sPrefLayersPreferOpenGL = Preferences::GetBool("layers.prefer-opengl", false);
sPrefLayersPreferD3D9 = Preferences::GetBool("layers.prefer-d3d9", false);
sPrefLayoutFrameRate = Preferences::GetInt("layout.frame_rate", -1);
sLayersAccelerationPrefsInitialized = true;
}
@ -1892,3 +1894,9 @@ bool gfxPlatform::GetPrefLayersPreferD3D9()
InitLayersAccelerationPrefs();
return sPrefLayersPreferD3D9;
}
int gfxPlatform::GetPrefLayoutFrameRate()
{
InitLayersAccelerationPrefs();
return sPrefLayoutFrameRate;
}

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

@ -467,6 +467,7 @@ public:
static bool GetPrefLayersAccelerationDisabled();
static bool GetPrefLayersPreferOpenGL();
static bool GetPrefLayersPreferD3D9();
static int GetPrefLayoutFrameRate();
/**
* Are we going to try color management?