Bug 743753 - 3/4 - WebGL: rename LogMessage to GenerateWarning - r=vlad
authorBenoit Jacob <bjacob@mozilla.com>
Wed, 23 May 2012 12:07:29 -0400
changeset 94723 b0dc5e163739d178ae94d0469ca6563180c0f7b4
parent 94722 6ac4c324163e634e057d4460fe6abccf47d90fb5
child 94724 434efc02a33ba200bce3d06f95fb4a0b10416e8b
push id22751
push useremorley@mozilla.com
push dateThu, 24 May 2012 14:48:49 +0000
treeherdermozilla-central@2552b0541f87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad
bugs743753
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 743753 - 3/4 - WebGL: rename LogMessage to GenerateWarning - r=vlad
content/canvas/src/WebGLContext.cpp
content/canvas/src/WebGLContext.h
content/canvas/src/WebGLContextGL.cpp
content/canvas/src/WebGLContextUtils.cpp
content/canvas/src/WebGLContextValidate.cpp
--- a/content/canvas/src/WebGLContext.cpp
+++ b/content/canvas/src/WebGLContext.cpp
@@ -294,17 +294,17 @@ WebGLContext::SetContextOptions(nsIPrope
     GetBoolFromPropertyBag(aOptions, "premultipliedAlpha", &newOpts.premultipliedAlpha);
     GetBoolFromPropertyBag(aOptions, "antialias", &newOpts.antialias);
     GetBoolFromPropertyBag(aOptions, "preserveDrawingBuffer", &newOpts.preserveDrawingBuffer);
 
     // enforce that if stencil is specified, we also give back depth
     newOpts.depth |= newOpts.stencil;
 
 #if 0
-    LogMessage("aaHint: %d stencil: %d depth: %d alpha: %d premult: %d preserve: %d\n",
+    GenerateWarning("aaHint: %d stencil: %d depth: %d alpha: %d premult: %d preserve: %d\n",
                newOpts.antialias ? 1 : 0,
                newOpts.stencil ? 1 : 0,
                newOpts.depth ? 1 : 0,
                newOpts.alpha ? 1 : 0,
                newOpts.premultipliedAlpha ? 1 : 0,
                newOpts.preserveDrawingBuffer ? 1 : 0);
 #endif
 
@@ -488,67 +488,67 @@ WebGLContext::SetDimensions(PRInt32 widt
             // is removed
             NS_RUNTIMEABORT("No global context anymore? Then you need to update "
                             "this code, or force-enable WebGL.");
         }
         int renderer = globalContext->Renderer();
         if (renderer == gl::GLContext::RendererAdreno200 ||
             renderer == gl::GLContext::RendererAdreno205)
         {
-            LogMessage("WebGL blocked on this Adreno driver!");
+            GenerateWarning("WebGL blocked on this Adreno driver!");
             return NS_ERROR_FAILURE;
         }
     }
 #endif
 
     // if we're forcing osmesa, do it first
     if (forceOSMesa) {
         gl = gl::GLContextProviderOSMesa::CreateOffscreen(gfxIntSize(width, height), format);
         if (!gl || !InitAndValidateGL()) {
-            LogMessage("OSMesa forced, but creating context failed -- aborting!");
+            GenerateWarning("OSMesa forced, but creating context failed -- aborting!");
             return NS_ERROR_FAILURE;
         }
-        LogMessage("Using software rendering via OSMesa (THIS WILL BE SLOW)");
+        GenerateWarning("Using software rendering via OSMesa (THIS WILL BE SLOW)");
     }
 
 #ifdef XP_WIN
     // if we want EGL, try it now
     if (!gl && (preferEGL || useANGLE) && !preferOpenGL) {
         gl = gl::GLContextProviderEGL::CreateOffscreen(gfxIntSize(width, height), format);
         if (!gl || !InitAndValidateGL()) {
-            LogMessage("Error during ANGLE OpenGL ES initialization");
+            GenerateWarning("Error during ANGLE OpenGL ES initialization");
             return NS_ERROR_FAILURE;
         }
     }
 #endif
 
     // try the default provider, whatever that is
     if (!gl && useOpenGL) {
         gl = gl::GLContextProvider::CreateOffscreen(gfxIntSize(width, height), format);
         if (gl && !InitAndValidateGL()) {
-            LogMessage("Error during OpenGL initialization");
+            GenerateWarning("Error during OpenGL initialization");
             return NS_ERROR_FAILURE;
         }
     }
 
     // finally, try OSMesa
     if (!gl) {
         gl = gl::GLContextProviderOSMesa::CreateOffscreen(gfxIntSize(width, height), format);
         if (gl) {
             if (!InitAndValidateGL()) {
-                LogMessage("Error during OSMesa initialization");
+                GenerateWarning("Error during OSMesa initialization");
                 return NS_ERROR_FAILURE;
             } else {
-                LogMessage("Using software rendering via OSMesa (THIS WILL BE SLOW)");
+                GenerateWarning("Using software rendering via OSMesa (THIS WILL BE SLOW)");
             }
         }
     }
 
     if (!gl) {
-        LogMessage("Can't get a usable WebGL context");
+        GenerateWarning("Can't get a usable WebGL context");
         return NS_ERROR_FAILURE;
     }
 
 #ifdef DEBUG
     printf_stderr ("--- WebGL context created: %p\n", gl.get());
 #endif
 
     mWidth = width;
--- a/content/canvas/src/WebGLContext.h
+++ b/content/canvas/src/WebGLContext.h
@@ -1364,18 +1364,18 @@ protected:
     // If in the future GC becomes much more frequent, we may have to revisit then (maybe use a timer).
     ForceDiscreteGPUHelperCGL mForceDiscreteGPUHelper;
 #endif
 
     nsRefPtr<WebGLMemoryPressureObserver> mMemoryPressureObserver;
 
 public:
     // console logging helpers
-    void LogMessage(const char *fmt, ...);
-    void LogMessage(const char *fmt, va_list ap);
+    void GenerateWarning(const char *fmt, ...);
+    void GenerateWarning(const char *fmt, va_list ap);
 
     friend class WebGLTexture;
     friend class WebGLFramebuffer;
     friend class WebGLRenderbuffer;
     friend class WebGLProgram;
     friend class WebGLBuffer;
     friend class WebGLShader;
     friend class WebGLUniformLocation;
@@ -1975,72 +1975,72 @@ public:
                 = "A texture is going to be rendered as if it were black, as per the OpenGL ES 2.0.24 spec section 3.8.2, "
                   "because it";
 
             if (mTarget == LOCAL_GL_TEXTURE_2D)
             {
                 if (DoesMinFilterRequireMipmap())
                 {
                     if (!IsMipmapTexture2DComplete()) {
-                        mContext->LogMessage
+                        mContext->GenerateWarning
                             ("%s is a 2D texture, with a minification filter requiring a mipmap, "
                              "and is not mipmap complete (as defined in section 3.7.10).", msg_rendering_as_black);
                         mFakeBlackStatus = DoNeedFakeBlack;
                     } else if (!ImageInfoAt(0).IsPowerOfTwo()) {
-                        mContext->LogMessage
+                        mContext->GenerateWarning
                             ("%s is a 2D texture, with a minification filter requiring a mipmap, "
                              "and either its width or height is not a power of two.", msg_rendering_as_black);
                         mFakeBlackStatus = DoNeedFakeBlack;
                     }
                 }
                 else // no mipmap required
                 {
                     if (!ImageInfoAt(0).IsPositive()) {
-                        mContext->LogMessage
+                        mContext->GenerateWarning
                             ("%s is a 2D texture and its width or height is equal to zero.",
                              msg_rendering_as_black);
                         mFakeBlackStatus = DoNeedFakeBlack;
                     } else if (!AreBothWrapModesClampToEdge() && !ImageInfoAt(0).IsPowerOfTwo()) {
-                        mContext->LogMessage
+                        mContext->GenerateWarning
                             ("%s is a 2D texture, with a minification filter not requiring a mipmap, "
                              "with its width or height not a power of two, and with a wrap mode "
                              "different from CLAMP_TO_EDGE.", msg_rendering_as_black);
                         mFakeBlackStatus = DoNeedFakeBlack;
                     }
                 }
             }
             else // cube map
             {
                 bool areAllLevel0ImagesPOT = true;
                 for (size_t face = 0; face < mFacesCount; ++face)
                     areAllLevel0ImagesPOT &= ImageInfoAt(0, face).IsPowerOfTwo();
 
                 if (DoesMinFilterRequireMipmap())
                 {
                     if (!IsMipmapCubeComplete()) {
-                        mContext->LogMessage("%s is a cube map texture, with a minification filter requiring a mipmap, "
+                        mContext->GenerateWarning("%s is a cube map texture, with a minification filter requiring a mipmap, "
                                    "and is not mipmap cube complete (as defined in section 3.7.10).",
                                    msg_rendering_as_black);
                         mFakeBlackStatus = DoNeedFakeBlack;
                     } else if (!areAllLevel0ImagesPOT) {
-                        mContext->LogMessage("%s is a cube map texture, with a minification filter requiring a mipmap, "
+                        mContext->GenerateWarning("%s is a cube map texture, with a minification filter requiring a mipmap, "
                                    "and either the width or the height of some level 0 image is not a power of two.",
                                    msg_rendering_as_black);
                         mFakeBlackStatus = DoNeedFakeBlack;
                     }
                 }
                 else // no mipmap required
                 {
                     if (!IsCubeComplete()) {
-                        mContext->LogMessage("%s is a cube map texture, with a minification filter not requiring a mipmap, "
+                        mContext->GenerateWarning("%s is a cube map texture, with a minification filter not requiring a mipmap, "
                                    "and is not cube complete (as defined in section 3.7.10).",
                                    msg_rendering_as_black);
                         mFakeBlackStatus = DoNeedFakeBlack;
                     } else if (!AreBothWrapModesClampToEdge() && !areAllLevel0ImagesPOT) {
-                        mContext->LogMessage("%s is a cube map texture, with a minification filter not requiring a mipmap, "
+                        mContext->GenerateWarning("%s is a cube map texture, with a minification filter not requiring a mipmap, "
                                    "with some level 0 image having width or height not a power of two, and with a wrap mode "
                                    "different from CLAMP_TO_EDGE.", msg_rendering_as_black);
                         mFakeBlackStatus = DoNeedFakeBlack;
                     }
                 }
             }
 
             // we have exhausted all cases where we do need fakeblack, so if the status is still unknown,
--- a/content/canvas/src/WebGLContextGL.cpp
+++ b/content/canvas/src/WebGLContextGL.cpp
@@ -499,17 +499,17 @@ WebGLContext::BufferData(WebGLenum targe
 
     if (!boundBuffer)
         return ErrorInvalidOperation("BufferData: no buffer bound!");
 
     MakeContextCurrent();
     
     GLenum error = CheckedBufferData(target, size, 0, usage);
     if (error) {
-        LogMessage("bufferData generated error %s", ErrorName(error));
+        GenerateWarning("bufferData generated error %s", ErrorName(error));
         return;
     }
 
     boundBuffer->SetByteLength(size);
     boundBuffer->InvalidateCachedMaxElements();
     if (!boundBuffer->ZeroDataIfElementArray())
         return ErrorOutOfMemory("bufferData: out of memory");
 }
@@ -541,17 +541,17 @@ WebGLContext::BufferData(WebGLenum targe
     if (!boundBuffer)
         return ErrorInvalidOperation("BufferData: no buffer bound!");
 
     MakeContextCurrent();
 
     GLenum error = CheckedBufferData(target, data->mLength, data->mData, usage);
 
     if (error) {
-        LogMessage("bufferData generated error %s", ErrorName(error));
+        GenerateWarning("bufferData generated error %s", ErrorName(error));
         return;
     }
 
     boundBuffer->SetByteLength(data->mLength);
     boundBuffer->InvalidateCachedMaxElements();
     if (!boundBuffer->CopyDataIfElementArray(data->mData))
         return ErrorOutOfMemory("bufferData: out of memory");
 }
@@ -577,17 +577,17 @@ WebGLContext::BufferData(WebGLenum targe
 
     if (!boundBuffer)
         return ErrorInvalidOperation("BufferData: no buffer bound!");
 
     MakeContextCurrent();
 
     GLenum error = CheckedBufferData(target, data.mLength, data.mData, usage);
     if (error) {
-        LogMessage("bufferData generated error %s", ErrorName(error));
+        GenerateWarning("bufferData generated error %s", ErrorName(error));
         return;
     }
 
     boundBuffer->SetByteLength(data.mLength);
     boundBuffer->InvalidateCachedMaxElements();
     if (!boundBuffer->CopyDataIfElementArray(data.mData))
         return ErrorOutOfMemory("bufferData: out of memory");
 }
@@ -1058,17 +1058,17 @@ WebGLContext::CopyTexImage2D(WebGLenum t
     }
 
     if (sizeMayChange) {
         UpdateWebGLErrorAndClearGLError();
         CopyTexSubImage2D_base(target, level, internalformat, 0, 0, x, y, width, height, false);
         GLenum error = LOCAL_GL_NO_ERROR;
         UpdateWebGLErrorAndClearGLError(&error);
         if (error) {
-            LogMessage("copyTexImage2D generated error %s", ErrorName(error));
+            GenerateWarning("copyTexImage2D generated error %s", ErrorName(error));
             return;
         }          
     } else {
         CopyTexSubImage2D_base(target, level, internalformat, 0, 0, x, y, width, height, false);
     }
     
     tex->SetImageInfo(target, level, width, height, internalformat, type);
 }
@@ -3779,17 +3779,17 @@ WebGLContext::ReadPixels(WebGLint x, Web
                          WebGLenum type, ArrayBufferView* pixels,
                          ErrorResult& rv)
 {
     if (!IsContextStable()) {
         return;
     }
 
     if (HTMLCanvasElement()->IsWriteOnly() && !nsContentUtils::IsCallerTrustedForRead()) {
-        LogMessage("ReadPixels: Not allowed");
+        GenerateWarning("ReadPixels: Not allowed");
         return rv.Throw(NS_ERROR_DOM_SECURITY_ERR);
     }
 
     if (width < 0 || height < 0)
         return ErrorInvalidValue("ReadPixels: negative size passed");
 
     const WebGLRectangleObject *framebufferRect = FramebufferRectangleObject();
     WebGLsizei framebufferWidth = framebufferRect ? framebufferRect->Width() : 0;
@@ -4060,17 +4060,17 @@ WebGLContext::RenderbufferStorage(WebGLe
                        height != mBoundRenderbuffer->Height() ||
                        internalformat != mBoundRenderbuffer->InternalFormat();
     if (sizeChanges) {
         UpdateWebGLErrorAndClearGLError();
         gl->fRenderbufferStorage(target, internalformatForGL, width, height);
         GLenum error = LOCAL_GL_NO_ERROR;
         UpdateWebGLErrorAndClearGLError(&error);
         if (error) {
-            LogMessage("renderbufferStorage generated error %s", ErrorName(error));
+            GenerateWarning("renderbufferStorage generated error %s", ErrorName(error));
             return;
         }
     } else {
         gl->fRenderbufferStorage(target, internalformatForGL, width, height);
     }
 
     mBoundRenderbuffer->SetInternalFormat(internalformat);
     mBoundRenderbuffer->SetInternalFormatForGL(internalformatForGL);
@@ -4297,28 +4297,28 @@ WebGLContext::DOMElementToImageSurface(E
     // Canvas2D's.
 
     // part 1: check that the DOM element is same-origin, or has otherwise been
     // validated for cross-domain use.
     if (!res.mCORSUsed) {
         bool subsumes;
         nsresult rv = HTMLCanvasElement()->NodePrincipal()->Subsumes(res.mPrincipal, &subsumes);
         if (NS_FAILED(rv) || !subsumes) {
-            LogMessage("It is forbidden to load a WebGL texture from a cross-domain element that has not been validated with CORS. "
+            GenerateWarning("It is forbidden to load a WebGL texture from a cross-domain element that has not been validated with CORS. "
                                 "See https://developer.mozilla.org/en/WebGL/Cross-Domain_Textures");
             return NS_ERROR_DOM_SECURITY_ERR;
         }
     }
 
     // part 2: if the DOM element is a canvas, check that it's not write-only.
     // That would indicate a tainted canvas, i.e. a canvas that could contain
     // cross-domain image data.
     if (nsHTMLCanvasElement* canvas = nsHTMLCanvasElement::FromContent(imageOrCanvas)) {
         if (canvas->IsWriteOnly()) {
-            LogMessage("The canvas used as source for texImage2D here is tainted (write-only). It is forbidden "
+            GenerateWarning("The canvas used as source for texImage2D here is tainted (write-only). It is forbidden "
                                 "to load a WebGL texture from a tainted canvas. A Canvas becomes tainted for example "
                                 "when a cross-domain image is drawn on it. "
                                 "See https://developer.mozilla.org/en/WebGL/Cross-Domain_Textures");
             return NS_ERROR_DOM_SECURITY_ERR;
         }
     }
 
     // End of security checks, now we should be safe regarding cross-domain images
@@ -4774,17 +4774,17 @@ WebGLContext::ValidateProgram(WebGLProgr
     if (!ValidateObject("validateProgram", prog))
         return;
 
     MakeContextCurrent();
 
 #ifdef XP_MACOSX
     // see bug 593867 for NVIDIA and bug 657201 for ATI. The latter is confirmed with Mac OS 10.6.7
     if (gl->WorkAroundDriverBugs()) {
-        LogMessage("validateProgram: implemented as a no-operation on Mac to work around crashes");
+        GenerateWarning("validateProgram: implemented as a no-operation on Mac to work around crashes");
         return;
     }
 #endif
 
     WebGLuint progname = prog->GLName();
     gl->fValidateProgram(progname);
 }
 
@@ -5625,17 +5625,17 @@ WebGLContext::TexImage2D_base(WebGLenum 
 
         error = CheckedTexImage2D(target, level, internalformat,
                                   width, height, border, format, type, tempZeroData);
 
         free(tempZeroData);
     }
     
     if (error) {
-        LogMessage("texImage2D generated error %s", ErrorName(error));
+        GenerateWarning("texImage2D generated error %s", ErrorName(error));
         return;
     }
 
     tex->SetImageInfo(target, level, width, height, format, type);
 }
 
 NS_IMETHODIMP
 WebGLContext::TexImage2D_array(WebGLenum target, WebGLint level, WebGLenum internalformat,
--- a/content/canvas/src/WebGLContextUtils.cpp
+++ b/content/canvas/src/WebGLContextUtils.cpp
@@ -27,28 +27,28 @@
 #if 0
 #include "nsIContentURIGrouper.h"
 #include "nsIContentPrefService.h"
 #endif
 
 using namespace mozilla;
 
 void
-WebGLContext::LogMessage(const char *fmt, ...)
+WebGLContext::GenerateWarning(const char *fmt, ...)
 {
     va_list ap;
     va_start(ap, fmt);
 
-    LogMessage(fmt, ap);
+    GenerateWarning(fmt, ap);
 
     va_end(ap);
 }
 
 void
-WebGLContext::LogMessage(const char *fmt, va_list ap)
+WebGLContext::GenerateWarning(const char *fmt, va_list ap)
 {
     const int MaxReportedMessages = 32;
 
     if (mAlreadyReportedMessages >= MaxReportedMessages)
         return;
 
     mAlreadyReportedMessages++;
 
@@ -103,72 +103,72 @@ WebGLContext::SynthesizeGLError(WebGLenu
         mWebGLError = err;
 }
 
 void
 WebGLContext::SynthesizeGLError(WebGLenum err, const char *fmt, ...)
 {
     va_list va;
     va_start(va, fmt);
-    LogMessage(fmt, va);
+    GenerateWarning(fmt, va);
     va_end(va);
 
     return SynthesizeGLError(err);
 }
 
 void
 WebGLContext::ErrorInvalidEnum(const char *fmt, ...)
 {
     va_list va;
     va_start(va, fmt);
-    LogMessage(fmt, va);
+    GenerateWarning(fmt, va);
     va_end(va);
 
     return SynthesizeGLError(LOCAL_GL_INVALID_ENUM);
 }
 
 void
 WebGLContext::ErrorInvalidOperation(const char *fmt, ...)
 {
     va_list va;
     va_start(va, fmt);
-    LogMessage(fmt, va);
+    GenerateWarning(fmt, va);
     va_end(va);
 
     return SynthesizeGLError(LOCAL_GL_INVALID_OPERATION);
 }
 
 void
 WebGLContext::ErrorInvalidValue(const char *fmt, ...)
 {
     va_list va;
     va_start(va, fmt);
-    LogMessage(fmt, va);
+    GenerateWarning(fmt, va);
     va_end(va);
 
     return SynthesizeGLError(LOCAL_GL_INVALID_VALUE);
 }
 
 void
 WebGLContext::ErrorInvalidFramebufferOperation(const char *fmt, ...)
 {
     va_list va;
     va_start(va, fmt);
-    LogMessage(fmt, va);
+    GenerateWarning(fmt, va);
     va_end(va);
 
     return SynthesizeGLError(LOCAL_GL_INVALID_FRAMEBUFFER_OPERATION);
 }
 
 void
 WebGLContext::ErrorOutOfMemory(const char *fmt, ...)
 {
     va_list va;
     va_start(va, fmt);
-    LogMessage(fmt, va);
+    GenerateWarning(fmt, va);
     va_end(va);
 
     return SynthesizeGLError(LOCAL_GL_OUT_OF_MEMORY);
 }
 
 const char *
 WebGLContext::ErrorName(GLenum error)
 {
--- a/content/canvas/src/WebGLContextValidate.cpp
+++ b/content/canvas/src/WebGLContextValidate.cpp
@@ -588,17 +588,17 @@ bool WebGLContext::ValidateStencilParams
 
 bool
 WebGLContext::InitAndValidateGL()
 {
     if (!gl) return false;
 
     GLenum error = gl->fGetError();
     if (error != LOCAL_GL_NO_ERROR) {
-        LogMessage("GL error 0x%x occurred during OpenGL context initialization, before WebGL initialization!", error);
+        GenerateWarning("GL error 0x%x occurred during OpenGL context initialization, before WebGL initialization!", error);
         return false;
     }
 
     mMinCapability = Preferences::GetBool("webgl.min_capability_mode", false);
     mDisableExtensions = Preferences::GetBool("webgl.disable-extensions", false);
 
     mActiveTexture = 0;
     mWebGLError = LOCAL_GL_NO_ERROR;
@@ -623,32 +623,32 @@ WebGLContext::InitAndValidateGL()
     }
 
     if (MinCapabilityMode()) {
         mGLMaxVertexAttribs = MINVALUE_GL_MAX_VERTEX_ATTRIBS;
     } else {
         gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_ATTRIBS, &mGLMaxVertexAttribs);
     }
     if (mGLMaxVertexAttribs < 8) {
-        LogMessage("GL_MAX_VERTEX_ATTRIBS: %d is < 8!", mGLMaxVertexAttribs);
+        GenerateWarning("GL_MAX_VERTEX_ATTRIBS: %d is < 8!", mGLMaxVertexAttribs);
         return false;
     }
 
     mAttribBuffers.SetLength(mGLMaxVertexAttribs);
 
     // Note: GL_MAX_TEXTURE_UNITS is fixed at 4 for most desktop hardware,
     // even though the hardware supports much more.  The
     // GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS value is the accurate value.
     if (MinCapabilityMode()) {
         mGLMaxTextureUnits = MINVALUE_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS;
     } else {
         gl->fGetIntegerv(LOCAL_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &mGLMaxTextureUnits);
     }
     if (mGLMaxTextureUnits < 8) {
-        LogMessage("GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: %d is < 8!", mGLMaxTextureUnits);
+        GenerateWarning("GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: %d is < 8!", mGLMaxTextureUnits);
         return false;
     }
 
     mBound2DTextures.SetLength(mGLMaxTextureUnits);
     mBoundCubeMapTextures.SetLength(mGLMaxTextureUnits);
 
     if (MinCapabilityMode()) {
         mGLMaxTextureSize = MINVALUE_GL_MAX_TEXTURE_SIZE;
@@ -679,17 +679,17 @@ WebGLContext::InitAndValidateGL()
 
             // we are now going to try to read GL_MAX_VERTEX_OUTPUT_COMPONENTS and GL_MAX_FRAGMENT_INPUT_COMPONENTS,
             // however these constants only entered the OpenGL standard at OpenGL 3.2. So we will try reading,
             // and check OpenGL error for INVALID_ENUM.
 
             // before we start, we check that no error already occurred, to prevent hiding it in our subsequent error handling
             error = gl->GetAndClearError();
             if (error != LOCAL_GL_NO_ERROR) {
-                LogMessage("GL error 0x%x occurred during WebGL context initialization!", error);
+                GenerateWarning("GL error 0x%x occurred during WebGL context initialization!", error);
                 return false;
             }
 
             // On the public_webgl list, "problematic GetParameter pnames" thread, the following formula was given:
             //   mGLMaxVaryingVectors = min (GL_MAX_VERTEX_OUTPUT_COMPONENTS, GL_MAX_FRAGMENT_INPUT_COMPONENTS) / 4
             GLint maxVertexOutputComponents,
                   minFragmentInputComponents;
             gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_OUTPUT_COMPONENTS, &maxVertexOutputComponents);
@@ -699,17 +699,17 @@ WebGLContext::InitAndValidateGL()
             switch (error) {
                 case LOCAL_GL_NO_ERROR:
                     mGLMaxVaryingVectors = NS_MIN(maxVertexOutputComponents, minFragmentInputComponents) / 4;
                     break;
                 case LOCAL_GL_INVALID_ENUM:
                     mGLMaxVaryingVectors = 16; // = 64/4, 64 is the min value for maxVertexOutputComponents in OpenGL 3.2 spec
                     break;
                 default:
-                    LogMessage("GL error 0x%x occurred during WebGL context initialization!", error);
+                    GenerateWarning("GL error 0x%x occurred during WebGL context initialization!", error);
                     return false;
             }   
         }
     }
 
     // Always 1 for GLES2
     mMaxFramebufferColorAttachments = 1;
 
@@ -741,27 +741,27 @@ WebGLContext::InitAndValidateGL()
 
     mShaderValidation =
         Preferences::GetBool("webgl.shader_validator", mShaderValidation);
 
 #if defined(USE_ANGLE)
     // initialize shader translator
     if (mShaderValidation) {
         if (!ShInitialize()) {
-            LogMessage("GLSL translator initialization failed!");
+            GenerateWarning("GLSL translator initialization failed!");
             return false;
         }
     }
 #endif
 
     // notice that the point of calling GetAndClearError here is not only to check for error,
     // it is also to reset the error flags so that a subsequent WebGL getError call will give the correct result.
     error = gl->GetAndClearError();
     if (error != LOCAL_GL_NO_ERROR) {
-        LogMessage("GL error 0x%x occurred during WebGL context initialization!", error);
+        GenerateWarning("GL error 0x%x occurred during WebGL context initialization!", error);
         return false;
     }
 
     mMemoryPressureObserver
         = new WebGLMemoryPressureObserver(this);
     nsCOMPtr<nsIObserverService> observerService
         = mozilla::services::GetObserverService();
     if (observerService) {