Backout cc37cd8dac59 (bug 744303) for M1 orange

This commit is contained in:
Ed Morley 2012-04-25 16:15:11 +01:00
parent e606921b41
commit c01b046b59
2 changed files with 2 additions and 42 deletions

View File

@ -5184,20 +5184,6 @@ WebGLContext::TexImage2D_base(WebGLenum target, WebGLint level, WebGLenum intern
int actualSrcFormat = srcFormat == WebGLTexelFormat::Auto ? dstFormat : srcFormat;
size_t srcStride = srcStrideOrZero ? srcStrideOrZero : checked_alignedRowSize.value();
if (gl->CanUploadBGRA() &&
actualSrcFormat == WebGLTexelFormat::BGRA8 &&
dstFormat == WebGLTexelFormat::RGBA8)
{
dstFormat = WebGLTexelFormat::BGRA8;
format = LOCAL_GL_BGRA;
if (gl->IsGLES2()) {
internalformat = LOCAL_GL_BGRA;
} else {
internalformat = LOCAL_GL_RGBA;
type = LOCAL_GL_UNSIGNED_INT_8_8_8_8_REV;
}
}
size_t dstPlainRowSize = texelSize * width;
size_t unpackAlignment = mPixelStoreUnpackAlignment;
size_t dstStride = ((dstPlainRowSize + unpackAlignment-1) / unpackAlignment) * unpackAlignment;
@ -5408,17 +5394,6 @@ WebGLContext::TexSubImage2D_base(WebGLenum target, WebGLint level,
// There are checks above to ensure that this won't overflow.
size_t dstStride = RoundedToNextMultipleOf(dstPlainRowSize, mPixelStoreUnpackAlignment).value();
if (gl->CanUploadBGRA() &&
actualSrcFormat == WebGLTexelFormat::BGRA8 &&
dstFormat == WebGLTexelFormat::RGBA8)
{
dstFormat = WebGLTexelFormat::BGRA8;
format = LOCAL_GL_BGRA;
if (!gl->IsGLES2()) {
type = LOCAL_GL_UNSIGNED_INT_8_8_8_8_REV;
}
}
if (actualSrcFormat == dstFormat &&
srcPremultiplied == mPixelStorePremultiplyAlpha &&
srcStride == dstStride &&

View File

@ -1517,7 +1517,7 @@ public:
Extensions_Max
};
bool IsExtensionSupported(GLExtensions aKnownExtension) const {
bool IsExtensionSupported(GLExtensions aKnownExtension) {
return mAvailableExtensions[aKnownExtension];
}
@ -1545,12 +1545,7 @@ public:
}
bool& operator[](size_t index) {
NS_ABORT_IF_FALSE(index < setlen, "out of range");
return values[index];
}
const bool& operator[](size_t index) const {
NS_ABORT_IF_FALSE(index < setlen, "out of range");
NS_ASSERTION(index < setlen, "out of range");
return values[index];
}
@ -1709,16 +1704,6 @@ public:
bool WorkAroundDriverBugs() const { return mWorkAroundDriverBugs; }
bool CanUploadBGRA() const {
if (!IsGLES2())
return true;
if (IsExtensionSupported(EXT_texture_format_BGRA8888))
return true;
return false;
}
protected:
nsDataHashtable<nsPtrHashKey<void>, void*> mUserData;