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 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1817 synthesizeGLError(GL_INVALID_ENUM, "compressedTexSubImage2D", "invalid f ormat"); | 1817 synthesizeGLError(GL_INVALID_ENUM, "compressedTexSubImage2D", "invalid f ormat"); |
1818 return; | 1818 return; |
1819 } | 1819 } |
1820 if (!validateCompressedTexFuncData("compressedTexSubImage2D", width, height, format, data)) | 1820 if (!validateCompressedTexFuncData("compressedTexSubImage2D", width, height, format, data)) |
1821 return; | 1821 return; |
1822 | 1822 |
1823 WebGLTexture* tex = validateTextureBinding("compressedTexSubImage2D", target , true); | 1823 WebGLTexture* tex = validateTextureBinding("compressedTexSubImage2D", target , true); |
1824 if (!tex) | 1824 if (!tex) |
1825 return; | 1825 return; |
1826 | 1826 |
1827 if (format != tex->getInternalFormat(target, level)) { | 1827 if (!isWebGL2OrHigher() && format != tex->getInternalFormat(target, level)) { |
Zhenyao Mo
2015/07/29 20:57:57
It might be OK for now, but we do need to validate
| |
1828 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", "form at does not match texture format"); | 1828 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", "form at does not match texture format"); |
1829 return; | 1829 return; |
1830 } | 1830 } |
1831 | 1831 |
1832 if (!validateCompressedTexSubDimensions("compressedTexSubImage2D", target, l evel, xoffset, yoffset, width, height, format, tex)) | 1832 if (!validateCompressedTexSubDimensions("compressedTexSubImage2D", target, l evel, xoffset, yoffset, width, height, format, tex)) |
1833 return; | 1833 return; |
1834 | 1834 |
1835 webContext()->compressedTexSubImage2D(target, level, xoffset, yoffset, | 1835 webContext()->compressedTexSubImage2D(target, level, xoffset, yoffset, |
1836 width, height, format, data->byteLength(), data->baseAddress()); | 1836 width, height, format, data->byteLength(), data->baseAddress()); |
1837 } | 1837 } |
(...skipping 4757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6595 | 6595 |
6596 return totalBytesPerPixel; | 6596 return totalBytesPerPixel; |
6597 } | 6597 } |
6598 | 6598 |
6599 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6599 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
6600 { | 6600 { |
6601 return m_drawingBuffer.get(); | 6601 return m_drawingBuffer.get(); |
6602 } | 6602 } |
6603 | 6603 |
6604 } // namespace blink | 6604 } // namespace blink |
OLD | NEW |