Bug 1106138 - Remove the early unpremultiply in WebGLContext::SurfaceFromElementResultToImageSurface, and let the texel conversion code handle it instead. r=jgilbert

This commit is contained in:
Kyle 2015-07-16 17:23:11 -04:00
parent b3d249d3b0
commit f300a1992f
3 changed files with 2 additions and 16 deletions

View File

@ -1967,7 +1967,7 @@ WebGLContext::TexSubImage2D(GLenum rawTexImageTarget, GLint level, GLint xoffset
TexSubImage2D_base(texImageTarget.get(), level, xoffset, yoffset, size.width,
size.height, data->Stride(), format, type, data->GetData(),
byteLength, js::Scalar::MaxTypedArrayViewType, srcFormat,
mPixelStorePremultiplyAlpha);
res.mIsPremultiplied);
}
size_t

View File

@ -627,7 +627,7 @@ public:
size.width, size.height, data->Stride(), 0,
format, type, data->GetData(), byteLength,
js::Scalar::MaxTypedArrayViewType, srcFormat,
mPixelStorePremultiplyAlpha);
res.mIsPremultiplied);
}
void TexParameterf(GLenum target, GLenum pname, GLfloat param) {

View File

@ -2492,20 +2492,6 @@ WebGLContext::SurfaceFromElementResultToImageSurface(nsLayoutUtils::SurfaceFromE
return NS_OK;
}
if (!mPixelStorePremultiplyAlpha && res.mIsPremultiplied) {
switch (data->GetFormat()) {
case SurfaceFormat::B8G8R8X8:
// No alpha, so de-facto premult'd.
break;
case SurfaceFormat::B8G8R8A8:
data = gfxUtils::CreateUnpremultipliedDataSurface(data);
break;
default:
MOZ_ASSERT(false, "Format unsupported.");
break;
}
}
// We disallow loading cross-domain images and videos that have not been validated
// with CORS as WebGL textures. The reason for doing that is that timing
// attacks on WebGL shaders are able to retrieve approximations of the