Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1199)

Unified Diff: Source/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 1160493002: Determine WebGL back-buffer on Mali-400 GPU Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp
diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
index 81550c6b5c79f743e923a2ce6fb6608fa4b07017..35b79306c6fd03a6aed39e60ebc93e3324e65a06 100644
--- a/Source/core/html/canvas/WebGLRenderingContextBase.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
@@ -1455,6 +1455,9 @@ void WebGLRenderingContextBase::colorMask(GLboolean red, GLboolean green, GLbool
{
if (isContextLost())
return;
+ if (!m_requestedAttributes.alpha() && !drawingBuffer()->isRGBTextureSupported())
+ alpha = GL_FALSE;
+
m_colorMask[0] = red;
m_colorMask[1] = green;
m_colorMask[2] = blue;
@@ -2384,7 +2387,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 & drawingbuffer allocated as GL_RGBA
+ return (!m_requestedAttributes.alpha() && !drawingBuffer()->isRGBTextureSupported())
+ ? WebGLAny(scriptState, intZero)
+ : getIntParameter(scriptState, pname);
case GL_ARRAY_BUFFER_BINDING:
return WebGLAny(scriptState, PassRefPtrWillBeRawPtr<WebGLObject>(m_boundArrayBuffer.get()));
case GL_BLEND:
@@ -2408,7 +2414,9 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* scriptState, GL
case GL_COLOR_CLEAR_VALUE:
return getWebGLFloatArrayParameter(scriptState, pname);
case GL_COLOR_WRITEMASK:
- return getBooleanArrayParameter(scriptState, pname);
+ return (!m_requestedAttributes.alpha() && !drawingBuffer()->isRGBTextureSupported())
+ ? WebGLAny(scriptState, intZero)
+ : getBooleanArrayParameter(scriptState, pname);
case GL_COMPRESSED_TEXTURE_FORMATS:
return WebGLAny(scriptState, DOMUint32Array::create(m_compressedTextureFormats.data(), m_compressedTextureFormats.size()));
case GL_CULL_FACE:
« no previous file with comments | « no previous file | Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698