| 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 <memory> | 7 #include <memory> |
| 8 #include "bindings/modules/v8/WebGLAny.h" | 8 #include "bindings/modules/v8/WebGLAny.h" |
| 9 #include "core/frame/ImageBitmap.h" | 9 #include "core/frame/ImageBitmap.h" |
| 10 #include "core/html/HTMLCanvasElement.h" | 10 #include "core/html/HTMLCanvasElement.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 unpack_image_height_ = 0; | 243 unpack_image_height_ = 0; |
| 244 unpack_skip_pixels_ = 0; | 244 unpack_skip_pixels_ = 0; |
| 245 unpack_skip_rows_ = 0; | 245 unpack_skip_rows_ = 0; |
| 246 unpack_skip_images_ = 0; | 246 unpack_skip_images_ = 0; |
| 247 | 247 |
| 248 WebGLRenderingContextBase::InitializeNewContext(); | 248 WebGLRenderingContextBase::InitializeNewContext(); |
| 249 } | 249 } |
| 250 | 250 |
| 251 void WebGL2RenderingContextBase::bufferData( | 251 void WebGL2RenderingContextBase::bufferData( |
| 252 GLenum target, | 252 GLenum target, |
| 253 NotShared<DOMArrayBufferView> src_data, | 253 MaybeShared<DOMArrayBufferView> src_data, |
| 254 GLenum usage, | 254 GLenum usage, |
| 255 GLuint src_offset, | 255 GLuint src_offset, |
| 256 GLuint length) { | 256 GLuint length) { |
| 257 if (isContextLost()) | 257 if (isContextLost()) |
| 258 return; | 258 return; |
| 259 void* sub_base_address = nullptr; | 259 void* sub_base_address = nullptr; |
| 260 long long sub_byte_length = 0; | 260 long long sub_byte_length = 0; |
| 261 if (!ValidateSubSourceAndGetData(src_data.View(), src_offset, length, | 261 if (!ValidateSubSourceAndGetData(src_data.View(), src_offset, length, |
| 262 &sub_base_address, &sub_byte_length)) { | 262 &sub_base_address, &sub_byte_length)) { |
| 263 SynthesizeGLError(GL_INVALID_VALUE, "bufferData", | 263 SynthesizeGLError(GL_INVALID_VALUE, "bufferData", |
| 264 "srcOffset + length too large"); | 264 "srcOffset + length too large"); |
| 265 return; | 265 return; |
| 266 } | 266 } |
| 267 BufferDataImpl(target, sub_byte_length, sub_base_address, usage); | 267 BufferDataImpl(target, sub_byte_length, sub_base_address, usage); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void WebGL2RenderingContextBase::bufferData(GLenum target, | 270 void WebGL2RenderingContextBase::bufferData(GLenum target, |
| 271 long long size, | 271 long long size, |
| 272 GLenum usage) { | 272 GLenum usage) { |
| 273 WebGLRenderingContextBase::bufferData(target, size, usage); | 273 WebGLRenderingContextBase::bufferData(target, size, usage); |
| 274 } | 274 } |
| 275 | 275 |
| 276 void WebGL2RenderingContextBase::bufferData(GLenum target, | 276 void WebGL2RenderingContextBase::bufferData(GLenum target, |
| 277 DOMArrayBuffer* data, | 277 DOMArrayBuffer* data, |
| 278 GLenum usage) { | 278 GLenum usage) { |
| 279 WebGLRenderingContextBase::bufferData(target, data, usage); | 279 WebGLRenderingContextBase::bufferData(target, data, usage); |
| 280 } | 280 } |
| 281 | 281 |
| 282 void WebGL2RenderingContextBase::bufferData(GLenum target, | 282 void WebGL2RenderingContextBase::bufferData( |
| 283 NotShared<DOMArrayBufferView> data, | 283 GLenum target, |
| 284 GLenum usage) { | 284 MaybeShared<DOMArrayBufferView> data, |
| 285 GLenum usage) { |
| 285 WebGLRenderingContextBase::bufferData(target, data, usage); | 286 WebGLRenderingContextBase::bufferData(target, data, usage); |
| 286 } | 287 } |
| 287 | 288 |
| 288 void WebGL2RenderingContextBase::bufferSubData( | 289 void WebGL2RenderingContextBase::bufferSubData( |
| 289 GLenum target, | 290 GLenum target, |
| 290 GLintptr dst_byte_offset, | 291 GLintptr dst_byte_offset, |
| 291 NotShared<DOMArrayBufferView> src_data, | 292 MaybeShared<DOMArrayBufferView> src_data, |
| 292 GLuint src_offset, | 293 GLuint src_offset, |
| 293 GLuint length) { | 294 GLuint length) { |
| 294 if (isContextLost()) | 295 if (isContextLost()) |
| 295 return; | 296 return; |
| 296 void* sub_base_address = nullptr; | 297 void* sub_base_address = nullptr; |
| 297 long long sub_byte_length = 0; | 298 long long sub_byte_length = 0; |
| 298 if (!ValidateSubSourceAndGetData(src_data.View(), src_offset, length, | 299 if (!ValidateSubSourceAndGetData(src_data.View(), src_offset, length, |
| 299 &sub_base_address, &sub_byte_length)) { | 300 &sub_base_address, &sub_byte_length)) { |
| 300 SynthesizeGLError(GL_INVALID_VALUE, "bufferSubData", | 301 SynthesizeGLError(GL_INVALID_VALUE, "bufferSubData", |
| 301 "srcOffset + length too large"); | 302 "srcOffset + length too large"); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 write_buffer->SetInitialTarget(read_buffer->GetInitialTarget()); | 364 write_buffer->SetInitialTarget(read_buffer->GetInitialTarget()); |
| 364 | 365 |
| 365 ContextGL()->CopyBufferSubData( | 366 ContextGL()->CopyBufferSubData( |
| 366 read_target, write_target, static_cast<GLintptr>(read_offset), | 367 read_target, write_target, static_cast<GLintptr>(read_offset), |
| 367 static_cast<GLintptr>(write_offset), static_cast<GLsizeiptr>(size)); | 368 static_cast<GLintptr>(write_offset), static_cast<GLsizeiptr>(size)); |
| 368 } | 369 } |
| 369 | 370 |
| 370 void WebGL2RenderingContextBase::getBufferSubData( | 371 void WebGL2RenderingContextBase::getBufferSubData( |
| 371 GLenum target, | 372 GLenum target, |
| 372 long long src_byte_offset, | 373 long long src_byte_offset, |
| 373 NotShared<DOMArrayBufferView> dst_data, | 374 MaybeShared<DOMArrayBufferView> dst_data, |
| 374 GLuint dst_offset, | 375 GLuint dst_offset, |
| 375 GLuint length) { | 376 GLuint length) { |
| 376 WebGLBuffer* source_buffer = nullptr; | 377 WebGLBuffer* source_buffer = nullptr; |
| 377 void* destination_data_ptr = nullptr; | 378 void* destination_data_ptr = nullptr; |
| 378 long long destination_byte_length = 0; | 379 long long destination_byte_length = 0; |
| 379 const char* message = ValidateGetBufferSubData( | 380 const char* message = ValidateGetBufferSubData( |
| 380 __FUNCTION__, target, src_byte_offset, dst_data.View(), dst_offset, | 381 __FUNCTION__, target, src_byte_offset, dst_data.View(), dst_offset, |
| 381 length, &source_buffer, &destination_data_ptr, &destination_byte_length); | 382 length, &source_buffer, &destination_data_ptr, &destination_byte_length); |
| 382 if (message) { | 383 if (message) { |
| 383 // If there was a GL error, it was already synthesized in | 384 // If there was a GL error, it was already synthesized in |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 ContextGL()->PixelStorei(pname, param); | 753 ContextGL()->PixelStorei(pname, param); |
| 753 } | 754 } |
| 754 | 755 |
| 755 void WebGL2RenderingContextBase::readPixels( | 756 void WebGL2RenderingContextBase::readPixels( |
| 756 GLint x, | 757 GLint x, |
| 757 GLint y, | 758 GLint y, |
| 758 GLsizei width, | 759 GLsizei width, |
| 759 GLsizei height, | 760 GLsizei height, |
| 760 GLenum format, | 761 GLenum format, |
| 761 GLenum type, | 762 GLenum type, |
| 762 NotShared<DOMArrayBufferView> pixels) { | 763 MaybeShared<DOMArrayBufferView> pixels) { |
| 763 if (isContextLost()) | 764 if (isContextLost()) |
| 764 return; | 765 return; |
| 765 if (bound_pixel_pack_buffer_.Get()) { | 766 if (bound_pixel_pack_buffer_.Get()) { |
| 766 SynthesizeGLError(GL_INVALID_OPERATION, "readPixels", | 767 SynthesizeGLError(GL_INVALID_OPERATION, "readPixels", |
| 767 "PIXEL_PACK buffer should not be bound"); | 768 "PIXEL_PACK buffer should not be bound"); |
| 768 return; | 769 return; |
| 769 } | 770 } |
| 770 | 771 |
| 771 ReadPixelsHelper(x, y, width, height, format, type, pixels.View(), 0); | 772 ReadPixelsHelper(x, y, width, height, format, type, pixels.View(), 0); |
| 772 } | 773 } |
| 773 | 774 |
| 774 void WebGL2RenderingContextBase::readPixels( | 775 void WebGL2RenderingContextBase::readPixels( |
| 775 GLint x, | 776 GLint x, |
| 776 GLint y, | 777 GLint y, |
| 777 GLsizei width, | 778 GLsizei width, |
| 778 GLsizei height, | 779 GLsizei height, |
| 779 GLenum format, | 780 GLenum format, |
| 780 GLenum type, | 781 GLenum type, |
| 781 NotShared<DOMArrayBufferView> pixels, | 782 MaybeShared<DOMArrayBufferView> pixels, |
| 782 GLuint offset) { | 783 GLuint offset) { |
| 783 if (isContextLost()) | 784 if (isContextLost()) |
| 784 return; | 785 return; |
| 785 if (bound_pixel_pack_buffer_.Get()) { | 786 if (bound_pixel_pack_buffer_.Get()) { |
| 786 SynthesizeGLError(GL_INVALID_OPERATION, "readPixels", | 787 SynthesizeGLError(GL_INVALID_OPERATION, "readPixels", |
| 787 "PIXEL_PACK buffer should not be bound"); | 788 "PIXEL_PACK buffer should not be bound"); |
| 788 return; | 789 return; |
| 789 } | 790 } |
| 790 | 791 |
| 791 ReadPixelsHelper(x, y, width, height, format, type, pixels.View(), offset); | 792 ReadPixelsHelper(x, y, width, height, format, type, pixels.View(), offset); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 | 1133 |
| 1133 void WebGL2RenderingContextBase::texImage2D( | 1134 void WebGL2RenderingContextBase::texImage2D( |
| 1134 GLenum target, | 1135 GLenum target, |
| 1135 GLint level, | 1136 GLint level, |
| 1136 GLint internalformat, | 1137 GLint internalformat, |
| 1137 GLsizei width, | 1138 GLsizei width, |
| 1138 GLsizei height, | 1139 GLsizei height, |
| 1139 GLint border, | 1140 GLint border, |
| 1140 GLenum format, | 1141 GLenum format, |
| 1141 GLenum type, | 1142 GLenum type, |
| 1142 NotShared<DOMArrayBufferView> data) { | 1143 MaybeShared<DOMArrayBufferView> data) { |
| 1143 if (isContextLost()) | 1144 if (isContextLost()) |
| 1144 return; | 1145 return; |
| 1145 if (bound_pixel_unpack_buffer_) { | 1146 if (bound_pixel_unpack_buffer_) { |
| 1146 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1147 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1147 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1148 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1148 return; | 1149 return; |
| 1149 } | 1150 } |
| 1150 WebGLRenderingContextBase::texImage2D(target, level, internalformat, width, | 1151 WebGLRenderingContextBase::texImage2D(target, level, internalformat, width, |
| 1151 height, border, format, type, data); | 1152 height, border, format, type, data); |
| 1152 } | 1153 } |
| 1153 | 1154 |
| 1154 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1155 void WebGL2RenderingContextBase::texImage2D( |
| 1155 GLint level, | 1156 GLenum target, |
| 1156 GLint internalformat, | 1157 GLint level, |
| 1157 GLsizei width, | 1158 GLint internalformat, |
| 1158 GLsizei height, | 1159 GLsizei width, |
| 1159 GLint border, | 1160 GLsizei height, |
| 1160 GLenum format, | 1161 GLint border, |
| 1161 GLenum type, | 1162 GLenum format, |
| 1162 NotShared<DOMArrayBufferView> data, | 1163 GLenum type, |
| 1163 GLuint src_offset) { | 1164 MaybeShared<DOMArrayBufferView> data, |
| 1165 GLuint src_offset) { |
| 1164 if (isContextLost()) | 1166 if (isContextLost()) |
| 1165 return; | 1167 return; |
| 1166 if (bound_pixel_unpack_buffer_) { | 1168 if (bound_pixel_unpack_buffer_) { |
| 1167 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1169 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1168 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1170 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1169 return; | 1171 return; |
| 1170 } | 1172 } |
| 1171 TexImageHelperDOMArrayBufferView( | 1173 TexImageHelperDOMArrayBufferView( |
| 1172 kTexImage2D, target, level, internalformat, width, height, 1, border, | 1174 kTexImage2D, target, level, internalformat, width, height, 1, border, |
| 1173 format, type, 0, 0, 0, data.View(), kNullNotReachable, src_offset); | 1175 format, type, 0, 0, 0, data.View(), kNullNotReachable, src_offset); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 | 1378 |
| 1377 void WebGL2RenderingContextBase::texSubImage2D( | 1379 void WebGL2RenderingContextBase::texSubImage2D( |
| 1378 GLenum target, | 1380 GLenum target, |
| 1379 GLint level, | 1381 GLint level, |
| 1380 GLint xoffset, | 1382 GLint xoffset, |
| 1381 GLint yoffset, | 1383 GLint yoffset, |
| 1382 GLsizei width, | 1384 GLsizei width, |
| 1383 GLsizei height, | 1385 GLsizei height, |
| 1384 GLenum format, | 1386 GLenum format, |
| 1385 GLenum type, | 1387 GLenum type, |
| 1386 NotShared<DOMArrayBufferView> pixels) { | 1388 MaybeShared<DOMArrayBufferView> pixels) { |
| 1387 if (isContextLost()) | 1389 if (isContextLost()) |
| 1388 return; | 1390 return; |
| 1389 if (bound_pixel_unpack_buffer_) { | 1391 if (bound_pixel_unpack_buffer_) { |
| 1390 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1392 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1391 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1393 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1392 return; | 1394 return; |
| 1393 } | 1395 } |
| 1394 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, | 1396 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, |
| 1395 width, height, format, type, pixels); | 1397 width, height, format, type, pixels); |
| 1396 } | 1398 } |
| 1397 | 1399 |
| 1398 void WebGL2RenderingContextBase::texSubImage2D( | 1400 void WebGL2RenderingContextBase::texSubImage2D( |
| 1399 GLenum target, | 1401 GLenum target, |
| 1400 GLint level, | 1402 GLint level, |
| 1401 GLint xoffset, | 1403 GLint xoffset, |
| 1402 GLint yoffset, | 1404 GLint yoffset, |
| 1403 GLsizei width, | 1405 GLsizei width, |
| 1404 GLsizei height, | 1406 GLsizei height, |
| 1405 GLenum format, | 1407 GLenum format, |
| 1406 GLenum type, | 1408 GLenum type, |
| 1407 NotShared<DOMArrayBufferView> pixels, | 1409 MaybeShared<DOMArrayBufferView> pixels, |
| 1408 GLuint src_offset) { | 1410 GLuint src_offset) { |
| 1409 if (isContextLost()) | 1411 if (isContextLost()) |
| 1410 return; | 1412 return; |
| 1411 if (bound_pixel_unpack_buffer_) { | 1413 if (bound_pixel_unpack_buffer_) { |
| 1412 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1414 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1413 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1415 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1414 return; | 1416 return; |
| 1415 } | 1417 } |
| 1416 TexImageHelperDOMArrayBufferView( | 1418 TexImageHelperDOMArrayBufferView( |
| 1417 kTexSubImage2D, target, level, 0, width, height, 1, 0, format, type, | 1419 kTexSubImage2D, target, level, 0, width, height, 1, 0, format, type, |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1659 void WebGL2RenderingContextBase::texImage3D( | 1661 void WebGL2RenderingContextBase::texImage3D( |
| 1660 GLenum target, | 1662 GLenum target, |
| 1661 GLint level, | 1663 GLint level, |
| 1662 GLint internalformat, | 1664 GLint internalformat, |
| 1663 GLsizei width, | 1665 GLsizei width, |
| 1664 GLsizei height, | 1666 GLsizei height, |
| 1665 GLsizei depth, | 1667 GLsizei depth, |
| 1666 GLint border, | 1668 GLint border, |
| 1667 GLenum format, | 1669 GLenum format, |
| 1668 GLenum type, | 1670 GLenum type, |
| 1669 NotShared<DOMArrayBufferView> pixels) { | 1671 MaybeShared<DOMArrayBufferView> pixels) { |
| 1670 TexImageHelperDOMArrayBufferView(kTexImage3D, target, level, internalformat, | 1672 TexImageHelperDOMArrayBufferView(kTexImage3D, target, level, internalformat, |
| 1671 width, height, depth, border, format, type, | 1673 width, height, depth, border, format, type, |
| 1672 0, 0, 0, pixels.View(), kNullAllowed, 0); | 1674 0, 0, 0, pixels.View(), kNullAllowed, 0); |
| 1673 } | 1675 } |
| 1674 | 1676 |
| 1675 void WebGL2RenderingContextBase::texImage3D( | 1677 void WebGL2RenderingContextBase::texImage3D( |
| 1676 GLenum target, | 1678 GLenum target, |
| 1677 GLint level, | 1679 GLint level, |
| 1678 GLint internalformat, | 1680 GLint internalformat, |
| 1679 GLsizei width, | 1681 GLsizei width, |
| 1680 GLsizei height, | 1682 GLsizei height, |
| 1681 GLsizei depth, | 1683 GLsizei depth, |
| 1682 GLint border, | 1684 GLint border, |
| 1683 GLenum format, | 1685 GLenum format, |
| 1684 GLenum type, | 1686 GLenum type, |
| 1685 NotShared<DOMArrayBufferView> pixels, | 1687 MaybeShared<DOMArrayBufferView> pixels, |
| 1686 GLuint src_offset) { | 1688 GLuint src_offset) { |
| 1687 if (isContextLost()) | 1689 if (isContextLost()) |
| 1688 return; | 1690 return; |
| 1689 if (bound_pixel_unpack_buffer_) { | 1691 if (bound_pixel_unpack_buffer_) { |
| 1690 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", | 1692 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", |
| 1691 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1693 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1692 return; | 1694 return; |
| 1693 } | 1695 } |
| 1694 TexImageHelperDOMArrayBufferView( | 1696 TexImageHelperDOMArrayBufferView( |
| 1695 kTexImage3D, target, level, internalformat, width, height, depth, border, | 1697 kTexImage3D, target, level, internalformat, width, height, depth, border, |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1848 GLenum target, | 1850 GLenum target, |
| 1849 GLint level, | 1851 GLint level, |
| 1850 GLint xoffset, | 1852 GLint xoffset, |
| 1851 GLint yoffset, | 1853 GLint yoffset, |
| 1852 GLint zoffset, | 1854 GLint zoffset, |
| 1853 GLsizei width, | 1855 GLsizei width, |
| 1854 GLsizei height, | 1856 GLsizei height, |
| 1855 GLsizei depth, | 1857 GLsizei depth, |
| 1856 GLenum format, | 1858 GLenum format, |
| 1857 GLenum type, | 1859 GLenum type, |
| 1858 NotShared<DOMArrayBufferView> pixels, | 1860 MaybeShared<DOMArrayBufferView> pixels, |
| 1859 GLuint src_offset) { | 1861 GLuint src_offset) { |
| 1860 if (isContextLost()) | 1862 if (isContextLost()) |
| 1861 return; | 1863 return; |
| 1862 if (bound_pixel_unpack_buffer_) { | 1864 if (bound_pixel_unpack_buffer_) { |
| 1863 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", | 1865 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", |
| 1864 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1866 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1865 return; | 1867 return; |
| 1866 } | 1868 } |
| 1867 TexImageHelperDOMArrayBufferView( | 1869 TexImageHelperDOMArrayBufferView( |
| 1868 kTexSubImage3D, target, level, 0, width, height, depth, 0, format, type, | 1870 kTexSubImage3D, target, level, 0, width, height, depth, 0, format, type, |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2054 width, height); | 2056 width, height); |
| 2055 } | 2057 } |
| 2056 | 2058 |
| 2057 void WebGL2RenderingContextBase::compressedTexImage2D( | 2059 void WebGL2RenderingContextBase::compressedTexImage2D( |
| 2058 GLenum target, | 2060 GLenum target, |
| 2059 GLint level, | 2061 GLint level, |
| 2060 GLenum internalformat, | 2062 GLenum internalformat, |
| 2061 GLsizei width, | 2063 GLsizei width, |
| 2062 GLsizei height, | 2064 GLsizei height, |
| 2063 GLint border, | 2065 GLint border, |
| 2064 NotShared<DOMArrayBufferView> data) { | 2066 MaybeShared<DOMArrayBufferView> data) { |
| 2065 if (isContextLost()) | 2067 if (isContextLost()) |
| 2066 return; | 2068 return; |
| 2067 if (bound_pixel_unpack_buffer_) { | 2069 if (bound_pixel_unpack_buffer_) { |
| 2068 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", | 2070 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", |
| 2069 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2071 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2070 return; | 2072 return; |
| 2071 } | 2073 } |
| 2072 WebGLRenderingContextBase::compressedTexImage2D(target, level, internalformat, | 2074 WebGLRenderingContextBase::compressedTexImage2D(target, level, internalformat, |
| 2073 width, height, border, data); | 2075 width, height, border, data); |
| 2074 } | 2076 } |
| 2075 | 2077 |
| 2076 void WebGL2RenderingContextBase::compressedTexImage2D( | 2078 void WebGL2RenderingContextBase::compressedTexImage2D( |
| 2077 GLenum target, | 2079 GLenum target, |
| 2078 GLint level, | 2080 GLint level, |
| 2079 GLenum internalformat, | 2081 GLenum internalformat, |
| 2080 GLsizei width, | 2082 GLsizei width, |
| 2081 GLsizei height, | 2083 GLsizei height, |
| 2082 GLint border, | 2084 GLint border, |
| 2083 NotShared<DOMArrayBufferView> data, | 2085 MaybeShared<DOMArrayBufferView> data, |
| 2084 GLuint src_offset, | 2086 GLuint src_offset, |
| 2085 GLuint src_length_override) { | 2087 GLuint src_length_override) { |
| 2086 if (isContextLost()) | 2088 if (isContextLost()) |
| 2087 return; | 2089 return; |
| 2088 if (bound_pixel_unpack_buffer_) { | 2090 if (bound_pixel_unpack_buffer_) { |
| 2089 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", | 2091 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", |
| 2090 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2092 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2091 return; | 2093 return; |
| 2092 } | 2094 } |
| 2093 if (!ValidateTexture2DBinding("compressedTexImage2D", target)) | 2095 if (!ValidateTexture2DBinding("compressedTexImage2D", target)) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2132 } | 2134 } |
| 2133 | 2135 |
| 2134 void WebGL2RenderingContextBase::compressedTexSubImage2D( | 2136 void WebGL2RenderingContextBase::compressedTexSubImage2D( |
| 2135 GLenum target, | 2137 GLenum target, |
| 2136 GLint level, | 2138 GLint level, |
| 2137 GLint xoffset, | 2139 GLint xoffset, |
| 2138 GLint yoffset, | 2140 GLint yoffset, |
| 2139 GLsizei width, | 2141 GLsizei width, |
| 2140 GLsizei height, | 2142 GLsizei height, |
| 2141 GLenum format, | 2143 GLenum format, |
| 2142 NotShared<DOMArrayBufferView> data) { | 2144 MaybeShared<DOMArrayBufferView> data) { |
| 2143 if (isContextLost()) | 2145 if (isContextLost()) |
| 2144 return; | 2146 return; |
| 2145 if (bound_pixel_unpack_buffer_) { | 2147 if (bound_pixel_unpack_buffer_) { |
| 2146 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", | 2148 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", |
| 2147 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2149 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2148 return; | 2150 return; |
| 2149 } | 2151 } |
| 2150 WebGLRenderingContextBase::compressedTexSubImage2D( | 2152 WebGLRenderingContextBase::compressedTexSubImage2D( |
| 2151 target, level, xoffset, yoffset, width, height, format, data); | 2153 target, level, xoffset, yoffset, width, height, format, data); |
| 2152 } | 2154 } |
| 2153 | 2155 |
| 2154 void WebGL2RenderingContextBase::compressedTexSubImage2D( | 2156 void WebGL2RenderingContextBase::compressedTexSubImage2D( |
| 2155 GLenum target, | 2157 GLenum target, |
| 2156 GLint level, | 2158 GLint level, |
| 2157 GLint xoffset, | 2159 GLint xoffset, |
| 2158 GLint yoffset, | 2160 GLint yoffset, |
| 2159 GLsizei width, | 2161 GLsizei width, |
| 2160 GLsizei height, | 2162 GLsizei height, |
| 2161 GLenum format, | 2163 GLenum format, |
| 2162 NotShared<DOMArrayBufferView> data, | 2164 MaybeShared<DOMArrayBufferView> data, |
| 2163 GLuint src_offset, | 2165 GLuint src_offset, |
| 2164 GLuint src_length_override) { | 2166 GLuint src_length_override) { |
| 2165 if (isContextLost()) | 2167 if (isContextLost()) |
| 2166 return; | 2168 return; |
| 2167 if (bound_pixel_unpack_buffer_) { | 2169 if (bound_pixel_unpack_buffer_) { |
| 2168 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", | 2170 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", |
| 2169 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2171 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2170 return; | 2172 return; |
| 2171 } | 2173 } |
| 2172 if (!ValidateTexture2DBinding("compressedTexSubImage2D", target)) | 2174 if (!ValidateTexture2DBinding("compressedTexSubImage2D", target)) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2213 } | 2215 } |
| 2214 | 2216 |
| 2215 void WebGL2RenderingContextBase::compressedTexImage3D( | 2217 void WebGL2RenderingContextBase::compressedTexImage3D( |
| 2216 GLenum target, | 2218 GLenum target, |
| 2217 GLint level, | 2219 GLint level, |
| 2218 GLenum internalformat, | 2220 GLenum internalformat, |
| 2219 GLsizei width, | 2221 GLsizei width, |
| 2220 GLsizei height, | 2222 GLsizei height, |
| 2221 GLsizei depth, | 2223 GLsizei depth, |
| 2222 GLint border, | 2224 GLint border, |
| 2223 NotShared<DOMArrayBufferView> data, | 2225 MaybeShared<DOMArrayBufferView> data, |
| 2224 GLuint src_offset, | 2226 GLuint src_offset, |
| 2225 GLuint src_length_override) { | 2227 GLuint src_length_override) { |
| 2226 if (isContextLost()) | 2228 if (isContextLost()) |
| 2227 return; | 2229 return; |
| 2228 if (bound_pixel_unpack_buffer_) { | 2230 if (bound_pixel_unpack_buffer_) { |
| 2229 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage3D", | 2231 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage3D", |
| 2230 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2232 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2231 return; | 2233 return; |
| 2232 } | 2234 } |
| 2233 if (!ValidateTexture3DBinding("compressedTexImage3D", target)) | 2235 if (!ValidateTexture3DBinding("compressedTexImage3D", target)) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2276 void WebGL2RenderingContextBase::compressedTexSubImage3D( | 2278 void WebGL2RenderingContextBase::compressedTexSubImage3D( |
| 2277 GLenum target, | 2279 GLenum target, |
| 2278 GLint level, | 2280 GLint level, |
| 2279 GLint xoffset, | 2281 GLint xoffset, |
| 2280 GLint yoffset, | 2282 GLint yoffset, |
| 2281 GLint zoffset, | 2283 GLint zoffset, |
| 2282 GLsizei width, | 2284 GLsizei width, |
| 2283 GLsizei height, | 2285 GLsizei height, |
| 2284 GLsizei depth, | 2286 GLsizei depth, |
| 2285 GLenum format, | 2287 GLenum format, |
| 2286 NotShared<DOMArrayBufferView> data, | 2288 MaybeShared<DOMArrayBufferView> data, |
| 2287 GLuint src_offset, | 2289 GLuint src_offset, |
| 2288 GLuint src_length_override) { | 2290 GLuint src_length_override) { |
| 2289 if (isContextLost()) | 2291 if (isContextLost()) |
| 2290 return; | 2292 return; |
| 2291 if (bound_pixel_unpack_buffer_) { | 2293 if (bound_pixel_unpack_buffer_) { |
| 2292 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage3D", | 2294 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage3D", |
| 2293 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2295 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2294 return; | 2296 return; |
| 2295 } | 2297 } |
| 2296 if (!ValidateTexture3DBinding("compressedTexSubImage3D", target)) | 2298 if (!ValidateTexture3DBinding("compressedTexSubImage3D", target)) |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2788 | 2790 |
| 2789 ContextGL()->Uniform4uiv( | 2791 ContextGL()->Uniform4uiv( |
| 2790 location->Location(), | 2792 location->Location(), |
| 2791 (src_length ? src_length : (value.size() - src_offset)) >> 2, | 2793 (src_length ? src_length : (value.size() - src_offset)) >> 2, |
| 2792 value.Data() + src_offset); | 2794 value.Data() + src_offset); |
| 2793 } | 2795 } |
| 2794 | 2796 |
| 2795 void WebGL2RenderingContextBase::uniformMatrix2fv( | 2797 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 2796 const WebGLUniformLocation* location, | 2798 const WebGLUniformLocation* location, |
| 2797 GLboolean transpose, | 2799 GLboolean transpose, |
| 2798 NotShared<DOMFloat32Array> v, | 2800 MaybeShared<DOMFloat32Array> v, |
| 2799 GLuint src_offset, | 2801 GLuint src_offset, |
| 2800 GLuint src_length) { | 2802 GLuint src_length) { |
| 2801 if (isContextLost() || | 2803 if (isContextLost() || |
| 2802 !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, | 2804 !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, |
| 2803 v.View(), 4, src_offset, src_length)) | 2805 v.View(), 4, src_offset, src_length)) |
| 2804 return; | 2806 return; |
| 2805 ContextGL()->UniformMatrix2fv( | 2807 ContextGL()->UniformMatrix2fv( |
| 2806 location->Location(), | 2808 location->Location(), |
| 2807 (src_length ? src_length : (v.View()->length() - src_offset)) >> 2, | 2809 (src_length ? src_length : (v.View()->length() - src_offset)) >> 2, |
| 2808 transpose, v.View()->Data() + src_offset); | 2810 transpose, v.View()->Data() + src_offset); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2820 return; | 2822 return; |
| 2821 ContextGL()->UniformMatrix2fv( | 2823 ContextGL()->UniformMatrix2fv( |
| 2822 location->Location(), | 2824 location->Location(), |
| 2823 (src_length ? src_length : (v.size() - src_offset)) >> 2, transpose, | 2825 (src_length ? src_length : (v.size() - src_offset)) >> 2, transpose, |
| 2824 v.Data() + src_offset); | 2826 v.Data() + src_offset); |
| 2825 } | 2827 } |
| 2826 | 2828 |
| 2827 void WebGL2RenderingContextBase::uniformMatrix3fv( | 2829 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 2828 const WebGLUniformLocation* location, | 2830 const WebGLUniformLocation* location, |
| 2829 GLboolean transpose, | 2831 GLboolean transpose, |
| 2830 NotShared<DOMFloat32Array> v, | 2832 MaybeShared<DOMFloat32Array> v, |
| 2831 GLuint src_offset, | 2833 GLuint src_offset, |
| 2832 GLuint src_length) { | 2834 GLuint src_length) { |
| 2833 if (isContextLost() || | 2835 if (isContextLost() || |
| 2834 !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, | 2836 !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, |
| 2835 v.View(), 9, src_offset, src_length)) | 2837 v.View(), 9, src_offset, src_length)) |
| 2836 return; | 2838 return; |
| 2837 ContextGL()->UniformMatrix3fv( | 2839 ContextGL()->UniformMatrix3fv( |
| 2838 location->Location(), | 2840 location->Location(), |
| 2839 (src_length ? src_length : (v.View()->length() - src_offset)) / 9, | 2841 (src_length ? src_length : (v.View()->length() - src_offset)) / 9, |
| 2840 transpose, v.View()->Data() + src_offset); | 2842 transpose, v.View()->Data() + src_offset); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2852 return; | 2854 return; |
| 2853 ContextGL()->UniformMatrix3fv( | 2855 ContextGL()->UniformMatrix3fv( |
| 2854 location->Location(), | 2856 location->Location(), |
| 2855 (src_length ? src_length : (v.size() - src_offset)) / 9, transpose, | 2857 (src_length ? src_length : (v.size() - src_offset)) / 9, transpose, |
| 2856 v.Data() + src_offset); | 2858 v.Data() + src_offset); |
| 2857 } | 2859 } |
| 2858 | 2860 |
| 2859 void WebGL2RenderingContextBase::uniformMatrix4fv( | 2861 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 2860 const WebGLUniformLocation* location, | 2862 const WebGLUniformLocation* location, |
| 2861 GLboolean transpose, | 2863 GLboolean transpose, |
| 2862 NotShared<DOMFloat32Array> v, | 2864 MaybeShared<DOMFloat32Array> v, |
| 2863 GLuint src_offset, | 2865 GLuint src_offset, |
| 2864 GLuint src_length) { | 2866 GLuint src_length) { |
| 2865 if (isContextLost() || | 2867 if (isContextLost() || |
| 2866 !ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose, | 2868 !ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose, |
| 2867 v.View(), 16, src_offset, src_length)) | 2869 v.View(), 16, src_offset, src_length)) |
| 2868 return; | 2870 return; |
| 2869 ContextGL()->UniformMatrix4fv( | 2871 ContextGL()->UniformMatrix4fv( |
| 2870 location->Location(), | 2872 location->Location(), |
| 2871 (src_length ? src_length : (v.View()->length() - src_offset)) >> 4, | 2873 (src_length ? src_length : (v.View()->length() - src_offset)) >> 4, |
| 2872 transpose, v.View()->Data() + src_offset); | 2874 transpose, v.View()->Data() + src_offset); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2884 return; | 2886 return; |
| 2885 ContextGL()->UniformMatrix4fv( | 2887 ContextGL()->UniformMatrix4fv( |
| 2886 location->Location(), | 2888 location->Location(), |
| 2887 (src_length ? src_length : (v.size() - src_offset)) >> 4, transpose, | 2889 (src_length ? src_length : (v.size() - src_offset)) >> 4, transpose, |
| 2888 v.Data() + src_offset); | 2890 v.Data() + src_offset); |
| 2889 } | 2891 } |
| 2890 | 2892 |
| 2891 void WebGL2RenderingContextBase::uniformMatrix2x3fv( | 2893 void WebGL2RenderingContextBase::uniformMatrix2x3fv( |
| 2892 const WebGLUniformLocation* location, | 2894 const WebGLUniformLocation* location, |
| 2893 GLboolean transpose, | 2895 GLboolean transpose, |
| 2894 NotShared<DOMFloat32Array> value, | 2896 MaybeShared<DOMFloat32Array> value, |
| 2895 GLuint src_offset, | 2897 GLuint src_offset, |
| 2896 GLuint src_length) { | 2898 GLuint src_length) { |
| 2897 if (isContextLost() || !ValidateUniformMatrixParameters( | 2899 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2898 "uniformMatrix2x3fv", location, transpose, | 2900 "uniformMatrix2x3fv", location, transpose, |
| 2899 value.View(), 6, src_offset, src_length)) | 2901 value.View(), 6, src_offset, src_length)) |
| 2900 return; | 2902 return; |
| 2901 ContextGL()->UniformMatrix2x3fv( | 2903 ContextGL()->UniformMatrix2x3fv( |
| 2902 location->Location(), | 2904 location->Location(), |
| 2903 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, | 2905 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, |
| 2904 transpose, value.View()->Data() + src_offset); | 2906 transpose, value.View()->Data() + src_offset); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2917 return; | 2919 return; |
| 2918 ContextGL()->UniformMatrix2x3fv( | 2920 ContextGL()->UniformMatrix2x3fv( |
| 2919 location->Location(), | 2921 location->Location(), |
| 2920 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, | 2922 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, |
| 2921 value.Data() + src_offset); | 2923 value.Data() + src_offset); |
| 2922 } | 2924 } |
| 2923 | 2925 |
| 2924 void WebGL2RenderingContextBase::uniformMatrix3x2fv( | 2926 void WebGL2RenderingContextBase::uniformMatrix3x2fv( |
| 2925 const WebGLUniformLocation* location, | 2927 const WebGLUniformLocation* location, |
| 2926 GLboolean transpose, | 2928 GLboolean transpose, |
| 2927 NotShared<DOMFloat32Array> value, | 2929 MaybeShared<DOMFloat32Array> value, |
| 2928 GLuint src_offset, | 2930 GLuint src_offset, |
| 2929 GLuint src_length) { | 2931 GLuint src_length) { |
| 2930 if (isContextLost() || !ValidateUniformMatrixParameters( | 2932 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2931 "uniformMatrix3x2fv", location, transpose, | 2933 "uniformMatrix3x2fv", location, transpose, |
| 2932 value.View(), 6, src_offset, src_length)) | 2934 value.View(), 6, src_offset, src_length)) |
| 2933 return; | 2935 return; |
| 2934 ContextGL()->UniformMatrix3x2fv( | 2936 ContextGL()->UniformMatrix3x2fv( |
| 2935 location->Location(), | 2937 location->Location(), |
| 2936 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, | 2938 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, |
| 2937 transpose, value.View()->Data() + src_offset); | 2939 transpose, value.View()->Data() + src_offset); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2950 return; | 2952 return; |
| 2951 ContextGL()->UniformMatrix3x2fv( | 2953 ContextGL()->UniformMatrix3x2fv( |
| 2952 location->Location(), | 2954 location->Location(), |
| 2953 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, | 2955 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, |
| 2954 value.Data() + src_offset); | 2956 value.Data() + src_offset); |
| 2955 } | 2957 } |
| 2956 | 2958 |
| 2957 void WebGL2RenderingContextBase::uniformMatrix2x4fv( | 2959 void WebGL2RenderingContextBase::uniformMatrix2x4fv( |
| 2958 const WebGLUniformLocation* location, | 2960 const WebGLUniformLocation* location, |
| 2959 GLboolean transpose, | 2961 GLboolean transpose, |
| 2960 NotShared<DOMFloat32Array> value, | 2962 MaybeShared<DOMFloat32Array> value, |
| 2961 GLuint src_offset, | 2963 GLuint src_offset, |
| 2962 GLuint src_length) { | 2964 GLuint src_length) { |
| 2963 if (isContextLost() || !ValidateUniformMatrixParameters( | 2965 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2964 "uniformMatrix2x4fv", location, transpose, | 2966 "uniformMatrix2x4fv", location, transpose, |
| 2965 value.View(), 8, src_offset, src_length)) | 2967 value.View(), 8, src_offset, src_length)) |
| 2966 return; | 2968 return; |
| 2967 ContextGL()->UniformMatrix2x4fv( | 2969 ContextGL()->UniformMatrix2x4fv( |
| 2968 location->Location(), | 2970 location->Location(), |
| 2969 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, | 2971 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, |
| 2970 transpose, value.View()->Data() + src_offset); | 2972 transpose, value.View()->Data() + src_offset); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2983 return; | 2985 return; |
| 2984 ContextGL()->UniformMatrix2x4fv( | 2986 ContextGL()->UniformMatrix2x4fv( |
| 2985 location->Location(), | 2987 location->Location(), |
| 2986 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, | 2988 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, |
| 2987 value.Data() + src_offset); | 2989 value.Data() + src_offset); |
| 2988 } | 2990 } |
| 2989 | 2991 |
| 2990 void WebGL2RenderingContextBase::uniformMatrix4x2fv( | 2992 void WebGL2RenderingContextBase::uniformMatrix4x2fv( |
| 2991 const WebGLUniformLocation* location, | 2993 const WebGLUniformLocation* location, |
| 2992 GLboolean transpose, | 2994 GLboolean transpose, |
| 2993 NotShared<DOMFloat32Array> value, | 2995 MaybeShared<DOMFloat32Array> value, |
| 2994 GLuint src_offset, | 2996 GLuint src_offset, |
| 2995 GLuint src_length) { | 2997 GLuint src_length) { |
| 2996 if (isContextLost() || !ValidateUniformMatrixParameters( | 2998 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2997 "uniformMatrix4x2fv", location, transpose, | 2999 "uniformMatrix4x2fv", location, transpose, |
| 2998 value.View(), 8, src_offset, src_length)) | 3000 value.View(), 8, src_offset, src_length)) |
| 2999 return; | 3001 return; |
| 3000 ContextGL()->UniformMatrix4x2fv( | 3002 ContextGL()->UniformMatrix4x2fv( |
| 3001 location->Location(), | 3003 location->Location(), |
| 3002 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, | 3004 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, |
| 3003 transpose, value.View()->Data() + src_offset); | 3005 transpose, value.View()->Data() + src_offset); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 3016 return; | 3018 return; |
| 3017 ContextGL()->UniformMatrix4x2fv( | 3019 ContextGL()->UniformMatrix4x2fv( |
| 3018 location->Location(), | 3020 location->Location(), |
| 3019 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, | 3021 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, |
| 3020 value.Data() + src_offset); | 3022 value.Data() + src_offset); |
| 3021 } | 3023 } |
| 3022 | 3024 |
| 3023 void WebGL2RenderingContextBase::uniformMatrix3x4fv( | 3025 void WebGL2RenderingContextBase::uniformMatrix3x4fv( |
| 3024 const WebGLUniformLocation* location, | 3026 const WebGLUniformLocation* location, |
| 3025 GLboolean transpose, | 3027 GLboolean transpose, |
| 3026 NotShared<DOMFloat32Array> value, | 3028 MaybeShared<DOMFloat32Array> value, |
| 3027 GLuint src_offset, | 3029 GLuint src_offset, |
| 3028 GLuint src_length) { | 3030 GLuint src_length) { |
| 3029 if (isContextLost() || !ValidateUniformMatrixParameters( | 3031 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 3030 "uniformMatrix3x4fv", location, transpose, | 3032 "uniformMatrix3x4fv", location, transpose, |
| 3031 value.View(), 12, src_offset, src_length)) | 3033 value.View(), 12, src_offset, src_length)) |
| 3032 return; | 3034 return; |
| 3033 ContextGL()->UniformMatrix3x4fv( | 3035 ContextGL()->UniformMatrix3x4fv( |
| 3034 location->Location(), | 3036 location->Location(), |
| 3035 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, | 3037 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, |
| 3036 transpose, value.View()->Data() + src_offset); | 3038 transpose, value.View()->Data() + src_offset); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 3049 return; | 3051 return; |
| 3050 ContextGL()->UniformMatrix3x4fv( | 3052 ContextGL()->UniformMatrix3x4fv( |
| 3051 location->Location(), | 3053 location->Location(), |
| 3052 (src_length ? src_length : (value.size() - src_offset)) / 12, transpose, | 3054 (src_length ? src_length : (value.size() - src_offset)) / 12, transpose, |
| 3053 value.Data() + src_offset); | 3055 value.Data() + src_offset); |
| 3054 } | 3056 } |
| 3055 | 3057 |
| 3056 void WebGL2RenderingContextBase::uniformMatrix4x3fv( | 3058 void WebGL2RenderingContextBase::uniformMatrix4x3fv( |
| 3057 const WebGLUniformLocation* location, | 3059 const WebGLUniformLocation* location, |
| 3058 GLboolean transpose, | 3060 GLboolean transpose, |
| 3059 NotShared<DOMFloat32Array> value, | 3061 MaybeShared<DOMFloat32Array> value, |
| 3060 GLuint src_offset, | 3062 GLuint src_offset, |
| 3061 GLuint src_length) { | 3063 GLuint src_length) { |
| 3062 if (isContextLost() || !ValidateUniformMatrixParameters( | 3064 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 3063 "uniformMatrix4x3fv", location, transpose, | 3065 "uniformMatrix4x3fv", location, transpose, |
| 3064 value.View(), 12, src_offset, src_length)) | 3066 value.View(), 12, src_offset, src_length)) |
| 3065 return; | 3067 return; |
| 3066 ContextGL()->UniformMatrix4x3fv( | 3068 ContextGL()->UniformMatrix4x3fv( |
| 3067 location->Location(), | 3069 location->Location(), |
| 3068 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, | 3070 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, |
| 3069 transpose, value.View()->Data() + src_offset); | 3071 transpose, value.View()->Data() + src_offset); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3178 | 3180 |
| 3179 void WebGL2RenderingContextBase::uniform4iv( | 3181 void WebGL2RenderingContextBase::uniform4iv( |
| 3180 const WebGLUniformLocation* location, | 3182 const WebGLUniformLocation* location, |
| 3181 Vector<GLint>& v) { | 3183 Vector<GLint>& v) { |
| 3182 WebGLRenderingContextBase::uniform4iv(location, v); | 3184 WebGLRenderingContextBase::uniform4iv(location, v); |
| 3183 } | 3185 } |
| 3184 | 3186 |
| 3185 void WebGL2RenderingContextBase::uniformMatrix2fv( | 3187 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 3186 const WebGLUniformLocation* location, | 3188 const WebGLUniformLocation* location, |
| 3187 GLboolean transpose, | 3189 GLboolean transpose, |
| 3188 NotShared<DOMFloat32Array> v) { | 3190 MaybeShared<DOMFloat32Array> v) { |
| 3189 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); | 3191 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); |
| 3190 } | 3192 } |
| 3191 | 3193 |
| 3192 void WebGL2RenderingContextBase::uniformMatrix2fv( | 3194 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 3193 const WebGLUniformLocation* location, | 3195 const WebGLUniformLocation* location, |
| 3194 GLboolean transpose, | 3196 GLboolean transpose, |
| 3195 Vector<GLfloat>& v) { | 3197 Vector<GLfloat>& v) { |
| 3196 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); | 3198 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); |
| 3197 } | 3199 } |
| 3198 | 3200 |
| 3199 void WebGL2RenderingContextBase::uniformMatrix3fv( | 3201 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 3200 const WebGLUniformLocation* location, | 3202 const WebGLUniformLocation* location, |
| 3201 GLboolean transpose, | 3203 GLboolean transpose, |
| 3202 NotShared<DOMFloat32Array> v) { | 3204 MaybeShared<DOMFloat32Array> v) { |
| 3203 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); | 3205 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); |
| 3204 } | 3206 } |
| 3205 | 3207 |
| 3206 void WebGL2RenderingContextBase::uniformMatrix3fv( | 3208 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 3207 const WebGLUniformLocation* location, | 3209 const WebGLUniformLocation* location, |
| 3208 GLboolean transpose, | 3210 GLboolean transpose, |
| 3209 Vector<GLfloat>& v) { | 3211 Vector<GLfloat>& v) { |
| 3210 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); | 3212 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); |
| 3211 } | 3213 } |
| 3212 | 3214 |
| 3213 void WebGL2RenderingContextBase::uniformMatrix4fv( | 3215 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 3214 const WebGLUniformLocation* location, | 3216 const WebGLUniformLocation* location, |
| 3215 GLboolean transpose, | 3217 GLboolean transpose, |
| 3216 NotShared<DOMFloat32Array> v) { | 3218 MaybeShared<DOMFloat32Array> v) { |
| 3217 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); | 3219 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); |
| 3218 } | 3220 } |
| 3219 | 3221 |
| 3220 void WebGL2RenderingContextBase::uniformMatrix4fv( | 3222 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 3221 const WebGLUniformLocation* location, | 3223 const WebGLUniformLocation* location, |
| 3222 GLboolean transpose, | 3224 GLboolean transpose, |
| 3223 Vector<GLfloat>& v) { | 3225 Vector<GLfloat>& v) { |
| 3224 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); | 3226 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); |
| 3225 } | 3227 } |
| 3226 | 3228 |
| 3227 void WebGL2RenderingContextBase::vertexAttribI4i(GLuint index, | 3229 void WebGL2RenderingContextBase::vertexAttribI4i(GLuint index, |
| 3228 GLint x, | 3230 GLint x, |
| 3229 GLint y, | 3231 GLint y, |
| 3230 GLint z, | 3232 GLint z, |
| 3231 GLint w) { | 3233 GLint w) { |
| 3232 if (isContextLost()) | 3234 if (isContextLost()) |
| 3233 return; | 3235 return; |
| 3234 ContextGL()->VertexAttribI4i(index, x, y, z, w); | 3236 ContextGL()->VertexAttribI4i(index, x, y, z, w); |
| 3235 SetVertexAttribType(index, kInt32ArrayType); | 3237 SetVertexAttribType(index, kInt32ArrayType); |
| 3236 } | 3238 } |
| 3237 | 3239 |
| 3238 void WebGL2RenderingContextBase::vertexAttribI4iv( | 3240 void WebGL2RenderingContextBase::vertexAttribI4iv( |
| 3239 GLuint index, | 3241 GLuint index, |
| 3240 NotShared<const DOMInt32Array> v) { | 3242 MaybeShared<const DOMInt32Array> v) { |
| 3241 if (isContextLost()) | 3243 if (isContextLost()) |
| 3242 return; | 3244 return; |
| 3243 if (!v.View() || v.View()->length() < 4) { | 3245 if (!v.View() || v.View()->length() < 4) { |
| 3244 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); | 3246 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); |
| 3245 return; | 3247 return; |
| 3246 } | 3248 } |
| 3247 ContextGL()->VertexAttribI4iv(index, v.View()->Data()); | 3249 ContextGL()->VertexAttribI4iv(index, v.View()->Data()); |
| 3248 SetVertexAttribType(index, kInt32ArrayType); | 3250 SetVertexAttribType(index, kInt32ArrayType); |
| 3249 } | 3251 } |
| 3250 | 3252 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 3266 GLuint z, | 3268 GLuint z, |
| 3267 GLuint w) { | 3269 GLuint w) { |
| 3268 if (isContextLost()) | 3270 if (isContextLost()) |
| 3269 return; | 3271 return; |
| 3270 ContextGL()->VertexAttribI4ui(index, x, y, z, w); | 3272 ContextGL()->VertexAttribI4ui(index, x, y, z, w); |
| 3271 SetVertexAttribType(index, kUint32ArrayType); | 3273 SetVertexAttribType(index, kUint32ArrayType); |
| 3272 } | 3274 } |
| 3273 | 3275 |
| 3274 void WebGL2RenderingContextBase::vertexAttribI4uiv( | 3276 void WebGL2RenderingContextBase::vertexAttribI4uiv( |
| 3275 GLuint index, | 3277 GLuint index, |
| 3276 NotShared<const DOMUint32Array> v) { | 3278 MaybeShared<const DOMUint32Array> v) { |
| 3277 if (isContextLost()) | 3279 if (isContextLost()) |
| 3278 return; | 3280 return; |
| 3279 if (!v.View() || v.View()->length() < 4) { | 3281 if (!v.View() || v.View()->length() < 4) { |
| 3280 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); | 3282 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); |
| 3281 return; | 3283 return; |
| 3282 } | 3284 } |
| 3283 ContextGL()->VertexAttribI4uiv(index, v.View()->Data()); | 3285 ContextGL()->VertexAttribI4uiv(index, v.View()->Data()); |
| 3284 SetVertexAttribType(index, kUint32ArrayType); | 3286 SetVertexAttribType(index, kUint32ArrayType); |
| 3285 } | 3287 } |
| 3286 | 3288 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3489 | 3491 |
| 3490 WebGLTexture* WebGL2RenderingContextBase::ValidateTexImageBinding( | 3492 WebGLTexture* WebGL2RenderingContextBase::ValidateTexImageBinding( |
| 3491 const char* func_name, | 3493 const char* func_name, |
| 3492 TexImageFunctionID function_id, | 3494 TexImageFunctionID function_id, |
| 3493 GLenum target) { | 3495 GLenum target) { |
| 3494 if (function_id == kTexImage3D || function_id == kTexSubImage3D) | 3496 if (function_id == kTexImage3D || function_id == kTexSubImage3D) |
| 3495 return ValidateTexture3DBinding(func_name, target); | 3497 return ValidateTexture3DBinding(func_name, target); |
| 3496 return ValidateTexture2DBinding(func_name, target); | 3498 return ValidateTexture2DBinding(func_name, target); |
| 3497 } | 3499 } |
| 3498 | 3500 |
| 3499 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, | 3501 void WebGL2RenderingContextBase::clearBufferiv( |
| 3500 GLint drawbuffer, | 3502 GLenum buffer, |
| 3501 NotShared<DOMInt32Array> value) { | 3503 GLint drawbuffer, |
| 3504 MaybeShared<DOMInt32Array> value) { |
| 3502 if (isContextLost() || | 3505 if (isContextLost() || |
| 3503 !ValidateClearBuffer("clearBufferiv", buffer, value.View()->length())) | 3506 !ValidateClearBuffer("clearBufferiv", buffer, value.View()->length())) |
| 3504 return; | 3507 return; |
| 3505 | 3508 |
| 3506 ContextGL()->ClearBufferiv(buffer, drawbuffer, value.View()->Data()); | 3509 ContextGL()->ClearBufferiv(buffer, drawbuffer, value.View()->Data()); |
| 3507 } | 3510 } |
| 3508 | 3511 |
| 3509 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, | 3512 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, |
| 3510 GLint drawbuffer, | 3513 GLint drawbuffer, |
| 3511 const Vector<GLint>& value) { | 3514 const Vector<GLint>& value) { |
| 3512 if (isContextLost() || | 3515 if (isContextLost() || |
| 3513 !ValidateClearBuffer("clearBufferiv", buffer, value.size())) | 3516 !ValidateClearBuffer("clearBufferiv", buffer, value.size())) |
| 3514 return; | 3517 return; |
| 3515 | 3518 |
| 3516 ContextGL()->ClearBufferiv(buffer, drawbuffer, value.Data()); | 3519 ContextGL()->ClearBufferiv(buffer, drawbuffer, value.Data()); |
| 3517 } | 3520 } |
| 3518 | 3521 |
| 3519 void WebGL2RenderingContextBase::clearBufferuiv( | 3522 void WebGL2RenderingContextBase::clearBufferuiv( |
| 3520 GLenum buffer, | 3523 GLenum buffer, |
| 3521 GLint drawbuffer, | 3524 GLint drawbuffer, |
| 3522 NotShared<DOMUint32Array> value) { | 3525 MaybeShared<DOMUint32Array> value) { |
| 3523 if (isContextLost() || | 3526 if (isContextLost() || |
| 3524 !ValidateClearBuffer("clearBufferuiv", buffer, value.View()->length())) | 3527 !ValidateClearBuffer("clearBufferuiv", buffer, value.View()->length())) |
| 3525 return; | 3528 return; |
| 3526 | 3529 |
| 3527 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.View()->Data()); | 3530 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.View()->Data()); |
| 3528 } | 3531 } |
| 3529 | 3532 |
| 3530 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, | 3533 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, |
| 3531 GLint drawbuffer, | 3534 GLint drawbuffer, |
| 3532 const Vector<GLuint>& value) { | 3535 const Vector<GLuint>& value) { |
| 3533 if (isContextLost() || | 3536 if (isContextLost() || |
| 3534 !ValidateClearBuffer("clearBufferuiv", buffer, value.size())) | 3537 !ValidateClearBuffer("clearBufferuiv", buffer, value.size())) |
| 3535 return; | 3538 return; |
| 3536 | 3539 |
| 3537 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.Data()); | 3540 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.Data()); |
| 3538 } | 3541 } |
| 3539 | 3542 |
| 3540 void WebGL2RenderingContextBase::clearBufferfv( | 3543 void WebGL2RenderingContextBase::clearBufferfv( |
| 3541 GLenum buffer, | 3544 GLenum buffer, |
| 3542 GLint drawbuffer, | 3545 GLint drawbuffer, |
| 3543 NotShared<DOMFloat32Array> value) { | 3546 MaybeShared<DOMFloat32Array> value) { |
| 3544 if (isContextLost() || | 3547 if (isContextLost() || |
| 3545 !ValidateClearBuffer("clearBufferfv", buffer, value.View()->length())) | 3548 !ValidateClearBuffer("clearBufferfv", buffer, value.View()->length())) |
| 3546 return; | 3549 return; |
| 3547 | 3550 |
| 3548 ContextGL()->ClearBufferfv(buffer, drawbuffer, value.View()->Data()); | 3551 ContextGL()->ClearBufferfv(buffer, drawbuffer, value.View()->Data()); |
| 3549 } | 3552 } |
| 3550 | 3553 |
| 3551 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, | 3554 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, |
| 3552 GLint drawbuffer, | 3555 GLint drawbuffer, |
| 3553 const Vector<GLfloat>& value) { | 3556 const Vector<GLfloat>& value) { |
| (...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5690 | 5693 |
| 5691 void WebGL2RenderingContextBase:: | 5694 void WebGL2RenderingContextBase:: |
| 5692 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 5695 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
| 5693 if (!ContextGL()) | 5696 if (!ContextGL()) |
| 5694 return; | 5697 return; |
| 5695 ContextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 5698 ContextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
| 5696 ObjectOrZero(bound_pixel_unpack_buffer_.Get())); | 5699 ObjectOrZero(bound_pixel_unpack_buffer_.Get())); |
| 5697 } | 5700 } |
| 5698 | 5701 |
| 5699 } // namespace blink | 5702 } // namespace blink |
| OLD | NEW |