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 6108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6119 long long offset) { | 6119 long long offset) { |
6120 if (isContextLost()) | 6120 if (isContextLost()) |
6121 return; | 6121 return; |
6122 if (index >= m_maxVertexAttribs) { | 6122 if (index >= m_maxVertexAttribs) { |
6123 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribPointer", | 6123 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribPointer", |
6124 "index out of range"); | 6124 "index out of range"); |
6125 return; | 6125 return; |
6126 } | 6126 } |
6127 if (!validateValueFitNonNegInt32("vertexAttribPointer", "offset", offset)) | 6127 if (!validateValueFitNonNegInt32("vertexAttribPointer", "offset", offset)) |
6128 return; | 6128 return; |
6129 if (!m_boundArrayBuffer) { | 6129 if (!m_boundArrayBuffer && offset != 0) { |
6130 synthesizeGLError(GL_INVALID_OPERATION, "vertexAttribPointer", | 6130 synthesizeGLError(GL_INVALID_OPERATION, "vertexAttribPointer", |
6131 "no bound ARRAY_BUFFER"); | 6131 "no ARRAY_BUFFER is bound and offset is non-zero"); |
6132 return; | 6132 return; |
6133 } | 6133 } |
6134 | 6134 |
6135 m_boundVertexArrayObject->setArrayBufferForAttrib(index, | 6135 m_boundVertexArrayObject->setArrayBufferForAttrib(index, |
6136 m_boundArrayBuffer.get()); | 6136 m_boundArrayBuffer.get()); |
6137 contextGL()->VertexAttribPointer( | 6137 contextGL()->VertexAttribPointer( |
6138 index, size, type, normalized, stride, | 6138 index, size, type, normalized, stride, |
6139 reinterpret_cast<void*>(static_cast<intptr_t>(offset))); | 6139 reinterpret_cast<void*>(static_cast<intptr_t>(offset))); |
6140 } | 6140 } |
6141 | 6141 |
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7809 | 7809 |
7810 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( | 7810 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( |
7811 HTMLCanvasElementOrOffscreenCanvas& result) const { | 7811 HTMLCanvasElementOrOffscreenCanvas& result) const { |
7812 if (canvas()) | 7812 if (canvas()) |
7813 result.setHTMLCanvasElement(canvas()); | 7813 result.setHTMLCanvasElement(canvas()); |
7814 else | 7814 else |
7815 result.setOffscreenCanvas(offscreenCanvas()); | 7815 result.setOffscreenCanvas(offscreenCanvas()); |
7816 } | 7816 } |
7817 | 7817 |
7818 } // namespace blink | 7818 } // namespace blink |
OLD | NEW |