author | Kyle <kfung@mozilla.com> |
Thu, 16 Jul 2015 17:23:11 -0400 | |
changeset 253488 | 1ce930b301cb73c9f48e8a4f267d41ce1f23c819 |
parent 253487 | ecd916f018fdbad3a2332cc2c5d84b562d699f87 |
child 253489 | 571b4e0fdf538616f9800bcf72bd992ed16679f6 |
push id | 29067 |
push user | kwierso@gmail.com |
push date | Sat, 18 Jul 2015 00:57:04 +0000 |
treeherder | mozilla-central@e2f2eb9ecca0 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jgilbert |
bugs | 1106138 |
milestone | 42.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
|
--- a/dom/canvas/WebGLContext.cpp +++ b/dom/canvas/WebGLContext.cpp @@ -1962,17 +1962,17 @@ WebGLContext::TexSubImage2D(GLenum rawTe if (out_rv->Failed() || !data) return; gfx::IntSize size = data->GetSize(); uint32_t byteLength = data->Stride() * size.height; 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 RoundUpToMultipleOf(size_t value, size_t multiple) { size_t overshoot = value + multiple - 1; return overshoot - (overshoot % multiple); }
--- a/dom/canvas/WebGLContext.h +++ b/dom/canvas/WebGLContext.h @@ -622,17 +622,17 @@ public: return; gfx::IntSize size = data->GetSize(); uint32_t byteLength = data->Stride() * size.height; return TexImage2D_base(texImageTarget, level, internalFormat, 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) { TexParameter_base(target, pname, nullptr, ¶m); } void TexParameteri(GLenum target, GLenum pname, GLint param) { TexParameter_base(target, pname, ¶m, nullptr); }
--- a/dom/canvas/WebGLContextGL.cpp +++ b/dom/canvas/WebGLContextGL.cpp @@ -2487,30 +2487,16 @@ WebGLContext::SurfaceFromElementResultTo if (!res.mSourceSurface) return NS_OK; RefPtr<DataSourceSurface> data = res.mSourceSurface->GetDataSurface(); if (!data) { // SurfaceFromElement lied! 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 // pixel values in WebGL textures; see bug 655987. // // To prevent a loophole where a Canvas2D would be used as a proxy to load // cross-domain textures, we also disallow loading textures from write-only // Canvas2D's.