Bug 758844 - Requiet gfx/gl code spew - r=bjacob

This commit is contained in:
Jeff Gilbert 2012-07-17 08:26:12 -07:00
Родитель 794d5f6f45
Коммит 1c23b37d56
2 изменённых файлов: 16 добавлений и 18 удалений

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

@ -333,8 +333,8 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
if (mInitialized) {
#ifdef DEBUG
static bool once = false;
if (DebugMode() && !once) {
static bool firstRun = true;
if (firstRun && DebugMode()) {
const char *vendors[VendorOther] = {
"Intel",
"NVIDIA",
@ -342,7 +342,6 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
"Qualcomm"
};
once = true;
if (mVendor < VendorOther) {
printf_stderr("OpenGL vendor ('%s') recognized as: %s\n",
glVendorString, vendors[mVendor]);
@ -350,6 +349,7 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
printf_stderr("OpenGL vendor ('%s') unrecognized\n", glVendorString);
}
}
firstRun = false;
#endif
InitExtensions();
@ -540,17 +540,16 @@ GLContext::InitExtensions()
return;
#ifdef DEBUG
// If DEBUG, then be verbose the first time we're run.
static bool firstVerboseRun = true;
static bool firstRun = true;
#else
// Non-DEBUG, so never spew.
const bool firstVerboseRun = false;
const bool firstRun = false;
#endif
mAvailableExtensions.Load(extensions, sExtensionNames, firstVerboseRun);
mAvailableExtensions.Load(extensions, sExtensionNames, firstRun && DebugMode());
#ifdef DEBUG
firstVerboseRun = false;
firstRun = false;
#endif
}

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

@ -9,6 +9,7 @@
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"
#include "nsPrintfCString.h"
#include "prenv.h"
namespace mozilla {
namespace gl {
@ -280,23 +281,21 @@ GLLibraryEGL::InitExtensions()
return;
}
bool debugMode = false;
#ifdef DEBUG
// If DEBUG, then be verbose the first time we're run.
static bool firstVerboseRun = true;
if (PR_GetEnv("MOZ_GL_DEBUG"))
debugMode = true;
static bool firstRun = true;
#else
// Non-DEBUG, so never spew.
const bool firstVerboseRun = false;
const bool firstRun = false;
#endif
if (firstVerboseRun) {
printf_stderr("Extensions: %s 0x%02x\n", extensions, extensions[0]);
printf_stderr("Extensions length: %d\n", strlen(extensions));
}
mAvailableExtensions.Load(extensions, sExtensionNames, firstVerboseRun);
mAvailableExtensions.Load(extensions, sExtensionNames, firstRun && debugMode);
#ifdef DEBUG
firstVerboseRun = false;
firstRun = false;
#endif
}