Index: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
index 33c94ce4305b2b71abc3ffa947e9bfeff9a3c3aa..e16458c4a414d754dfa47140af925ae7d9e66be4 100644 |
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
@@ -243,17 +243,28 @@ void WebGL2RenderingContextBase::blitFramebuffer(GLint srcX0, GLint srcY0, GLint |
webContext()->blitFramebufferCHROMIUM(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
} |
-void WebGL2RenderingContextBase::framebufferTextureLayer(GLenum target, GLenum attachment, const WebGLTexture* texture, GLint level, GLint layer) |
+void WebGL2RenderingContextBase::framebufferTextureLayer(ScriptState* scriptState, GLenum target, GLenum attachment, WebGLTexture* texture, GLint level, GLint layer) |
{ |
if (isContextLost()) |
return; |
- |
if (texture && !texture->validate(contextGroup(), this)) { |
synthesizeGLError(GL_INVALID_VALUE, "framebufferTextureLayer", "no texture or texture not from this context"); |
return; |
} |
+ GLenum textarget = texture->getTarget(); |
+ if (!validateTexFuncLevel("framebufferTextureLayer", textarget, level)) |
+ return; |
+ |
+ WebGLFramebuffer* framebufferBinding = getFramebufferBinding(target); |
+ if (!framebufferBinding || !framebufferBinding->object()) { |
+ synthesizeGLError(GL_INVALID_OPERATION, "framebufferTextureLayer", "no framebuffer bound"); |
+ return; |
+ } |
webContext()->framebufferTextureLayer(target, attachment, objectOrZero(texture), level, layer); |
+ framebufferBinding->setAttachmentForBoundFramebuffer(target, attachment, textarget, texture, level); |
Zhenyao Mo
2015/10/26 21:50:33
You miss validation of target, attachment, texture
qiankun
2015/10/27 14:26:31
More validations were added. Incorporated layer pa
|
+ applyStencilTest(); |
+ preserveObjectWrapper(scriptState, framebufferBinding, "texture3d", attachment, texture); |
Ken Russell (switch to Gerrit)
2015/10/26 21:23:09
I made a mistake in the original patch adding thes
qiankun
2015/10/27 14:26:31
Done.
|
} |
ScriptValue WebGL2RenderingContextBase::getInternalformatParameter(ScriptState* scriptState, GLenum target, GLenum internalformat, GLenum pname) |