Chromium Code Reviews| Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp |
| diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
| index 6c7ef4a61200aa725abc1486c827a51c0fb337a0..2998abb1ce4fed3be7a403848bd073fc7dd3add5 100644 |
| --- a/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
| +++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
| @@ -1369,7 +1369,7 @@ GLenum WebGLRenderingContextBase::checkFramebufferStatus(GLenum target) |
| { |
| if (isContextLost()) |
| return GL_FRAMEBUFFER_UNSUPPORTED; |
| - if (target != GL_FRAMEBUFFER) { |
| + if (!((isWebGL2OrHigher() && (target == GL_READ_FRAMEBUFFER || target == GL_DRAW_FRAMEBUFFER)) || target == GL_FRAMEBUFFER)) { |
|
Ken Russell (switch to Gerrit)
2015/04/23 17:54:31
These nested expressions are unreadable. Please fa
yunchao
2015/04/24 07:07:34
Agree. It is much clear. In fact, I also thought a
|
| synthesizeGLError(GL_INVALID_ENUM, "checkFramebufferStatus", "invalid target"); |
| return 0; |
| } |
| @@ -5374,7 +5374,7 @@ void WebGLRenderingContextBase::printWarningToConsole(const String& message) |
| bool WebGLRenderingContextBase::validateFramebufferFuncParameters(const char* functionName, GLenum target, GLenum attachment) |
| { |
| - if (target != GL_FRAMEBUFFER) { |
| + if (!((isWebGL2OrHigher() && (target == GL_READ_FRAMEBUFFER || target == GL_DRAW_FRAMEBUFFER)) || target == GL_FRAMEBUFFER)) { |
| synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid target"); |
| return false; |
| } |