| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 byte_offset = sub_offset * type_size; | 66 byte_offset = sub_offset * type_size; |
| 67 } | 67 } |
| 68 CheckedNumeric<long long> total = byte_offset; | 68 CheckedNumeric<long long> total = byte_offset; |
| 69 total += byte_length; | 69 total += byte_length; |
| 70 if (!total.IsValid() || total.ValueOrDie() > view->byteLength()) { | 70 if (!total.IsValid() || total.ValueOrDie() > view->byteLength()) { |
| 71 return false; | 71 return false; |
| 72 } | 72 } |
| 73 if (!byte_length) { | 73 if (!byte_length) { |
| 74 byte_length = view->byteLength() - byte_offset; | 74 byte_length = view->byteLength() - byte_offset; |
| 75 } | 75 } |
| 76 uint8_t* data = static_cast<uint8_t*>(view->BaseAddress()); | 76 uint8_t* data = static_cast<uint8_t*>(view->BaseAddressMaybeShared()); |
| 77 data += byte_offset; | 77 data += byte_offset; |
| 78 *out_base_address = data; | 78 *out_base_address = data; |
| 79 *out_byte_length = byte_length; | 79 *out_byte_length = byte_length; |
| 80 return true; | 80 return true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace | 83 } // namespace |
| 84 | 84 |
| 85 // These enums are from manual pages for glTexStorage2D/glTexStorage3D. | 85 // These enums are from manual pages for glTexStorage2D/glTexStorage3D. |
| 86 const GLenum kSupportedInternalFormatsStorage[] = { | 86 const GLenum kSupportedInternalFormatsStorage[] = { |
| (...skipping 156 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1393 | 1395 |
| 1394 void WebGL2RenderingContextBase::texSubImage2D( | 1396 void WebGL2RenderingContextBase::texSubImage2D( |
| 1395 GLenum target, | 1397 GLenum target, |
| 1396 GLint level, | 1398 GLint level, |
| 1397 GLint xoffset, | 1399 GLint xoffset, |
| 1398 GLint yoffset, | 1400 GLint yoffset, |
| 1399 GLsizei width, | 1401 GLsizei width, |
| 1400 GLsizei height, | 1402 GLsizei height, |
| 1401 GLenum format, | 1403 GLenum format, |
| 1402 GLenum type, | 1404 GLenum type, |
| 1403 NotShared<DOMArrayBufferView> pixels) { | 1405 MaybeShared<DOMArrayBufferView> pixels) { |
| 1404 if (isContextLost()) | 1406 if (isContextLost()) |
| 1405 return; | 1407 return; |
| 1406 if (bound_pixel_unpack_buffer_) { | 1408 if (bound_pixel_unpack_buffer_) { |
| 1407 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1409 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1408 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1410 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1409 return; | 1411 return; |
| 1410 } | 1412 } |
| 1411 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, | 1413 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, |
| 1412 width, height, format, type, pixels); | 1414 width, height, format, type, pixels); |
| 1413 } | 1415 } |
| 1414 | 1416 |
| 1415 void WebGL2RenderingContextBase::texSubImage2D( | 1417 void WebGL2RenderingContextBase::texSubImage2D( |
| 1416 GLenum target, | 1418 GLenum target, |
| 1417 GLint level, | 1419 GLint level, |
| 1418 GLint xoffset, | 1420 GLint xoffset, |
| 1419 GLint yoffset, | 1421 GLint yoffset, |
| 1420 GLsizei width, | 1422 GLsizei width, |
| 1421 GLsizei height, | 1423 GLsizei height, |
| 1422 GLenum format, | 1424 GLenum format, |
| 1423 GLenum type, | 1425 GLenum type, |
| 1424 NotShared<DOMArrayBufferView> pixels, | 1426 MaybeShared<DOMArrayBufferView> pixels, |
| 1425 GLuint src_offset) { | 1427 GLuint src_offset) { |
| 1426 if (isContextLost()) | 1428 if (isContextLost()) |
| 1427 return; | 1429 return; |
| 1428 if (bound_pixel_unpack_buffer_) { | 1430 if (bound_pixel_unpack_buffer_) { |
| 1429 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1431 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1430 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1432 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1431 return; | 1433 return; |
| 1432 } | 1434 } |
| 1433 TexImageHelperDOMArrayBufferView( | 1435 TexImageHelperDOMArrayBufferView( |
| 1434 kTexSubImage2D, target, level, 0, width, height, 1, 0, format, type, | 1436 kTexSubImage2D, target, level, 0, width, height, 1, 0, format, type, |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1690 void WebGL2RenderingContextBase::texImage3D( | 1692 void WebGL2RenderingContextBase::texImage3D( |
| 1691 GLenum target, | 1693 GLenum target, |
| 1692 GLint level, | 1694 GLint level, |
| 1693 GLint internalformat, | 1695 GLint internalformat, |
| 1694 GLsizei width, | 1696 GLsizei width, |
| 1695 GLsizei height, | 1697 GLsizei height, |
| 1696 GLsizei depth, | 1698 GLsizei depth, |
| 1697 GLint border, | 1699 GLint border, |
| 1698 GLenum format, | 1700 GLenum format, |
| 1699 GLenum type, | 1701 GLenum type, |
| 1700 NotShared<DOMArrayBufferView> pixels) { | 1702 MaybeShared<DOMArrayBufferView> pixels) { |
| 1701 TexImageHelperDOMArrayBufferView(kTexImage3D, target, level, internalformat, | 1703 TexImageHelperDOMArrayBufferView(kTexImage3D, target, level, internalformat, |
| 1702 width, height, depth, border, format, type, | 1704 width, height, depth, border, format, type, |
| 1703 0, 0, 0, pixels.View(), kNullAllowed, 0); | 1705 0, 0, 0, pixels.View(), kNullAllowed, 0); |
| 1704 } | 1706 } |
| 1705 | 1707 |
| 1706 void WebGL2RenderingContextBase::texImage3D( | 1708 void WebGL2RenderingContextBase::texImage3D( |
| 1707 GLenum target, | 1709 GLenum target, |
| 1708 GLint level, | 1710 GLint level, |
| 1709 GLint internalformat, | 1711 GLint internalformat, |
| 1710 GLsizei width, | 1712 GLsizei width, |
| 1711 GLsizei height, | 1713 GLsizei height, |
| 1712 GLsizei depth, | 1714 GLsizei depth, |
| 1713 GLint border, | 1715 GLint border, |
| 1714 GLenum format, | 1716 GLenum format, |
| 1715 GLenum type, | 1717 GLenum type, |
| 1716 NotShared<DOMArrayBufferView> pixels, | 1718 MaybeShared<DOMArrayBufferView> pixels, |
| 1717 GLuint src_offset) { | 1719 GLuint src_offset) { |
| 1718 if (isContextLost()) | 1720 if (isContextLost()) |
| 1719 return; | 1721 return; |
| 1720 if (bound_pixel_unpack_buffer_) { | 1722 if (bound_pixel_unpack_buffer_) { |
| 1721 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", | 1723 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", |
| 1722 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1724 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1723 return; | 1725 return; |
| 1724 } | 1726 } |
| 1725 TexImageHelperDOMArrayBufferView( | 1727 TexImageHelperDOMArrayBufferView( |
| 1726 kTexImage3D, target, level, internalformat, width, height, depth, border, | 1728 kTexImage3D, target, level, internalformat, width, height, depth, border, |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1888 GLenum target, | 1890 GLenum target, |
| 1889 GLint level, | 1891 GLint level, |
| 1890 GLint xoffset, | 1892 GLint xoffset, |
| 1891 GLint yoffset, | 1893 GLint yoffset, |
| 1892 GLint zoffset, | 1894 GLint zoffset, |
| 1893 GLsizei width, | 1895 GLsizei width, |
| 1894 GLsizei height, | 1896 GLsizei height, |
| 1895 GLsizei depth, | 1897 GLsizei depth, |
| 1896 GLenum format, | 1898 GLenum format, |
| 1897 GLenum type, | 1899 GLenum type, |
| 1898 NotShared<DOMArrayBufferView> pixels, | 1900 MaybeShared<DOMArrayBufferView> pixels, |
| 1899 GLuint src_offset) { | 1901 GLuint src_offset) { |
| 1900 if (isContextLost()) | 1902 if (isContextLost()) |
| 1901 return; | 1903 return; |
| 1902 if (bound_pixel_unpack_buffer_) { | 1904 if (bound_pixel_unpack_buffer_) { |
| 1903 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", | 1905 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", |
| 1904 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1906 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1905 return; | 1907 return; |
| 1906 } | 1908 } |
| 1907 TexImageHelperDOMArrayBufferView( | 1909 TexImageHelperDOMArrayBufferView( |
| 1908 kTexSubImage3D, target, level, 0, width, height, depth, 0, format, type, | 1910 kTexSubImage3D, target, level, 0, width, height, depth, 0, format, type, |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2103 width, height); | 2105 width, height); |
| 2104 } | 2106 } |
| 2105 | 2107 |
| 2106 void WebGL2RenderingContextBase::compressedTexImage2D( | 2108 void WebGL2RenderingContextBase::compressedTexImage2D( |
| 2107 GLenum target, | 2109 GLenum target, |
| 2108 GLint level, | 2110 GLint level, |
| 2109 GLenum internalformat, | 2111 GLenum internalformat, |
| 2110 GLsizei width, | 2112 GLsizei width, |
| 2111 GLsizei height, | 2113 GLsizei height, |
| 2112 GLint border, | 2114 GLint border, |
| 2113 NotShared<DOMArrayBufferView> data) { | 2115 MaybeShared<DOMArrayBufferView> data) { |
| 2114 if (isContextLost()) | 2116 if (isContextLost()) |
| 2115 return; | 2117 return; |
| 2116 if (bound_pixel_unpack_buffer_) { | 2118 if (bound_pixel_unpack_buffer_) { |
| 2117 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", | 2119 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", |
| 2118 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2120 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2119 return; | 2121 return; |
| 2120 } | 2122 } |
| 2121 WebGLRenderingContextBase::compressedTexImage2D(target, level, internalformat, | 2123 WebGLRenderingContextBase::compressedTexImage2D(target, level, internalformat, |
| 2122 width, height, border, data); | 2124 width, height, border, data); |
| 2123 } | 2125 } |
| 2124 | 2126 |
| 2125 void WebGL2RenderingContextBase::compressedTexImage2D( | 2127 void WebGL2RenderingContextBase::compressedTexImage2D( |
| 2126 GLenum target, | 2128 GLenum target, |
| 2127 GLint level, | 2129 GLint level, |
| 2128 GLenum internalformat, | 2130 GLenum internalformat, |
| 2129 GLsizei width, | 2131 GLsizei width, |
| 2130 GLsizei height, | 2132 GLsizei height, |
| 2131 GLint border, | 2133 GLint border, |
| 2132 NotShared<DOMArrayBufferView> data, | 2134 MaybeShared<DOMArrayBufferView> data, |
| 2133 GLuint src_offset, | 2135 GLuint src_offset, |
| 2134 GLuint src_length_override) { | 2136 GLuint src_length_override) { |
| 2135 if (isContextLost()) | 2137 if (isContextLost()) |
| 2136 return; | 2138 return; |
| 2137 if (bound_pixel_unpack_buffer_) { | 2139 if (bound_pixel_unpack_buffer_) { |
| 2138 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", | 2140 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", |
| 2139 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2141 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2140 return; | 2142 return; |
| 2141 } | 2143 } |
| 2142 if (!ValidateTexture2DBinding("compressedTexImage2D", target)) | 2144 if (!ValidateTexture2DBinding("compressedTexImage2D", target)) |
| 2143 return; | 2145 return; |
| 2144 if (!ValidateCompressedTexFormat("compressedTexImage2D", internalformat)) | 2146 if (!ValidateCompressedTexFormat("compressedTexImage2D", internalformat)) |
| 2145 return; | 2147 return; |
| 2146 if (src_offset > data.View()->byteLength()) { | 2148 if (src_offset > data.View()->byteLength()) { |
| 2147 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", | 2149 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", |
| 2148 "srcOffset is out of range"); | 2150 "srcOffset is out of range"); |
| 2149 return; | 2151 return; |
| 2150 } | 2152 } |
| 2151 if (src_length_override == 0) { | 2153 if (src_length_override == 0) { |
| 2152 src_length_override = data.View()->byteLength() - src_offset; | 2154 src_length_override = data.View()->byteLength() - src_offset; |
| 2153 } else if (src_length_override > data.View()->byteLength() - src_offset) { | 2155 } else if (src_length_override > data.View()->byteLength() - src_offset) { |
| 2154 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", | 2156 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", |
| 2155 "srcLengthOverride is out of range"); | 2157 "srcLengthOverride is out of range"); |
| 2156 return; | 2158 return; |
| 2157 } | 2159 } |
| 2158 ContextGL()->CompressedTexImage2D( | 2160 ContextGL()->CompressedTexImage2D( |
| 2159 target, level, internalformat, width, height, border, src_length_override, | 2161 target, level, internalformat, width, height, border, src_length_override, |
| 2160 static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); | 2162 static_cast<uint8_t*>(data.View()->BaseAddressMaybeShared()) + |
| 2163 src_offset); |
| 2161 } | 2164 } |
| 2162 | 2165 |
| 2163 void WebGL2RenderingContextBase::compressedTexImage2D(GLenum target, | 2166 void WebGL2RenderingContextBase::compressedTexImage2D(GLenum target, |
| 2164 GLint level, | 2167 GLint level, |
| 2165 GLenum internalformat, | 2168 GLenum internalformat, |
| 2166 GLsizei width, | 2169 GLsizei width, |
| 2167 GLsizei height, | 2170 GLsizei height, |
| 2168 GLint border, | 2171 GLint border, |
| 2169 GLsizei image_size, | 2172 GLsizei image_size, |
| 2170 GLintptr offset) { | 2173 GLintptr offset) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2181 } | 2184 } |
| 2182 | 2185 |
| 2183 void WebGL2RenderingContextBase::compressedTexSubImage2D( | 2186 void WebGL2RenderingContextBase::compressedTexSubImage2D( |
| 2184 GLenum target, | 2187 GLenum target, |
| 2185 GLint level, | 2188 GLint level, |
| 2186 GLint xoffset, | 2189 GLint xoffset, |
| 2187 GLint yoffset, | 2190 GLint yoffset, |
| 2188 GLsizei width, | 2191 GLsizei width, |
| 2189 GLsizei height, | 2192 GLsizei height, |
| 2190 GLenum format, | 2193 GLenum format, |
| 2191 NotShared<DOMArrayBufferView> data) { | 2194 MaybeShared<DOMArrayBufferView> data) { |
| 2192 if (isContextLost()) | 2195 if (isContextLost()) |
| 2193 return; | 2196 return; |
| 2194 if (bound_pixel_unpack_buffer_) { | 2197 if (bound_pixel_unpack_buffer_) { |
| 2195 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", | 2198 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", |
| 2196 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2199 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2197 return; | 2200 return; |
| 2198 } | 2201 } |
| 2199 WebGLRenderingContextBase::compressedTexSubImage2D( | 2202 WebGLRenderingContextBase::compressedTexSubImage2D( |
| 2200 target, level, xoffset, yoffset, width, height, format, data); | 2203 target, level, xoffset, yoffset, width, height, format, data); |
| 2201 } | 2204 } |
| 2202 | 2205 |
| 2203 void WebGL2RenderingContextBase::compressedTexSubImage2D( | 2206 void WebGL2RenderingContextBase::compressedTexSubImage2D( |
| 2204 GLenum target, | 2207 GLenum target, |
| 2205 GLint level, | 2208 GLint level, |
| 2206 GLint xoffset, | 2209 GLint xoffset, |
| 2207 GLint yoffset, | 2210 GLint yoffset, |
| 2208 GLsizei width, | 2211 GLsizei width, |
| 2209 GLsizei height, | 2212 GLsizei height, |
| 2210 GLenum format, | 2213 GLenum format, |
| 2211 NotShared<DOMArrayBufferView> data, | 2214 MaybeShared<DOMArrayBufferView> data, |
| 2212 GLuint src_offset, | 2215 GLuint src_offset, |
| 2213 GLuint src_length_override) { | 2216 GLuint src_length_override) { |
| 2214 if (isContextLost()) | 2217 if (isContextLost()) |
| 2215 return; | 2218 return; |
| 2216 if (bound_pixel_unpack_buffer_) { | 2219 if (bound_pixel_unpack_buffer_) { |
| 2217 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", | 2220 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", |
| 2218 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2221 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2219 return; | 2222 return; |
| 2220 } | 2223 } |
| 2221 if (!ValidateTexture2DBinding("compressedTexSubImage2D", target)) | 2224 if (!ValidateTexture2DBinding("compressedTexSubImage2D", target)) |
| 2222 return; | 2225 return; |
| 2223 if (!ValidateCompressedTexFormat("compressedTexSubImage2D", format)) | 2226 if (!ValidateCompressedTexFormat("compressedTexSubImage2D", format)) |
| 2224 return; | 2227 return; |
| 2225 if (src_offset > data.View()->byteLength()) { | 2228 if (src_offset > data.View()->byteLength()) { |
| 2226 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D", | 2229 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D", |
| 2227 "srcOffset is out of range"); | 2230 "srcOffset is out of range"); |
| 2228 return; | 2231 return; |
| 2229 } | 2232 } |
| 2230 if (src_length_override == 0) { | 2233 if (src_length_override == 0) { |
| 2231 src_length_override = data.View()->byteLength() - src_offset; | 2234 src_length_override = data.View()->byteLength() - src_offset; |
| 2232 } else if (src_length_override > data.View()->byteLength() - src_offset) { | 2235 } else if (src_length_override > data.View()->byteLength() - src_offset) { |
| 2233 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", | 2236 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", |
| 2234 "srcLengthOverride is out of range"); | 2237 "srcLengthOverride is out of range"); |
| 2235 return; | 2238 return; |
| 2236 } | 2239 } |
| 2237 ContextGL()->CompressedTexSubImage2D( | 2240 ContextGL()->CompressedTexSubImage2D( |
| 2238 target, level, xoffset, yoffset, width, height, format, | 2241 target, level, xoffset, yoffset, width, height, format, |
| 2239 src_length_override, | 2242 src_length_override, |
| 2240 static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); | 2243 static_cast<uint8_t*>(data.View()->BaseAddressMaybeShared()) + |
| 2244 src_offset); |
| 2241 } | 2245 } |
| 2242 | 2246 |
| 2243 void WebGL2RenderingContextBase::compressedTexSubImage2D(GLenum target, | 2247 void WebGL2RenderingContextBase::compressedTexSubImage2D(GLenum target, |
| 2244 GLint level, | 2248 GLint level, |
| 2245 GLint xoffset, | 2249 GLint xoffset, |
| 2246 GLint yoffset, | 2250 GLint yoffset, |
| 2247 GLsizei width, | 2251 GLsizei width, |
| 2248 GLsizei height, | 2252 GLsizei height, |
| 2249 GLenum format, | 2253 GLenum format, |
| 2250 GLsizei image_size, | 2254 GLsizei image_size, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2262 } | 2266 } |
| 2263 | 2267 |
| 2264 void WebGL2RenderingContextBase::compressedTexImage3D( | 2268 void WebGL2RenderingContextBase::compressedTexImage3D( |
| 2265 GLenum target, | 2269 GLenum target, |
| 2266 GLint level, | 2270 GLint level, |
| 2267 GLenum internalformat, | 2271 GLenum internalformat, |
| 2268 GLsizei width, | 2272 GLsizei width, |
| 2269 GLsizei height, | 2273 GLsizei height, |
| 2270 GLsizei depth, | 2274 GLsizei depth, |
| 2271 GLint border, | 2275 GLint border, |
| 2272 NotShared<DOMArrayBufferView> data, | 2276 MaybeShared<DOMArrayBufferView> data, |
| 2273 GLuint src_offset, | 2277 GLuint src_offset, |
| 2274 GLuint src_length_override) { | 2278 GLuint src_length_override) { |
| 2275 if (isContextLost()) | 2279 if (isContextLost()) |
| 2276 return; | 2280 return; |
| 2277 if (bound_pixel_unpack_buffer_) { | 2281 if (bound_pixel_unpack_buffer_) { |
| 2278 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage3D", | 2282 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage3D", |
| 2279 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2283 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2280 return; | 2284 return; |
| 2281 } | 2285 } |
| 2282 if (!ValidateTexture3DBinding("compressedTexImage3D", target)) | 2286 if (!ValidateTexture3DBinding("compressedTexImage3D", target)) |
| 2283 return; | 2287 return; |
| 2284 if (!ValidateCompressedTexFormat("compressedTexImage3D", internalformat)) | 2288 if (!ValidateCompressedTexFormat("compressedTexImage3D", internalformat)) |
| 2285 return; | 2289 return; |
| 2286 if (src_offset > data.View()->byteLength()) { | 2290 if (src_offset > data.View()->byteLength()) { |
| 2287 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", | 2291 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", |
| 2288 "srcOffset is out of range"); | 2292 "srcOffset is out of range"); |
| 2289 return; | 2293 return; |
| 2290 } | 2294 } |
| 2291 if (src_length_override == 0) { | 2295 if (src_length_override == 0) { |
| 2292 src_length_override = data.View()->byteLength() - src_offset; | 2296 src_length_override = data.View()->byteLength() - src_offset; |
| 2293 } else if (src_length_override > data.View()->byteLength() - src_offset) { | 2297 } else if (src_length_override > data.View()->byteLength() - src_offset) { |
| 2294 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", | 2298 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", |
| 2295 "srcLengthOverride is out of range"); | 2299 "srcLengthOverride is out of range"); |
| 2296 return; | 2300 return; |
| 2297 } | 2301 } |
| 2298 ContextGL()->CompressedTexImage3D( | 2302 ContextGL()->CompressedTexImage3D( |
| 2299 target, level, internalformat, width, height, depth, border, | 2303 target, level, internalformat, width, height, depth, border, |
| 2300 src_length_override, | 2304 src_length_override, |
| 2301 static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); | 2305 static_cast<uint8_t*>(data.View()->BaseAddressMaybeShared()) + |
| 2306 src_offset); |
| 2302 } | 2307 } |
| 2303 | 2308 |
| 2304 void WebGL2RenderingContextBase::compressedTexImage3D(GLenum target, | 2309 void WebGL2RenderingContextBase::compressedTexImage3D(GLenum target, |
| 2305 GLint level, | 2310 GLint level, |
| 2306 GLenum internalformat, | 2311 GLenum internalformat, |
| 2307 GLsizei width, | 2312 GLsizei width, |
| 2308 GLsizei height, | 2313 GLsizei height, |
| 2309 GLsizei depth, | 2314 GLsizei depth, |
| 2310 GLint border, | 2315 GLint border, |
| 2311 GLsizei image_size, | 2316 GLsizei image_size, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2325 void WebGL2RenderingContextBase::compressedTexSubImage3D( | 2330 void WebGL2RenderingContextBase::compressedTexSubImage3D( |
| 2326 GLenum target, | 2331 GLenum target, |
| 2327 GLint level, | 2332 GLint level, |
| 2328 GLint xoffset, | 2333 GLint xoffset, |
| 2329 GLint yoffset, | 2334 GLint yoffset, |
| 2330 GLint zoffset, | 2335 GLint zoffset, |
| 2331 GLsizei width, | 2336 GLsizei width, |
| 2332 GLsizei height, | 2337 GLsizei height, |
| 2333 GLsizei depth, | 2338 GLsizei depth, |
| 2334 GLenum format, | 2339 GLenum format, |
| 2335 NotShared<DOMArrayBufferView> data, | 2340 MaybeShared<DOMArrayBufferView> data, |
| 2336 GLuint src_offset, | 2341 GLuint src_offset, |
| 2337 GLuint src_length_override) { | 2342 GLuint src_length_override) { |
| 2338 if (isContextLost()) | 2343 if (isContextLost()) |
| 2339 return; | 2344 return; |
| 2340 if (bound_pixel_unpack_buffer_) { | 2345 if (bound_pixel_unpack_buffer_) { |
| 2341 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage3D", | 2346 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage3D", |
| 2342 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2347 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2343 return; | 2348 return; |
| 2344 } | 2349 } |
| 2345 if (!ValidateTexture3DBinding("compressedTexSubImage3D", target)) | 2350 if (!ValidateTexture3DBinding("compressedTexSubImage3D", target)) |
| 2346 return; | 2351 return; |
| 2347 if (!ValidateCompressedTexFormat("compressedTexSubImage3D", format)) | 2352 if (!ValidateCompressedTexFormat("compressedTexSubImage3D", format)) |
| 2348 return; | 2353 return; |
| 2349 if (src_offset > data.View()->byteLength()) { | 2354 if (src_offset > data.View()->byteLength()) { |
| 2350 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", | 2355 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", |
| 2351 "srcOffset is out of range"); | 2356 "srcOffset is out of range"); |
| 2352 return; | 2357 return; |
| 2353 } | 2358 } |
| 2354 if (src_length_override == 0) { | 2359 if (src_length_override == 0) { |
| 2355 src_length_override = data.View()->byteLength() - src_offset; | 2360 src_length_override = data.View()->byteLength() - src_offset; |
| 2356 } else if (src_length_override > data.View()->byteLength() - src_offset) { | 2361 } else if (src_length_override > data.View()->byteLength() - src_offset) { |
| 2357 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", | 2362 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", |
| 2358 "srcLengthOverride is out of range"); | 2363 "srcLengthOverride is out of range"); |
| 2359 return; | 2364 return; |
| 2360 } | 2365 } |
| 2361 ContextGL()->CompressedTexSubImage3D( | 2366 ContextGL()->CompressedTexSubImage3D( |
| 2362 target, level, xoffset, yoffset, zoffset, width, height, depth, format, | 2367 target, level, xoffset, yoffset, zoffset, width, height, depth, format, |
| 2363 src_length_override, | 2368 src_length_override, |
| 2364 static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); | 2369 static_cast<uint8_t*>(data.View()->BaseAddressMaybeShared()) + |
| 2370 src_offset); |
| 2365 } | 2371 } |
| 2366 | 2372 |
| 2367 void WebGL2RenderingContextBase::compressedTexSubImage3D(GLenum target, | 2373 void WebGL2RenderingContextBase::compressedTexSubImage3D(GLenum target, |
| 2368 GLint level, | 2374 GLint level, |
| 2369 GLint xoffset, | 2375 GLint xoffset, |
| 2370 GLint yoffset, | 2376 GLint yoffset, |
| 2371 GLint zoffset, | 2377 GLint zoffset, |
| 2372 GLsizei width, | 2378 GLsizei width, |
| 2373 GLsizei height, | 2379 GLsizei height, |
| 2374 GLsizei depth, | 2380 GLsizei depth, |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2837 | 2843 |
| 2838 ContextGL()->Uniform4uiv( | 2844 ContextGL()->Uniform4uiv( |
| 2839 location->Location(), | 2845 location->Location(), |
| 2840 (src_length ? src_length : (value.size() - src_offset)) >> 2, | 2846 (src_length ? src_length : (value.size() - src_offset)) >> 2, |
| 2841 value.Data() + src_offset); | 2847 value.Data() + src_offset); |
| 2842 } | 2848 } |
| 2843 | 2849 |
| 2844 void WebGL2RenderingContextBase::uniformMatrix2fv( | 2850 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 2845 const WebGLUniformLocation* location, | 2851 const WebGLUniformLocation* location, |
| 2846 GLboolean transpose, | 2852 GLboolean transpose, |
| 2847 NotShared<DOMFloat32Array> v, | 2853 MaybeShared<DOMFloat32Array> v, |
| 2848 GLuint src_offset, | 2854 GLuint src_offset, |
| 2849 GLuint src_length) { | 2855 GLuint src_length) { |
| 2850 if (isContextLost() || | 2856 if (isContextLost() || |
| 2851 !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, | 2857 !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, |
| 2852 v.View(), 4, src_offset, src_length)) | 2858 v.View(), 4, src_offset, src_length)) |
| 2853 return; | 2859 return; |
| 2854 ContextGL()->UniformMatrix2fv( | 2860 ContextGL()->UniformMatrix2fv( |
| 2855 location->Location(), | 2861 location->Location(), |
| 2856 (src_length ? src_length : (v.View()->length() - src_offset)) >> 2, | 2862 (src_length ? src_length : (v.View()->length() - src_offset)) >> 2, |
| 2857 transpose, v.View()->Data() + src_offset); | 2863 transpose, v.View()->DataMaybeShared() + src_offset); |
| 2858 } | 2864 } |
| 2859 | 2865 |
| 2860 void WebGL2RenderingContextBase::uniformMatrix2fv( | 2866 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 2861 const WebGLUniformLocation* location, | 2867 const WebGLUniformLocation* location, |
| 2862 GLboolean transpose, | 2868 GLboolean transpose, |
| 2863 Vector<GLfloat>& v, | 2869 Vector<GLfloat>& v, |
| 2864 GLuint src_offset, | 2870 GLuint src_offset, |
| 2865 GLuint src_length) { | 2871 GLuint src_length) { |
| 2866 if (isContextLost() || !ValidateUniformMatrixParameters( | 2872 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2867 "uniformMatrix2fv", location, transpose, v.Data(), | 2873 "uniformMatrix2fv", location, transpose, v.Data(), |
| 2868 v.size(), 4, src_offset, src_length)) | 2874 v.size(), 4, src_offset, src_length)) |
| 2869 return; | 2875 return; |
| 2870 ContextGL()->UniformMatrix2fv( | 2876 ContextGL()->UniformMatrix2fv( |
| 2871 location->Location(), | 2877 location->Location(), |
| 2872 (src_length ? src_length : (v.size() - src_offset)) >> 2, transpose, | 2878 (src_length ? src_length : (v.size() - src_offset)) >> 2, transpose, |
| 2873 v.Data() + src_offset); | 2879 v.Data() + src_offset); |
| 2874 } | 2880 } |
| 2875 | 2881 |
| 2876 void WebGL2RenderingContextBase::uniformMatrix3fv( | 2882 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 2877 const WebGLUniformLocation* location, | 2883 const WebGLUniformLocation* location, |
| 2878 GLboolean transpose, | 2884 GLboolean transpose, |
| 2879 NotShared<DOMFloat32Array> v, | 2885 MaybeShared<DOMFloat32Array> v, |
| 2880 GLuint src_offset, | 2886 GLuint src_offset, |
| 2881 GLuint src_length) { | 2887 GLuint src_length) { |
| 2882 if (isContextLost() || | 2888 if (isContextLost() || |
| 2883 !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, | 2889 !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, |
| 2884 v.View(), 9, src_offset, src_length)) | 2890 v.View(), 9, src_offset, src_length)) |
| 2885 return; | 2891 return; |
| 2886 ContextGL()->UniformMatrix3fv( | 2892 ContextGL()->UniformMatrix3fv( |
| 2887 location->Location(), | 2893 location->Location(), |
| 2888 (src_length ? src_length : (v.View()->length() - src_offset)) / 9, | 2894 (src_length ? src_length : (v.View()->length() - src_offset)) / 9, |
| 2889 transpose, v.View()->Data() + src_offset); | 2895 transpose, v.View()->DataMaybeShared() + src_offset); |
| 2890 } | 2896 } |
| 2891 | 2897 |
| 2892 void WebGL2RenderingContextBase::uniformMatrix3fv( | 2898 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 2893 const WebGLUniformLocation* location, | 2899 const WebGLUniformLocation* location, |
| 2894 GLboolean transpose, | 2900 GLboolean transpose, |
| 2895 Vector<GLfloat>& v, | 2901 Vector<GLfloat>& v, |
| 2896 GLuint src_offset, | 2902 GLuint src_offset, |
| 2897 GLuint src_length) { | 2903 GLuint src_length) { |
| 2898 if (isContextLost() || !ValidateUniformMatrixParameters( | 2904 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2899 "uniformMatrix3fv", location, transpose, v.Data(), | 2905 "uniformMatrix3fv", location, transpose, v.Data(), |
| 2900 v.size(), 9, src_offset, src_length)) | 2906 v.size(), 9, src_offset, src_length)) |
| 2901 return; | 2907 return; |
| 2902 ContextGL()->UniformMatrix3fv( | 2908 ContextGL()->UniformMatrix3fv( |
| 2903 location->Location(), | 2909 location->Location(), |
| 2904 (src_length ? src_length : (v.size() - src_offset)) / 9, transpose, | 2910 (src_length ? src_length : (v.size() - src_offset)) / 9, transpose, |
| 2905 v.Data() + src_offset); | 2911 v.Data() + src_offset); |
| 2906 } | 2912 } |
| 2907 | 2913 |
| 2908 void WebGL2RenderingContextBase::uniformMatrix4fv( | 2914 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 2909 const WebGLUniformLocation* location, | 2915 const WebGLUniformLocation* location, |
| 2910 GLboolean transpose, | 2916 GLboolean transpose, |
| 2911 NotShared<DOMFloat32Array> v, | 2917 MaybeShared<DOMFloat32Array> v, |
| 2912 GLuint src_offset, | 2918 GLuint src_offset, |
| 2913 GLuint src_length) { | 2919 GLuint src_length) { |
| 2914 if (isContextLost() || | 2920 if (isContextLost() || |
| 2915 !ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose, | 2921 !ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose, |
| 2916 v.View(), 16, src_offset, src_length)) | 2922 v.View(), 16, src_offset, src_length)) |
| 2917 return; | 2923 return; |
| 2918 ContextGL()->UniformMatrix4fv( | 2924 ContextGL()->UniformMatrix4fv( |
| 2919 location->Location(), | 2925 location->Location(), |
| 2920 (src_length ? src_length : (v.View()->length() - src_offset)) >> 4, | 2926 (src_length ? src_length : (v.View()->length() - src_offset)) >> 4, |
| 2921 transpose, v.View()->Data() + src_offset); | 2927 transpose, v.View()->DataMaybeShared() + src_offset); |
| 2922 } | 2928 } |
| 2923 | 2929 |
| 2924 void WebGL2RenderingContextBase::uniformMatrix4fv( | 2930 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 2925 const WebGLUniformLocation* location, | 2931 const WebGLUniformLocation* location, |
| 2926 GLboolean transpose, | 2932 GLboolean transpose, |
| 2927 Vector<GLfloat>& v, | 2933 Vector<GLfloat>& v, |
| 2928 GLuint src_offset, | 2934 GLuint src_offset, |
| 2929 GLuint src_length) { | 2935 GLuint src_length) { |
| 2930 if (isContextLost() || !ValidateUniformMatrixParameters( | 2936 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2931 "uniformMatrix4fv", location, transpose, v.Data(), | 2937 "uniformMatrix4fv", location, transpose, v.Data(), |
| 2932 v.size(), 16, src_offset, src_length)) | 2938 v.size(), 16, src_offset, src_length)) |
| 2933 return; | 2939 return; |
| 2934 ContextGL()->UniformMatrix4fv( | 2940 ContextGL()->UniformMatrix4fv( |
| 2935 location->Location(), | 2941 location->Location(), |
| 2936 (src_length ? src_length : (v.size() - src_offset)) >> 4, transpose, | 2942 (src_length ? src_length : (v.size() - src_offset)) >> 4, transpose, |
| 2937 v.Data() + src_offset); | 2943 v.Data() + src_offset); |
| 2938 } | 2944 } |
| 2939 | 2945 |
| 2940 void WebGL2RenderingContextBase::uniformMatrix2x3fv( | 2946 void WebGL2RenderingContextBase::uniformMatrix2x3fv( |
| 2941 const WebGLUniformLocation* location, | 2947 const WebGLUniformLocation* location, |
| 2942 GLboolean transpose, | 2948 GLboolean transpose, |
| 2943 NotShared<DOMFloat32Array> value, | 2949 MaybeShared<DOMFloat32Array> value, |
| 2944 GLuint src_offset, | 2950 GLuint src_offset, |
| 2945 GLuint src_length) { | 2951 GLuint src_length) { |
| 2946 if (isContextLost() || !ValidateUniformMatrixParameters( | 2952 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2947 "uniformMatrix2x3fv", location, transpose, | 2953 "uniformMatrix2x3fv", location, transpose, |
| 2948 value.View(), 6, src_offset, src_length)) | 2954 value.View(), 6, src_offset, src_length)) |
| 2949 return; | 2955 return; |
| 2950 ContextGL()->UniformMatrix2x3fv( | 2956 ContextGL()->UniformMatrix2x3fv( |
| 2951 location->Location(), | 2957 location->Location(), |
| 2952 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, | 2958 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, |
| 2953 transpose, value.View()->Data() + src_offset); | 2959 transpose, value.View()->DataMaybeShared() + src_offset); |
| 2954 } | 2960 } |
| 2955 | 2961 |
| 2956 void WebGL2RenderingContextBase::uniformMatrix2x3fv( | 2962 void WebGL2RenderingContextBase::uniformMatrix2x3fv( |
| 2957 const WebGLUniformLocation* location, | 2963 const WebGLUniformLocation* location, |
| 2958 GLboolean transpose, | 2964 GLboolean transpose, |
| 2959 Vector<GLfloat>& value, | 2965 Vector<GLfloat>& value, |
| 2960 GLuint src_offset, | 2966 GLuint src_offset, |
| 2961 GLuint src_length) { | 2967 GLuint src_length) { |
| 2962 if (isContextLost() || | 2968 if (isContextLost() || |
| 2963 !ValidateUniformMatrixParameters("uniformMatrix2x3fv", location, | 2969 !ValidateUniformMatrixParameters("uniformMatrix2x3fv", location, |
| 2964 transpose, value.Data(), value.size(), 6, | 2970 transpose, value.Data(), value.size(), 6, |
| 2965 src_offset, src_length)) | 2971 src_offset, src_length)) |
| 2966 return; | 2972 return; |
| 2967 ContextGL()->UniformMatrix2x3fv( | 2973 ContextGL()->UniformMatrix2x3fv( |
| 2968 location->Location(), | 2974 location->Location(), |
| 2969 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, | 2975 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, |
| 2970 value.Data() + src_offset); | 2976 value.Data() + src_offset); |
| 2971 } | 2977 } |
| 2972 | 2978 |
| 2973 void WebGL2RenderingContextBase::uniformMatrix3x2fv( | 2979 void WebGL2RenderingContextBase::uniformMatrix3x2fv( |
| 2974 const WebGLUniformLocation* location, | 2980 const WebGLUniformLocation* location, |
| 2975 GLboolean transpose, | 2981 GLboolean transpose, |
| 2976 NotShared<DOMFloat32Array> value, | 2982 MaybeShared<DOMFloat32Array> value, |
| 2977 GLuint src_offset, | 2983 GLuint src_offset, |
| 2978 GLuint src_length) { | 2984 GLuint src_length) { |
| 2979 if (isContextLost() || !ValidateUniformMatrixParameters( | 2985 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2980 "uniformMatrix3x2fv", location, transpose, | 2986 "uniformMatrix3x2fv", location, transpose, |
| 2981 value.View(), 6, src_offset, src_length)) | 2987 value.View(), 6, src_offset, src_length)) |
| 2982 return; | 2988 return; |
| 2983 ContextGL()->UniformMatrix3x2fv( | 2989 ContextGL()->UniformMatrix3x2fv( |
| 2984 location->Location(), | 2990 location->Location(), |
| 2985 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, | 2991 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, |
| 2986 transpose, value.View()->Data() + src_offset); | 2992 transpose, value.View()->DataMaybeShared() + src_offset); |
| 2987 } | 2993 } |
| 2988 | 2994 |
| 2989 void WebGL2RenderingContextBase::uniformMatrix3x2fv( | 2995 void WebGL2RenderingContextBase::uniformMatrix3x2fv( |
| 2990 const WebGLUniformLocation* location, | 2996 const WebGLUniformLocation* location, |
| 2991 GLboolean transpose, | 2997 GLboolean transpose, |
| 2992 Vector<GLfloat>& value, | 2998 Vector<GLfloat>& value, |
| 2993 GLuint src_offset, | 2999 GLuint src_offset, |
| 2994 GLuint src_length) { | 3000 GLuint src_length) { |
| 2995 if (isContextLost() || | 3001 if (isContextLost() || |
| 2996 !ValidateUniformMatrixParameters("uniformMatrix3x2fv", location, | 3002 !ValidateUniformMatrixParameters("uniformMatrix3x2fv", location, |
| 2997 transpose, value.Data(), value.size(), 6, | 3003 transpose, value.Data(), value.size(), 6, |
| 2998 src_offset, src_length)) | 3004 src_offset, src_length)) |
| 2999 return; | 3005 return; |
| 3000 ContextGL()->UniformMatrix3x2fv( | 3006 ContextGL()->UniformMatrix3x2fv( |
| 3001 location->Location(), | 3007 location->Location(), |
| 3002 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, | 3008 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, |
| 3003 value.Data() + src_offset); | 3009 value.Data() + src_offset); |
| 3004 } | 3010 } |
| 3005 | 3011 |
| 3006 void WebGL2RenderingContextBase::uniformMatrix2x4fv( | 3012 void WebGL2RenderingContextBase::uniformMatrix2x4fv( |
| 3007 const WebGLUniformLocation* location, | 3013 const WebGLUniformLocation* location, |
| 3008 GLboolean transpose, | 3014 GLboolean transpose, |
| 3009 NotShared<DOMFloat32Array> value, | 3015 MaybeShared<DOMFloat32Array> value, |
| 3010 GLuint src_offset, | 3016 GLuint src_offset, |
| 3011 GLuint src_length) { | 3017 GLuint src_length) { |
| 3012 if (isContextLost() || !ValidateUniformMatrixParameters( | 3018 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 3013 "uniformMatrix2x4fv", location, transpose, | 3019 "uniformMatrix2x4fv", location, transpose, |
| 3014 value.View(), 8, src_offset, src_length)) | 3020 value.View(), 8, src_offset, src_length)) |
| 3015 return; | 3021 return; |
| 3016 ContextGL()->UniformMatrix2x4fv( | 3022 ContextGL()->UniformMatrix2x4fv( |
| 3017 location->Location(), | 3023 location->Location(), |
| 3018 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, | 3024 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, |
| 3019 transpose, value.View()->Data() + src_offset); | 3025 transpose, value.View()->DataMaybeShared() + src_offset); |
| 3020 } | 3026 } |
| 3021 | 3027 |
| 3022 void WebGL2RenderingContextBase::uniformMatrix2x4fv( | 3028 void WebGL2RenderingContextBase::uniformMatrix2x4fv( |
| 3023 const WebGLUniformLocation* location, | 3029 const WebGLUniformLocation* location, |
| 3024 GLboolean transpose, | 3030 GLboolean transpose, |
| 3025 Vector<GLfloat>& value, | 3031 Vector<GLfloat>& value, |
| 3026 GLuint src_offset, | 3032 GLuint src_offset, |
| 3027 GLuint src_length) { | 3033 GLuint src_length) { |
| 3028 if (isContextLost() || | 3034 if (isContextLost() || |
| 3029 !ValidateUniformMatrixParameters("uniformMatrix2x4fv", location, | 3035 !ValidateUniformMatrixParameters("uniformMatrix2x4fv", location, |
| 3030 transpose, value.Data(), value.size(), 8, | 3036 transpose, value.Data(), value.size(), 8, |
| 3031 src_offset, src_length)) | 3037 src_offset, src_length)) |
| 3032 return; | 3038 return; |
| 3033 ContextGL()->UniformMatrix2x4fv( | 3039 ContextGL()->UniformMatrix2x4fv( |
| 3034 location->Location(), | 3040 location->Location(), |
| 3035 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, | 3041 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, |
| 3036 value.Data() + src_offset); | 3042 value.Data() + src_offset); |
| 3037 } | 3043 } |
| 3038 | 3044 |
| 3039 void WebGL2RenderingContextBase::uniformMatrix4x2fv( | 3045 void WebGL2RenderingContextBase::uniformMatrix4x2fv( |
| 3040 const WebGLUniformLocation* location, | 3046 const WebGLUniformLocation* location, |
| 3041 GLboolean transpose, | 3047 GLboolean transpose, |
| 3042 NotShared<DOMFloat32Array> value, | 3048 MaybeShared<DOMFloat32Array> value, |
| 3043 GLuint src_offset, | 3049 GLuint src_offset, |
| 3044 GLuint src_length) { | 3050 GLuint src_length) { |
| 3045 if (isContextLost() || !ValidateUniformMatrixParameters( | 3051 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 3046 "uniformMatrix4x2fv", location, transpose, | 3052 "uniformMatrix4x2fv", location, transpose, |
| 3047 value.View(), 8, src_offset, src_length)) | 3053 value.View(), 8, src_offset, src_length)) |
| 3048 return; | 3054 return; |
| 3049 ContextGL()->UniformMatrix4x2fv( | 3055 ContextGL()->UniformMatrix4x2fv( |
| 3050 location->Location(), | 3056 location->Location(), |
| 3051 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, | 3057 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, |
| 3052 transpose, value.View()->Data() + src_offset); | 3058 transpose, value.View()->DataMaybeShared() + src_offset); |
| 3053 } | 3059 } |
| 3054 | 3060 |
| 3055 void WebGL2RenderingContextBase::uniformMatrix4x2fv( | 3061 void WebGL2RenderingContextBase::uniformMatrix4x2fv( |
| 3056 const WebGLUniformLocation* location, | 3062 const WebGLUniformLocation* location, |
| 3057 GLboolean transpose, | 3063 GLboolean transpose, |
| 3058 Vector<GLfloat>& value, | 3064 Vector<GLfloat>& value, |
| 3059 GLuint src_offset, | 3065 GLuint src_offset, |
| 3060 GLuint src_length) { | 3066 GLuint src_length) { |
| 3061 if (isContextLost() || | 3067 if (isContextLost() || |
| 3062 !ValidateUniformMatrixParameters("uniformMatrix4x2fv", location, | 3068 !ValidateUniformMatrixParameters("uniformMatrix4x2fv", location, |
| 3063 transpose, value.Data(), value.size(), 8, | 3069 transpose, value.Data(), value.size(), 8, |
| 3064 src_offset, src_length)) | 3070 src_offset, src_length)) |
| 3065 return; | 3071 return; |
| 3066 ContextGL()->UniformMatrix4x2fv( | 3072 ContextGL()->UniformMatrix4x2fv( |
| 3067 location->Location(), | 3073 location->Location(), |
| 3068 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, | 3074 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, |
| 3069 value.Data() + src_offset); | 3075 value.Data() + src_offset); |
| 3070 } | 3076 } |
| 3071 | 3077 |
| 3072 void WebGL2RenderingContextBase::uniformMatrix3x4fv( | 3078 void WebGL2RenderingContextBase::uniformMatrix3x4fv( |
| 3073 const WebGLUniformLocation* location, | 3079 const WebGLUniformLocation* location, |
| 3074 GLboolean transpose, | 3080 GLboolean transpose, |
| 3075 NotShared<DOMFloat32Array> value, | 3081 MaybeShared<DOMFloat32Array> value, |
| 3076 GLuint src_offset, | 3082 GLuint src_offset, |
| 3077 GLuint src_length) { | 3083 GLuint src_length) { |
| 3078 if (isContextLost() || !ValidateUniformMatrixParameters( | 3084 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 3079 "uniformMatrix3x4fv", location, transpose, | 3085 "uniformMatrix3x4fv", location, transpose, |
| 3080 value.View(), 12, src_offset, src_length)) | 3086 value.View(), 12, src_offset, src_length)) |
| 3081 return; | 3087 return; |
| 3082 ContextGL()->UniformMatrix3x4fv( | 3088 ContextGL()->UniformMatrix3x4fv( |
| 3083 location->Location(), | 3089 location->Location(), |
| 3084 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, | 3090 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, |
| 3085 transpose, value.View()->Data() + src_offset); | 3091 transpose, value.View()->DataMaybeShared() + src_offset); |
| 3086 } | 3092 } |
| 3087 | 3093 |
| 3088 void WebGL2RenderingContextBase::uniformMatrix3x4fv( | 3094 void WebGL2RenderingContextBase::uniformMatrix3x4fv( |
| 3089 const WebGLUniformLocation* location, | 3095 const WebGLUniformLocation* location, |
| 3090 GLboolean transpose, | 3096 GLboolean transpose, |
| 3091 Vector<GLfloat>& value, | 3097 Vector<GLfloat>& value, |
| 3092 GLuint src_offset, | 3098 GLuint src_offset, |
| 3093 GLuint src_length) { | 3099 GLuint src_length) { |
| 3094 if (isContextLost() || | 3100 if (isContextLost() || |
| 3095 !ValidateUniformMatrixParameters("uniformMatrix3x4fv", location, | 3101 !ValidateUniformMatrixParameters("uniformMatrix3x4fv", location, |
| 3096 transpose, value.Data(), value.size(), | 3102 transpose, value.Data(), value.size(), |
| 3097 12, src_offset, src_length)) | 3103 12, src_offset, src_length)) |
| 3098 return; | 3104 return; |
| 3099 ContextGL()->UniformMatrix3x4fv( | 3105 ContextGL()->UniformMatrix3x4fv( |
| 3100 location->Location(), | 3106 location->Location(), |
| 3101 (src_length ? src_length : (value.size() - src_offset)) / 12, transpose, | 3107 (src_length ? src_length : (value.size() - src_offset)) / 12, transpose, |
| 3102 value.Data() + src_offset); | 3108 value.Data() + src_offset); |
| 3103 } | 3109 } |
| 3104 | 3110 |
| 3105 void WebGL2RenderingContextBase::uniformMatrix4x3fv( | 3111 void WebGL2RenderingContextBase::uniformMatrix4x3fv( |
| 3106 const WebGLUniformLocation* location, | 3112 const WebGLUniformLocation* location, |
| 3107 GLboolean transpose, | 3113 GLboolean transpose, |
| 3108 NotShared<DOMFloat32Array> value, | 3114 MaybeShared<DOMFloat32Array> value, |
| 3109 GLuint src_offset, | 3115 GLuint src_offset, |
| 3110 GLuint src_length) { | 3116 GLuint src_length) { |
| 3111 if (isContextLost() || !ValidateUniformMatrixParameters( | 3117 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 3112 "uniformMatrix4x3fv", location, transpose, | 3118 "uniformMatrix4x3fv", location, transpose, |
| 3113 value.View(), 12, src_offset, src_length)) | 3119 value.View(), 12, src_offset, src_length)) |
| 3114 return; | 3120 return; |
| 3115 ContextGL()->UniformMatrix4x3fv( | 3121 ContextGL()->UniformMatrix4x3fv( |
| 3116 location->Location(), | 3122 location->Location(), |
| 3117 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, | 3123 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, |
| 3118 transpose, value.View()->Data() + src_offset); | 3124 transpose, value.View()->DataMaybeShared() + src_offset); |
| 3119 } | 3125 } |
| 3120 | 3126 |
| 3121 void WebGL2RenderingContextBase::uniformMatrix4x3fv( | 3127 void WebGL2RenderingContextBase::uniformMatrix4x3fv( |
| 3122 const WebGLUniformLocation* location, | 3128 const WebGLUniformLocation* location, |
| 3123 GLboolean transpose, | 3129 GLboolean transpose, |
| 3124 Vector<GLfloat>& value, | 3130 Vector<GLfloat>& value, |
| 3125 GLuint src_offset, | 3131 GLuint src_offset, |
| 3126 GLuint src_length) { | 3132 GLuint src_length) { |
| 3127 if (isContextLost() || | 3133 if (isContextLost() || |
| 3128 !ValidateUniformMatrixParameters("uniformMatrix4x3fv", location, | 3134 !ValidateUniformMatrixParameters("uniformMatrix4x3fv", location, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3227 | 3233 |
| 3228 void WebGL2RenderingContextBase::uniform4iv( | 3234 void WebGL2RenderingContextBase::uniform4iv( |
| 3229 const WebGLUniformLocation* location, | 3235 const WebGLUniformLocation* location, |
| 3230 Vector<GLint>& v) { | 3236 Vector<GLint>& v) { |
| 3231 WebGLRenderingContextBase::uniform4iv(location, v); | 3237 WebGLRenderingContextBase::uniform4iv(location, v); |
| 3232 } | 3238 } |
| 3233 | 3239 |
| 3234 void WebGL2RenderingContextBase::uniformMatrix2fv( | 3240 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 3235 const WebGLUniformLocation* location, | 3241 const WebGLUniformLocation* location, |
| 3236 GLboolean transpose, | 3242 GLboolean transpose, |
| 3237 NotShared<DOMFloat32Array> v) { | 3243 MaybeShared<DOMFloat32Array> v) { |
| 3238 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); | 3244 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); |
| 3239 } | 3245 } |
| 3240 | 3246 |
| 3241 void WebGL2RenderingContextBase::uniformMatrix2fv( | 3247 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 3242 const WebGLUniformLocation* location, | 3248 const WebGLUniformLocation* location, |
| 3243 GLboolean transpose, | 3249 GLboolean transpose, |
| 3244 Vector<GLfloat>& v) { | 3250 Vector<GLfloat>& v) { |
| 3245 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); | 3251 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); |
| 3246 } | 3252 } |
| 3247 | 3253 |
| 3248 void WebGL2RenderingContextBase::uniformMatrix3fv( | 3254 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 3249 const WebGLUniformLocation* location, | 3255 const WebGLUniformLocation* location, |
| 3250 GLboolean transpose, | 3256 GLboolean transpose, |
| 3251 NotShared<DOMFloat32Array> v) { | 3257 MaybeShared<DOMFloat32Array> v) { |
| 3252 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); | 3258 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); |
| 3253 } | 3259 } |
| 3254 | 3260 |
| 3255 void WebGL2RenderingContextBase::uniformMatrix3fv( | 3261 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 3256 const WebGLUniformLocation* location, | 3262 const WebGLUniformLocation* location, |
| 3257 GLboolean transpose, | 3263 GLboolean transpose, |
| 3258 Vector<GLfloat>& v) { | 3264 Vector<GLfloat>& v) { |
| 3259 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); | 3265 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); |
| 3260 } | 3266 } |
| 3261 | 3267 |
| 3262 void WebGL2RenderingContextBase::uniformMatrix4fv( | 3268 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 3263 const WebGLUniformLocation* location, | 3269 const WebGLUniformLocation* location, |
| 3264 GLboolean transpose, | 3270 GLboolean transpose, |
| 3265 NotShared<DOMFloat32Array> v) { | 3271 MaybeShared<DOMFloat32Array> v) { |
| 3266 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); | 3272 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); |
| 3267 } | 3273 } |
| 3268 | 3274 |
| 3269 void WebGL2RenderingContextBase::uniformMatrix4fv( | 3275 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 3270 const WebGLUniformLocation* location, | 3276 const WebGLUniformLocation* location, |
| 3271 GLboolean transpose, | 3277 GLboolean transpose, |
| 3272 Vector<GLfloat>& v) { | 3278 Vector<GLfloat>& v) { |
| 3273 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); | 3279 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); |
| 3274 } | 3280 } |
| 3275 | 3281 |
| 3276 void WebGL2RenderingContextBase::vertexAttribI4i(GLuint index, | 3282 void WebGL2RenderingContextBase::vertexAttribI4i(GLuint index, |
| 3277 GLint x, | 3283 GLint x, |
| 3278 GLint y, | 3284 GLint y, |
| 3279 GLint z, | 3285 GLint z, |
| 3280 GLint w) { | 3286 GLint w) { |
| 3281 if (isContextLost()) | 3287 if (isContextLost()) |
| 3282 return; | 3288 return; |
| 3283 ContextGL()->VertexAttribI4i(index, x, y, z, w); | 3289 ContextGL()->VertexAttribI4i(index, x, y, z, w); |
| 3284 SetVertexAttribType(index, kInt32ArrayType); | 3290 SetVertexAttribType(index, kInt32ArrayType); |
| 3285 } | 3291 } |
| 3286 | 3292 |
| 3287 void WebGL2RenderingContextBase::vertexAttribI4iv( | 3293 void WebGL2RenderingContextBase::vertexAttribI4iv( |
| 3288 GLuint index, | 3294 GLuint index, |
| 3289 NotShared<const DOMInt32Array> v) { | 3295 MaybeShared<const DOMInt32Array> v) { |
| 3290 if (isContextLost()) | 3296 if (isContextLost()) |
| 3291 return; | 3297 return; |
| 3292 if (!v.View() || v.View()->length() < 4) { | 3298 if (!v.View() || v.View()->length() < 4) { |
| 3293 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); | 3299 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); |
| 3294 return; | 3300 return; |
| 3295 } | 3301 } |
| 3296 ContextGL()->VertexAttribI4iv(index, v.View()->Data()); | 3302 ContextGL()->VertexAttribI4iv(index, v.View()->DataMaybeShared()); |
| 3297 SetVertexAttribType(index, kInt32ArrayType); | 3303 SetVertexAttribType(index, kInt32ArrayType); |
| 3298 } | 3304 } |
| 3299 | 3305 |
| 3300 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, | 3306 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, |
| 3301 const Vector<GLint>& v) { | 3307 const Vector<GLint>& v) { |
| 3302 if (isContextLost()) | 3308 if (isContextLost()) |
| 3303 return; | 3309 return; |
| 3304 if (v.size() < 4) { | 3310 if (v.size() < 4) { |
| 3305 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); | 3311 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); |
| 3306 return; | 3312 return; |
| 3307 } | 3313 } |
| 3308 ContextGL()->VertexAttribI4iv(index, v.Data()); | 3314 ContextGL()->VertexAttribI4iv(index, v.Data()); |
| 3309 SetVertexAttribType(index, kInt32ArrayType); | 3315 SetVertexAttribType(index, kInt32ArrayType); |
| 3310 } | 3316 } |
| 3311 | 3317 |
| 3312 void WebGL2RenderingContextBase::vertexAttribI4ui(GLuint index, | 3318 void WebGL2RenderingContextBase::vertexAttribI4ui(GLuint index, |
| 3313 GLuint x, | 3319 GLuint x, |
| 3314 GLuint y, | 3320 GLuint y, |
| 3315 GLuint z, | 3321 GLuint z, |
| 3316 GLuint w) { | 3322 GLuint w) { |
| 3317 if (isContextLost()) | 3323 if (isContextLost()) |
| 3318 return; | 3324 return; |
| 3319 ContextGL()->VertexAttribI4ui(index, x, y, z, w); | 3325 ContextGL()->VertexAttribI4ui(index, x, y, z, w); |
| 3320 SetVertexAttribType(index, kUint32ArrayType); | 3326 SetVertexAttribType(index, kUint32ArrayType); |
| 3321 } | 3327 } |
| 3322 | 3328 |
| 3323 void WebGL2RenderingContextBase::vertexAttribI4uiv( | 3329 void WebGL2RenderingContextBase::vertexAttribI4uiv( |
| 3324 GLuint index, | 3330 GLuint index, |
| 3325 NotShared<const DOMUint32Array> v) { | 3331 MaybeShared<const DOMUint32Array> v) { |
| 3326 if (isContextLost()) | 3332 if (isContextLost()) |
| 3327 return; | 3333 return; |
| 3328 if (!v.View() || v.View()->length() < 4) { | 3334 if (!v.View() || v.View()->length() < 4) { |
| 3329 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); | 3335 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); |
| 3330 return; | 3336 return; |
| 3331 } | 3337 } |
| 3332 ContextGL()->VertexAttribI4uiv(index, v.View()->Data()); | 3338 ContextGL()->VertexAttribI4uiv(index, v.View()->DataMaybeShared()); |
| 3333 SetVertexAttribType(index, kUint32ArrayType); | 3339 SetVertexAttribType(index, kUint32ArrayType); |
| 3334 } | 3340 } |
| 3335 | 3341 |
| 3336 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, | 3342 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, |
| 3337 const Vector<GLuint>& v) { | 3343 const Vector<GLuint>& v) { |
| 3338 if (isContextLost()) | 3344 if (isContextLost()) |
| 3339 return; | 3345 return; |
| 3340 if (v.size() < 4) { | 3346 if (v.size() < 4) { |
| 3341 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); | 3347 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); |
| 3342 return; | 3348 return; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3548 const char* func_name, | 3554 const char* func_name, |
| 3549 TexImageFunctionID function_id, | 3555 TexImageFunctionID function_id, |
| 3550 GLenum target) { | 3556 GLenum target) { |
| 3551 if (function_id == kTexImage3D || function_id == kTexSubImage3D) | 3557 if (function_id == kTexImage3D || function_id == kTexSubImage3D) |
| 3552 return ValidateTexture3DBinding(func_name, target); | 3558 return ValidateTexture3DBinding(func_name, target); |
| 3553 return ValidateTexture2DBinding(func_name, target); | 3559 return ValidateTexture2DBinding(func_name, target); |
| 3554 } | 3560 } |
| 3555 | 3561 |
| 3556 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, | 3562 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, |
| 3557 GLint drawbuffer, | 3563 GLint drawbuffer, |
| 3558 NotShared<DOMInt32Array> value, | 3564 MaybeShared<DOMInt32Array> value, |
| 3559 GLuint src_offset) { | 3565 GLuint src_offset) { |
| 3560 if (isContextLost() || | 3566 if (isContextLost() || |
| 3561 !ValidateClearBuffer("clearBufferiv", buffer, value.View()->length(), | 3567 !ValidateClearBuffer("clearBufferiv", buffer, value.View()->length(), |
| 3562 src_offset)) | 3568 src_offset)) |
| 3563 return; | 3569 return; |
| 3564 | 3570 |
| 3565 ContextGL()->ClearBufferiv(buffer, drawbuffer, | 3571 ContextGL()->ClearBufferiv(buffer, drawbuffer, |
| 3566 value.View()->Data() + src_offset); | 3572 value.View()->DataMaybeShared() + src_offset); |
| 3567 } | 3573 } |
| 3568 | 3574 |
| 3569 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, | 3575 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, |
| 3570 GLint drawbuffer, | 3576 GLint drawbuffer, |
| 3571 const Vector<GLint>& value, | 3577 const Vector<GLint>& value, |
| 3572 GLuint src_offset) { | 3578 GLuint src_offset) { |
| 3573 if (isContextLost() || | 3579 if (isContextLost() || |
| 3574 !ValidateClearBuffer("clearBufferiv", buffer, value.size(), src_offset)) | 3580 !ValidateClearBuffer("clearBufferiv", buffer, value.size(), src_offset)) |
| 3575 return; | 3581 return; |
| 3576 | 3582 |
| 3577 ContextGL()->ClearBufferiv(buffer, drawbuffer, value.Data() + src_offset); | 3583 ContextGL()->ClearBufferiv(buffer, drawbuffer, value.Data() + src_offset); |
| 3578 } | 3584 } |
| 3579 | 3585 |
| 3580 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, | 3586 void WebGL2RenderingContextBase::clearBufferuiv( |
| 3581 GLint drawbuffer, | 3587 GLenum buffer, |
| 3582 NotShared<DOMUint32Array> value, | 3588 GLint drawbuffer, |
| 3583 GLuint src_offset) { | 3589 MaybeShared<DOMUint32Array> value, |
| 3590 GLuint src_offset) { |
| 3584 if (isContextLost() || | 3591 if (isContextLost() || |
| 3585 !ValidateClearBuffer("clearBufferuiv", buffer, value.View()->length(), | 3592 !ValidateClearBuffer("clearBufferuiv", buffer, value.View()->length(), |
| 3586 src_offset)) | 3593 src_offset)) |
| 3587 return; | 3594 return; |
| 3588 | 3595 |
| 3589 ContextGL()->ClearBufferuiv(buffer, drawbuffer, | 3596 ContextGL()->ClearBufferuiv(buffer, drawbuffer, |
| 3590 value.View()->Data() + src_offset); | 3597 value.View()->DataMaybeShared() + src_offset); |
| 3591 } | 3598 } |
| 3592 | 3599 |
| 3593 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, | 3600 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, |
| 3594 GLint drawbuffer, | 3601 GLint drawbuffer, |
| 3595 const Vector<GLuint>& value, | 3602 const Vector<GLuint>& value, |
| 3596 GLuint src_offset) { | 3603 GLuint src_offset) { |
| 3597 if (isContextLost() || | 3604 if (isContextLost() || |
| 3598 !ValidateClearBuffer("clearBufferuiv", buffer, value.size(), src_offset)) | 3605 !ValidateClearBuffer("clearBufferuiv", buffer, value.size(), src_offset)) |
| 3599 return; | 3606 return; |
| 3600 | 3607 |
| 3601 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.Data() + src_offset); | 3608 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.Data() + src_offset); |
| 3602 } | 3609 } |
| 3603 | 3610 |
| 3604 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, | 3611 void WebGL2RenderingContextBase::clearBufferfv( |
| 3605 GLint drawbuffer, | 3612 GLenum buffer, |
| 3606 NotShared<DOMFloat32Array> value, | 3613 GLint drawbuffer, |
| 3607 GLuint src_offset) { | 3614 MaybeShared<DOMFloat32Array> value, |
| 3615 GLuint src_offset) { |
| 3608 if (isContextLost() || | 3616 if (isContextLost() || |
| 3609 !ValidateClearBuffer("clearBufferfv", buffer, value.View()->length(), | 3617 !ValidateClearBuffer("clearBufferfv", buffer, value.View()->length(), |
| 3610 src_offset)) | 3618 src_offset)) |
| 3611 return; | 3619 return; |
| 3612 | 3620 |
| 3613 ContextGL()->ClearBufferfv(buffer, drawbuffer, | 3621 ContextGL()->ClearBufferfv(buffer, drawbuffer, |
| 3614 value.View()->Data() + src_offset); | 3622 value.View()->DataMaybeShared() + src_offset); |
| 3615 } | 3623 } |
| 3616 | 3624 |
| 3617 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, | 3625 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, |
| 3618 GLint drawbuffer, | 3626 GLint drawbuffer, |
| 3619 const Vector<GLfloat>& value, | 3627 const Vector<GLfloat>& value, |
| 3620 GLuint src_offset) { | 3628 GLuint src_offset) { |
| 3621 if (isContextLost() || | 3629 if (isContextLost() || |
| 3622 !ValidateClearBuffer("clearBufferfv", buffer, value.size(), src_offset)) | 3630 !ValidateClearBuffer("clearBufferfv", buffer, value.size(), src_offset)) |
| 3623 return; | 3631 return; |
| 3624 | 3632 |
| (...skipping 2132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5757 | 5765 |
| 5758 void WebGL2RenderingContextBase:: | 5766 void WebGL2RenderingContextBase:: |
| 5759 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 5767 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
| 5760 if (!ContextGL()) | 5768 if (!ContextGL()) |
| 5761 return; | 5769 return; |
| 5762 ContextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 5770 ContextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
| 5763 ObjectOrZero(bound_pixel_unpack_buffer_.Get())); | 5771 ObjectOrZero(bound_pixel_unpack_buffer_.Get())); |
| 5764 } | 5772 } |
| 5765 | 5773 |
| 5766 } // namespace blink | 5774 } // namespace blink |
| OLD | NEW |