Chromium Code Reviews| Index: third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp |
| diff --git a/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp b/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp |
| index 348c02d7aaea6707c807c203935003bae30bace7..6a44cef61f1d4c3fce8ad888de7b7b43766df3f5 100644 |
| --- a/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp |
| +++ b/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp |
| @@ -50,6 +50,7 @@ private: |
| GLsizei height() const override; |
| GLenum format() const override; |
| GLenum type() const override; |
| + bool isCubeComplete() const override; |
| WebGLSharedObject* object() const override; |
| bool isSharedObject(WebGLSharedObject*) const override; |
| bool valid() const override; |
| @@ -143,6 +144,11 @@ GLenum WebGLRenderbufferAttachment::type() const |
| return WebGLTexture::getValidTypeForInternalFormat(m_renderbuffer->internalFormat()); |
| } |
| +bool WebGLRenderbufferAttachment::isCubeComplete() const |
| +{ |
| + return false; |
|
zmo
2015/11/23 19:40:44
Maybe ASSERT_NOT_REACHED() here?
qiankun
2015/11/24 04:11:42
Done.
|
| +} |
| + |
| class WebGLTextureAttachment final : public WebGLFramebuffer::WebGLAttachment { |
| public: |
| static WebGLFramebuffer::WebGLAttachment* create(WebGLTexture*, GLenum target, GLint level, GLint layer); |
| @@ -157,6 +163,7 @@ private: |
| GLsizei height() const override; |
| GLenum format() const override; |
| GLenum type() const override; |
| + bool isCubeComplete() const override; |
| WebGLSharedObject* object() const override; |
| bool isSharedObject(WebGLSharedObject*) const override; |
| bool valid() const override; |
| @@ -254,6 +261,11 @@ GLenum WebGLTextureAttachment::type() const |
| return m_texture->getType(m_target, m_level); |
| } |
| +bool WebGLTextureAttachment::isCubeComplete() const |
| +{ |
| + return m_texture->isCubeComplete(); |
| +} |
| + |
| bool isColorRenderable(GLenum internalformat, bool includesFloat) |
| { |
| switch (internalformat) { |
| @@ -450,6 +462,12 @@ bool WebGLFramebuffer::isAttachmentComplete(WebGLAttachment* attachedObject, GLe |
| *reason = "attachment has a 0 dimension"; |
| return false; |
| } |
| + |
| + if (attachedObject->object()->isTexture() && !attachedObject->isCubeComplete()) { |
| + *reason ="attachment is not cube complete"; |
|
Ken Russell (switch to Gerrit)
2015/11/24 00:37:03
Add space after =.
qiankun
2015/11/24 04:11:43
Done.
|
| + return false; |
| + } |
| + |
| return true; |
| } |