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 6094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6105 long long offset) { | 6105 long long offset) { |
6106 if (isContextLost()) | 6106 if (isContextLost()) |
6107 return; | 6107 return; |
6108 if (index >= m_maxVertexAttribs) { | 6108 if (index >= m_maxVertexAttribs) { |
6109 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribPointer", | 6109 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribPointer", |
6110 "index out of range"); | 6110 "index out of range"); |
6111 return; | 6111 return; |
6112 } | 6112 } |
6113 if (!validateValueFitNonNegInt32("vertexAttribPointer", "offset", offset)) | 6113 if (!validateValueFitNonNegInt32("vertexAttribPointer", "offset", offset)) |
6114 return; | 6114 return; |
6115 if (!m_boundArrayBuffer) { | 6115 if (!m_boundArrayBuffer && offset != 0) { |
6116 synthesizeGLError(GL_INVALID_OPERATION, "vertexAttribPointer", | 6116 synthesizeGLError(GL_INVALID_OPERATION, "vertexAttribPointer", |
6117 "no bound ARRAY_BUFFER"); | 6117 "no ARRAY_BUFFER is bound and offset is non-zero"); |
6118 return; | 6118 return; |
6119 } | 6119 } |
6120 | 6120 |
6121 m_boundVertexArrayObject->setArrayBufferForAttrib(index, | 6121 m_boundVertexArrayObject->setArrayBufferForAttrib(index, |
6122 m_boundArrayBuffer.get()); | 6122 m_boundArrayBuffer.get()); |
6123 contextGL()->VertexAttribPointer( | 6123 contextGL()->VertexAttribPointer( |
6124 index, size, type, normalized, stride, | 6124 index, size, type, normalized, stride, |
6125 reinterpret_cast<void*>(static_cast<intptr_t>(offset))); | 6125 reinterpret_cast<void*>(static_cast<intptr_t>(offset))); |
6126 } | 6126 } |
6127 | 6127 |
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7795 | 7795 |
7796 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( | 7796 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( |
7797 HTMLCanvasElementOrOffscreenCanvas& result) const { | 7797 HTMLCanvasElementOrOffscreenCanvas& result) const { |
7798 if (canvas()) | 7798 if (canvas()) |
7799 result.setHTMLCanvasElement(canvas()); | 7799 result.setHTMLCanvasElement(canvas()); |
7800 else | 7800 else |
7801 result.setOffscreenCanvas(offscreenCanvas()); | 7801 result.setOffscreenCanvas(offscreenCanvas()); |
7802 } | 7802 } |
7803 | 7803 |
7804 } // namespace blink | 7804 } // namespace blink |
OLD | NEW |