Address review comments.
draft
Address review comments.
--- a/dom/canvas/TexUnpackBlob.cpp
+++ b/dom/canvas/TexUnpackBlob.cpp
@@ -302,17 +302,17 @@ TexUnpackImage::TexOrSubImage(bool isSub
const gfx::IntSize destSize(mWidth, mHeight);
if (!gl->BlitHelper()->BlitImageToFramebuffer(mImage, destSize, scopedFB.FB(),
dstOrigin))
{
break;
}
- return;
+ return; // Blitting was successful, so we're done!
} while (false);
TexUnpackSurface surfBlob(mImage->GetAsSourceSurface(), mIsAlphaPremult);
surfBlob.TexOrSubImage(isSubImage, needsRespec, funcName, tex, target, level, dui,
xOffset, yOffset, zOffset, out_glError);
}
--- a/dom/canvas/WebGLTexture.cpp
+++ b/dom/canvas/WebGLTexture.cpp
@@ -197,17 +197,17 @@ MaxMipmapLevelsForSize(const WebGLTextur
}
bool
WebGLTexture::IsMipmapComplete() const
{
MOZ_ASSERT(DoesMinFilterRequireMipmap());
// GLES 3.0.4, p161
- const auto maxLevel = MaxEffectiveMipmapLevel();
+ const uint32_t maxLevel = MaxEffectiveMipmapLevel();
// "* `level_base <= level_max`"
if (mBaseMipmapLevel > maxLevel)
return false;
// Make a copy so we can modify it.
const ImageInfo& baseImageInfo = BaseImageInfo();
if (!baseImageInfo.IsDefined())
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -952,16 +952,17 @@ WebGLTexture::TexStorage(const char* fun
const auto lastLevel = levels - 1;
MOZ_ASSERT(lastLevel <= 31, "Right-shift is only defined for bits-1.");
const uint32_t lastLevelWidth = uint32_t(width) >> lastLevel;
const uint32_t lastLevelHeight = uint32_t(height) >> lastLevel;
const uint32_t lastLevelDepth = uint32_t(depth) >> lastLevel;
+ // If these are all zero, then some earlier level was the final 1x1x1 level.
if (!lastLevelWidth && !lastLevelHeight && !lastLevelDepth) {
mContext->ErrorInvalidOperation("%s: Too many levels requested for the given"
" dimensions. (levels: %u, width: %u, height: %u,"
" depth: %u)",
funcName, levels, width, height, depth);
return;
}
@@ -1206,20 +1207,20 @@ WebGLTexture::TexSubImage(const char* fu
yOffset, zOffset, blob->mWidth,
blob->mHeight, blob->mDepth, imageInfo,
&uploadWillInitialize))
{
return;
}
const bool isSubImage = true;
- const bool needsRespect = false;
+ const bool needsRespec = false;
GLenum glError;
- blob->TexOrSubImage(isSubImage, needsRespect, funcName, this, target, level,
+ blob->TexOrSubImage(isSubImage, needsRespec, funcName, this, target, level,
driverUnpackInfo, xOffset, yOffset, zOffset, &glError);
if (glError == LOCAL_GL_OUT_OF_MEMORY) {
mContext->ErrorOutOfMemory("%s: Driver ran out of memory during upload.",
funcName);
return;
}
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -2578,17 +2578,17 @@ GLContext::FlushIfHeavyGLCallsSinceLastF
}
MakeCurrent();
fFlush();
}
/*static*/ bool
GLContext::ShouldDumpExts()
{
- return true; //gfxEnv::GlDumpExtensions();
+ return gfxEnv::GlDumpExtensions();
}
bool
DoesStringMatch(const char* aString, const char *aWantedString)
{
if (!aString || !aWantedString)
return false;