OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/webgl/WebGL2RenderingContextBase.h" | 5 #include "modules/webgl/WebGL2RenderingContextBase.h" |
6 | 6 |
7 #include "bindings/modules/v8/WebGLAny.h" | 7 #include "bindings/modules/v8/WebGLAny.h" |
8 #include "core/frame/ImageBitmap.h" | 8 #include "core/frame/ImageBitmap.h" |
9 #include "core/html/HTMLCanvasElement.h" | 9 #include "core/html/HTMLCanvasElement.h" |
10 #include "core/html/HTMLImageElement.h" | 10 #include "core/html/HTMLImageElement.h" |
(...skipping 2421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2432 long long offset) { | 2432 long long offset) { |
2433 if (isContextLost()) | 2433 if (isContextLost()) |
2434 return; | 2434 return; |
2435 if (index >= m_maxVertexAttribs) { | 2435 if (index >= m_maxVertexAttribs) { |
2436 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribIPointer", | 2436 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribIPointer", |
2437 "index out of range"); | 2437 "index out of range"); |
2438 return; | 2438 return; |
2439 } | 2439 } |
2440 if (!validateValueFitNonNegInt32("vertexAttribIPointer", "offset", offset)) | 2440 if (!validateValueFitNonNegInt32("vertexAttribIPointer", "offset", offset)) |
2441 return; | 2441 return; |
2442 if (!m_boundArrayBuffer) { | 2442 if (!m_boundArrayBuffer && offset != 0) { |
2443 synthesizeGLError(GL_INVALID_OPERATION, "vertexAttribIPointer", | 2443 synthesizeGLError(GL_INVALID_OPERATION, "vertexAttribIPointer", |
2444 "no bound ARRAY_BUFFER"); | 2444 "no ARRAY_BUFFER is bound and offset is non-zero"); |
2445 return; | 2445 return; |
2446 } | 2446 } |
2447 | 2447 |
2448 m_boundVertexArrayObject->setArrayBufferForAttrib(index, m_boundArrayBuffer); | 2448 m_boundVertexArrayObject->setArrayBufferForAttrib(index, m_boundArrayBuffer); |
2449 contextGL()->VertexAttribIPointer( | 2449 contextGL()->VertexAttribIPointer( |
2450 index, size, type, stride, | 2450 index, size, type, stride, |
2451 reinterpret_cast<void*>(static_cast<intptr_t>(offset))); | 2451 reinterpret_cast<void*>(static_cast<intptr_t>(offset))); |
2452 } | 2452 } |
2453 | 2453 |
2454 /* Writing to the drawing buffer */ | 2454 /* Writing to the drawing buffer */ |
(...skipping 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4854 | 4854 |
4855 void WebGL2RenderingContextBase:: | 4855 void WebGL2RenderingContextBase:: |
4856 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 4856 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
4857 if (!contextGL()) | 4857 if (!contextGL()) |
4858 return; | 4858 return; |
4859 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 4859 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
4860 objectOrZero(m_boundPixelUnpackBuffer.get())); | 4860 objectOrZero(m_boundPixelUnpackBuffer.get())); |
4861 } | 4861 } |
4862 | 4862 |
4863 } // namespace blink | 4863 } // namespace blink |
OLD | NEW |