Bug 557896: Display information on the error console when using a OpenGL layer manager. r=joedrew

This commit is contained in:
Bas Schouten 2010-04-08 09:29:58 +02:00
parent dbf2d3e55f
commit 13f8690159

View File

@ -46,6 +46,9 @@
#include "glWrapper.h"
#include "nsIServiceManager.h"
#include "nsIConsoleService.h"
static const GLint VERTEX_ATTRIB_LOCATION = 0;
namespace mozilla {
@ -171,6 +174,24 @@ LayerManagerOGL::Initialize()
mYCbCrLayerProgram->SetCbTexture(1);
mYCbCrLayerProgram->SetCrTexture(2);
nsCOMPtr<nsIConsoleService>
console(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
if (console) {
nsString msg;
msg +=
NS_LITERAL_STRING("OpenGL LayerManager Initialized Succesfully.\nVersion: ");
msg += NS_ConvertUTF8toUTF16(
nsDependentCString((const char*)sglWrapper.GetString(LOCAL_GL_VERSION)));
msg += NS_LITERAL_STRING("\nVendor: ");
msg += NS_ConvertUTF8toUTF16(
nsDependentCString((const char*)sglWrapper.GetString(LOCAL_GL_VENDOR)));
msg += NS_LITERAL_STRING("\nRenderer: ");
msg += NS_ConvertUTF8toUTF16(
nsDependentCString((const char*)sglWrapper.GetString(LOCAL_GL_RENDERER)));
console->LogStringMessage(msg.get());
}
return true;
}