Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp |
diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
index c042e9733c01fc3c39b51f5bc61044aca0247b66..1be77627ede3ced873072b73fc4280476c4d5f9a 100644 |
--- a/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
+++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
@@ -1450,6 +1450,9 @@ void WebGLRenderingContextBase::colorMask(GLboolean red, GLboolean green, GLbool |
{ |
if (isContextLost()) |
return; |
+ // Disable alpha writes, if requested alpha attribute is false & backbuffer allocated as GL_RGBA |
+ if (!m_requestedAttributes.alpha() && !drawingBuffer()->isRGBTextureSupported()) |
+ alpha = '\0'; |
Ken Russell (switch to Gerrit)
2015/04/06 21:43:18
That's a strange way to write that constant. Pleas
|
m_colorMask[0] = red; |
m_colorMask[1] = green; |
m_colorMask[2] = blue; |
@@ -2342,7 +2345,10 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* scriptState, GL |
case GL_ALIASED_POINT_SIZE_RANGE: |
return getWebGLFloatArrayParameter(scriptState, pname); |
case GL_ALPHA_BITS: |
- return getIntParameter(scriptState, pname); |
+ // Report 0 bits, if requested alpha attribute is false & backbuffer allocated as GL_RGBA |
+ return (!m_requestedAttributes.alpha() && !drawingBuffer()->isRGBTextureSupported()) > 0 |
Ken Russell (switch to Gerrit)
2015/04/06 21:43:18
This is a strange way to write a boolean test. Ple
|
+ ? WebGLAny(scriptState, intZero) |
+ : getIntParameter(scriptState, pname); |
Ken Russell (switch to Gerrit)
2015/04/06 21:43:18
Please also fix up the query of COLOR_WRITEMASK.
|
case GL_ARRAY_BUFFER_BINDING: |
return WebGLAny(scriptState, PassRefPtrWillBeRawPtr<WebGLObject>(m_boundArrayBuffer.get())); |
case GL_BLEND: |