mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 743753 - 3/4 - WebGL: rename LogMessage to GenerateWarning - r=vlad
This commit is contained in:
parent
ce9986904d
commit
2596ecaf92
@ -299,7 +299,7 @@ WebGLContext::SetContextOptions(nsIPropertyBag *aOptions)
|
||||
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,
|
||||
@ -493,7 +493,7 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -503,10 +503,10 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
|
||||
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
|
||||
@ -514,7 +514,7 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -524,7 +524,7 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -534,16 +534,16 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -1369,8 +1369,8 @@ protected:
|
||||
|
||||
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;
|
||||
@ -1980,12 +1980,12 @@ public:
|
||||
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;
|
||||
@ -1994,12 +1994,12 @@ public:
|
||||
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);
|
||||
@ -2016,12 +2016,12 @@ public:
|
||||
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;
|
||||
@ -2030,12 +2030,12 @@ public:
|
||||
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;
|
||||
|
@ -504,7 +504,7 @@ WebGLContext::BufferData(WebGLenum target, WebGLsizeiptr size,
|
||||
|
||||
GLenum error = CheckedBufferData(target, size, 0, usage);
|
||||
if (error) {
|
||||
LogMessage("bufferData generated error %s", ErrorName(error));
|
||||
GenerateWarning("bufferData generated error %s", ErrorName(error));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -546,7 +546,7 @@ WebGLContext::BufferData(WebGLenum target, ArrayBuffer *data, WebGLenum usage)
|
||||
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;
|
||||
}
|
||||
|
||||
@ -582,7 +582,7 @@ WebGLContext::BufferData(WebGLenum target, ArrayBufferView& data, WebGLenum usag
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@ -1063,7 +1063,7 @@ WebGLContext::CopyTexImage2D(WebGLenum target,
|
||||
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 {
|
||||
@ -3784,7 +3784,7 @@ WebGLContext::ReadPixels(WebGLint x, WebGLint y, WebGLsizei width,
|
||||
}
|
||||
|
||||
if (HTMLCanvasElement()->IsWriteOnly() && !nsContentUtils::IsCallerTrustedForRead()) {
|
||||
LogMessage("ReadPixels: Not allowed");
|
||||
GenerateWarning("ReadPixels: Not allowed");
|
||||
return rv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
|
||||
@ -4065,7 +4065,7 @@ WebGLContext::RenderbufferStorage(WebGLenum target, WebGLenum internalformat, We
|
||||
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 {
|
||||
@ -4302,7 +4302,7 @@ WebGLContext::DOMElementToImageSurface(Element* imageOrCanvas,
|
||||
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;
|
||||
}
|
||||
@ -4313,7 +4313,7 @@ WebGLContext::DOMElementToImageSurface(Element* imageOrCanvas,
|
||||
// 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");
|
||||
@ -4779,7 +4779,7 @@ WebGLContext::ValidateProgram(WebGLProgram *prog)
|
||||
#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
|
||||
@ -5630,7 +5630,7 @@ WebGLContext::TexImage2D_base(WebGLenum target, WebGLint level, WebGLenum intern
|
||||
}
|
||||
|
||||
if (error) {
|
||||
LogMessage("texImage2D generated error %s", ErrorName(error));
|
||||
GenerateWarning("texImage2D generated error %s", ErrorName(error));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -32,18 +32,18 @@
|
||||
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;
|
||||
|
||||
@ -108,7 +108,7 @@ 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);
|
||||
@ -119,7 +119,7 @@ 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);
|
||||
@ -130,7 +130,7 @@ 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);
|
||||
@ -141,7 +141,7 @@ 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);
|
||||
@ -152,7 +152,7 @@ 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);
|
||||
@ -163,7 +163,7 @@ 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);
|
||||
|
@ -593,7 +593,7 @@ WebGLContext::InitAndValidateGL()
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@ -628,7 +628,7 @@ WebGLContext::InitAndValidateGL()
|
||||
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;
|
||||
}
|
||||
|
||||
@ -643,7 +643,7 @@ WebGLContext::InitAndValidateGL()
|
||||
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;
|
||||
}
|
||||
|
||||
@ -684,7 +684,7 @@ WebGLContext::InitAndValidateGL()
|
||||
// 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;
|
||||
}
|
||||
|
||||
@ -704,7 +704,7 @@ WebGLContext::InitAndValidateGL()
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -746,7 +746,7 @@ WebGLContext::InitAndValidateGL()
|
||||
// initialize shader translator
|
||||
if (mShaderValidation) {
|
||||
if (!ShInitialize()) {
|
||||
LogMessage("GLSL translator initialization failed!");
|
||||
GenerateWarning("GLSL translator initialization failed!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -756,7 +756,7 @@ WebGLContext::InitAndValidateGL()
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user