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

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

Issue 1060583003: WebGL backbuffer creation on Mali-400 GPU Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added comments Created 5 years, 8 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
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:
« no previous file with comments | « no previous file | Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | Source/platform/graphics/gpu/DrawingBuffer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698