| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2032 webContext()->framebufferRenderbuffer(target, attachment, renderbufferta
rget, bufferObject); | 2032 webContext()->framebufferRenderbuffer(target, attachment, renderbufferta
rget, bufferObject); |
| 2033 } | 2033 } |
| 2034 m_framebufferBinding->setAttachmentForBoundFramebuffer(attachment, buffer); | 2034 m_framebufferBinding->setAttachmentForBoundFramebuffer(attachment, buffer); |
| 2035 applyStencilTest(); | 2035 applyStencilTest(); |
| 2036 } | 2036 } |
| 2037 | 2037 |
| 2038 void WebGLRenderingContextBase::framebufferTexture2D(GLenum target, GLenum attac
hment, GLenum textarget, WebGLTexture* texture, GLint level) | 2038 void WebGLRenderingContextBase::framebufferTexture2D(GLenum target, GLenum attac
hment, GLenum textarget, WebGLTexture* texture, GLint level) |
| 2039 { | 2039 { |
| 2040 if (isContextLost() || !validateFramebufferFuncParameters("framebufferTextur
e2D", target, attachment)) | 2040 if (isContextLost() || !validateFramebufferFuncParameters("framebufferTextur
e2D", target, attachment)) |
| 2041 return; | 2041 return; |
| 2042 if (level) { | 2042 if (isWebGL2OrHigher()) { |
| 2043 if (!validateTexFuncLevel("framebufferTexture2D", textarget, level)) |
| 2044 return; |
| 2045 } else if (level) { |
| 2043 synthesizeGLError(GL_INVALID_VALUE, "framebufferTexture2D", "level not 0
"); | 2046 synthesizeGLError(GL_INVALID_VALUE, "framebufferTexture2D", "level not 0
"); |
| 2044 return; | 2047 return; |
| 2045 } | 2048 } |
| 2046 if (texture && !texture->validate(contextGroup(), this)) { | 2049 if (texture && !texture->validate(contextGroup(), this)) { |
| 2047 synthesizeGLError(GL_INVALID_OPERATION, "framebufferTexture2D", "no text
ure or texture not from this context"); | 2050 synthesizeGLError(GL_INVALID_OPERATION, "framebufferTexture2D", "no text
ure or texture not from this context"); |
| 2048 return; | 2051 return; |
| 2049 } | 2052 } |
| 2050 // Don't allow the default framebuffer to be mutated; all current | 2053 // Don't allow the default framebuffer to be mutated; all current |
| 2051 // implementations use an FBO internally in place of the default | 2054 // implementations use an FBO internally in place of the default |
| 2052 // FBO. | 2055 // FBO. |
| (...skipping 4159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6212 | 6215 |
| 6213 return totalBytesPerPixel; | 6216 return totalBytesPerPixel; |
| 6214 } | 6217 } |
| 6215 | 6218 |
| 6216 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6219 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
| 6217 { | 6220 { |
| 6218 return m_drawingBuffer.get(); | 6221 return m_drawingBuffer.get(); |
| 6219 } | 6222 } |
| 6220 | 6223 |
| 6221 } // namespace blink | 6224 } // namespace blink |
| OLD | NEW |