| 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 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)) |
| 2094 return; | 2096 return; |
| 2095 if (!ValidateCompressedTexFormat("compressedTexImage2D", internalformat)) | 2097 if (!ValidateCompressedTexFormat("compressedTexImage2D", internalformat)) |
| 2096 return; | 2098 return; |
| 2097 if (src_offset > data.View()->byteLength()) { | 2099 if (src_offset > data.View()->byteLength()) { |
| 2098 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", | 2100 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", |
| 2099 "srcOffset is out of range"); | 2101 "srcOffset is out of range"); |
| 2100 return; | 2102 return; |
| 2101 } | 2103 } |
| 2102 if (src_length_override == 0) { | 2104 if (src_length_override == 0) { |
| 2103 src_length_override = data.View()->byteLength() - src_offset; | 2105 src_length_override = data.View()->byteLength() - src_offset; |
| 2104 } else if (src_length_override > data.View()->byteLength() - src_offset) { | 2106 } else if (src_length_override > data.View()->byteLength() - src_offset) { |
| 2105 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", | 2107 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", |
| 2106 "srcLengthOverride is out of range"); | 2108 "srcLengthOverride is out of range"); |
| 2107 return; | 2109 return; |
| 2108 } | 2110 } |
| 2109 ContextGL()->CompressedTexImage2D( | 2111 ContextGL()->CompressedTexImage2D( |
| 2110 target, level, internalformat, width, height, border, src_length_override, | 2112 target, level, internalformat, width, height, border, src_length_override, |
| 2111 static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); | 2113 static_cast<uint8_t*>(data.View()->BaseAddressMaybeShared()) + |
| 2114 src_offset); |
| 2112 } | 2115 } |
| 2113 | 2116 |
| 2114 void WebGL2RenderingContextBase::compressedTexImage2D(GLenum target, | 2117 void WebGL2RenderingContextBase::compressedTexImage2D(GLenum target, |
| 2115 GLint level, | 2118 GLint level, |
| 2116 GLenum internalformat, | 2119 GLenum internalformat, |
| 2117 GLsizei width, | 2120 GLsizei width, |
| 2118 GLsizei height, | 2121 GLsizei height, |
| 2119 GLint border, | 2122 GLint border, |
| 2120 GLsizei image_size, | 2123 GLsizei image_size, |
| 2121 GLintptr offset) { | 2124 GLintptr offset) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2132 } | 2135 } |
| 2133 | 2136 |
| 2134 void WebGL2RenderingContextBase::compressedTexSubImage2D( | 2137 void WebGL2RenderingContextBase::compressedTexSubImage2D( |
| 2135 GLenum target, | 2138 GLenum target, |
| 2136 GLint level, | 2139 GLint level, |
| 2137 GLint xoffset, | 2140 GLint xoffset, |
| 2138 GLint yoffset, | 2141 GLint yoffset, |
| 2139 GLsizei width, | 2142 GLsizei width, |
| 2140 GLsizei height, | 2143 GLsizei height, |
| 2141 GLenum format, | 2144 GLenum format, |
| 2142 NotShared<DOMArrayBufferView> data) { | 2145 MaybeShared<DOMArrayBufferView> data) { |
| 2143 if (isContextLost()) | 2146 if (isContextLost()) |
| 2144 return; | 2147 return; |
| 2145 if (bound_pixel_unpack_buffer_) { | 2148 if (bound_pixel_unpack_buffer_) { |
| 2146 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", | 2149 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", |
| 2147 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2150 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2148 return; | 2151 return; |
| 2149 } | 2152 } |
| 2150 WebGLRenderingContextBase::compressedTexSubImage2D( | 2153 WebGLRenderingContextBase::compressedTexSubImage2D( |
| 2151 target, level, xoffset, yoffset, width, height, format, data); | 2154 target, level, xoffset, yoffset, width, height, format, data); |
| 2152 } | 2155 } |
| 2153 | 2156 |
| 2154 void WebGL2RenderingContextBase::compressedTexSubImage2D( | 2157 void WebGL2RenderingContextBase::compressedTexSubImage2D( |
| 2155 GLenum target, | 2158 GLenum target, |
| 2156 GLint level, | 2159 GLint level, |
| 2157 GLint xoffset, | 2160 GLint xoffset, |
| 2158 GLint yoffset, | 2161 GLint yoffset, |
| 2159 GLsizei width, | 2162 GLsizei width, |
| 2160 GLsizei height, | 2163 GLsizei height, |
| 2161 GLenum format, | 2164 GLenum format, |
| 2162 NotShared<DOMArrayBufferView> data, | 2165 MaybeShared<DOMArrayBufferView> data, |
| 2163 GLuint src_offset, | 2166 GLuint src_offset, |
| 2164 GLuint src_length_override) { | 2167 GLuint src_length_override) { |
| 2165 if (isContextLost()) | 2168 if (isContextLost()) |
| 2166 return; | 2169 return; |
| 2167 if (bound_pixel_unpack_buffer_) { | 2170 if (bound_pixel_unpack_buffer_) { |
| 2168 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", | 2171 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", |
| 2169 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2172 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2170 return; | 2173 return; |
| 2171 } | 2174 } |
| 2172 if (!ValidateTexture2DBinding("compressedTexSubImage2D", target)) | 2175 if (!ValidateTexture2DBinding("compressedTexSubImage2D", target)) |
| 2173 return; | 2176 return; |
| 2174 if (!ValidateCompressedTexFormat("compressedTexSubImage2D", format)) | 2177 if (!ValidateCompressedTexFormat("compressedTexSubImage2D", format)) |
| 2175 return; | 2178 return; |
| 2176 if (src_offset > data.View()->byteLength()) { | 2179 if (src_offset > data.View()->byteLength()) { |
| 2177 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D", | 2180 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D", |
| 2178 "srcOffset is out of range"); | 2181 "srcOffset is out of range"); |
| 2179 return; | 2182 return; |
| 2180 } | 2183 } |
| 2181 if (src_length_override == 0) { | 2184 if (src_length_override == 0) { |
| 2182 src_length_override = data.View()->byteLength() - src_offset; | 2185 src_length_override = data.View()->byteLength() - src_offset; |
| 2183 } else if (src_length_override > data.View()->byteLength() - src_offset) { | 2186 } else if (src_length_override > data.View()->byteLength() - src_offset) { |
| 2184 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", | 2187 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", |
| 2185 "srcLengthOverride is out of range"); | 2188 "srcLengthOverride is out of range"); |
| 2186 return; | 2189 return; |
| 2187 } | 2190 } |
| 2188 ContextGL()->CompressedTexSubImage2D( | 2191 ContextGL()->CompressedTexSubImage2D( |
| 2189 target, level, xoffset, yoffset, width, height, format, | 2192 target, level, xoffset, yoffset, width, height, format, |
| 2190 src_length_override, | 2193 src_length_override, |
| 2191 static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); | 2194 static_cast<uint8_t*>(data.View()->BaseAddressMaybeShared()) + |
| 2195 src_offset); |
| 2192 } | 2196 } |
| 2193 | 2197 |
| 2194 void WebGL2RenderingContextBase::compressedTexSubImage2D(GLenum target, | 2198 void WebGL2RenderingContextBase::compressedTexSubImage2D(GLenum target, |
| 2195 GLint level, | 2199 GLint level, |
| 2196 GLint xoffset, | 2200 GLint xoffset, |
| 2197 GLint yoffset, | 2201 GLint yoffset, |
| 2198 GLsizei width, | 2202 GLsizei width, |
| 2199 GLsizei height, | 2203 GLsizei height, |
| 2200 GLenum format, | 2204 GLenum format, |
| 2201 GLsizei image_size, | 2205 GLsizei image_size, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2213 } | 2217 } |
| 2214 | 2218 |
| 2215 void WebGL2RenderingContextBase::compressedTexImage3D( | 2219 void WebGL2RenderingContextBase::compressedTexImage3D( |
| 2216 GLenum target, | 2220 GLenum target, |
| 2217 GLint level, | 2221 GLint level, |
| 2218 GLenum internalformat, | 2222 GLenum internalformat, |
| 2219 GLsizei width, | 2223 GLsizei width, |
| 2220 GLsizei height, | 2224 GLsizei height, |
| 2221 GLsizei depth, | 2225 GLsizei depth, |
| 2222 GLint border, | 2226 GLint border, |
| 2223 NotShared<DOMArrayBufferView> data, | 2227 MaybeShared<DOMArrayBufferView> data, |
| 2224 GLuint src_offset, | 2228 GLuint src_offset, |
| 2225 GLuint src_length_override) { | 2229 GLuint src_length_override) { |
| 2226 if (isContextLost()) | 2230 if (isContextLost()) |
| 2227 return; | 2231 return; |
| 2228 if (bound_pixel_unpack_buffer_) { | 2232 if (bound_pixel_unpack_buffer_) { |
| 2229 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage3D", | 2233 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage3D", |
| 2230 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2234 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2231 return; | 2235 return; |
| 2232 } | 2236 } |
| 2233 if (!ValidateTexture3DBinding("compressedTexImage3D", target)) | 2237 if (!ValidateTexture3DBinding("compressedTexImage3D", target)) |
| 2234 return; | 2238 return; |
| 2235 if (!ValidateCompressedTexFormat("compressedTexImage3D", internalformat)) | 2239 if (!ValidateCompressedTexFormat("compressedTexImage3D", internalformat)) |
| 2236 return; | 2240 return; |
| 2237 if (src_offset > data.View()->byteLength()) { | 2241 if (src_offset > data.View()->byteLength()) { |
| 2238 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", | 2242 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", |
| 2239 "srcOffset is out of range"); | 2243 "srcOffset is out of range"); |
| 2240 return; | 2244 return; |
| 2241 } | 2245 } |
| 2242 if (src_length_override == 0) { | 2246 if (src_length_override == 0) { |
| 2243 src_length_override = data.View()->byteLength() - src_offset; | 2247 src_length_override = data.View()->byteLength() - src_offset; |
| 2244 } else if (src_length_override > data.View()->byteLength() - src_offset) { | 2248 } else if (src_length_override > data.View()->byteLength() - src_offset) { |
| 2245 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", | 2249 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", |
| 2246 "srcLengthOverride is out of range"); | 2250 "srcLengthOverride is out of range"); |
| 2247 return; | 2251 return; |
| 2248 } | 2252 } |
| 2249 ContextGL()->CompressedTexImage3D( | 2253 ContextGL()->CompressedTexImage3D( |
| 2250 target, level, internalformat, width, height, depth, border, | 2254 target, level, internalformat, width, height, depth, border, |
| 2251 src_length_override, | 2255 src_length_override, |
| 2252 static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); | 2256 static_cast<uint8_t*>(data.View()->BaseAddressMaybeShared()) + |
| 2257 src_offset); |
| 2253 } | 2258 } |
| 2254 | 2259 |
| 2255 void WebGL2RenderingContextBase::compressedTexImage3D(GLenum target, | 2260 void WebGL2RenderingContextBase::compressedTexImage3D(GLenum target, |
| 2256 GLint level, | 2261 GLint level, |
| 2257 GLenum internalformat, | 2262 GLenum internalformat, |
| 2258 GLsizei width, | 2263 GLsizei width, |
| 2259 GLsizei height, | 2264 GLsizei height, |
| 2260 GLsizei depth, | 2265 GLsizei depth, |
| 2261 GLint border, | 2266 GLint border, |
| 2262 GLsizei image_size, | 2267 GLsizei image_size, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2276 void WebGL2RenderingContextBase::compressedTexSubImage3D( | 2281 void WebGL2RenderingContextBase::compressedTexSubImage3D( |
| 2277 GLenum target, | 2282 GLenum target, |
| 2278 GLint level, | 2283 GLint level, |
| 2279 GLint xoffset, | 2284 GLint xoffset, |
| 2280 GLint yoffset, | 2285 GLint yoffset, |
| 2281 GLint zoffset, | 2286 GLint zoffset, |
| 2282 GLsizei width, | 2287 GLsizei width, |
| 2283 GLsizei height, | 2288 GLsizei height, |
| 2284 GLsizei depth, | 2289 GLsizei depth, |
| 2285 GLenum format, | 2290 GLenum format, |
| 2286 NotShared<DOMArrayBufferView> data, | 2291 MaybeShared<DOMArrayBufferView> data, |
| 2287 GLuint src_offset, | 2292 GLuint src_offset, |
| 2288 GLuint src_length_override) { | 2293 GLuint src_length_override) { |
| 2289 if (isContextLost()) | 2294 if (isContextLost()) |
| 2290 return; | 2295 return; |
| 2291 if (bound_pixel_unpack_buffer_) { | 2296 if (bound_pixel_unpack_buffer_) { |
| 2292 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage3D", | 2297 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage3D", |
| 2293 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2298 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2294 return; | 2299 return; |
| 2295 } | 2300 } |
| 2296 if (!ValidateTexture3DBinding("compressedTexSubImage3D", target)) | 2301 if (!ValidateTexture3DBinding("compressedTexSubImage3D", target)) |
| 2297 return; | 2302 return; |
| 2298 if (!ValidateCompressedTexFormat("compressedTexSubImage3D", format)) | 2303 if (!ValidateCompressedTexFormat("compressedTexSubImage3D", format)) |
| 2299 return; | 2304 return; |
| 2300 if (src_offset > data.View()->byteLength()) { | 2305 if (src_offset > data.View()->byteLength()) { |
| 2301 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", | 2306 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", |
| 2302 "srcOffset is out of range"); | 2307 "srcOffset is out of range"); |
| 2303 return; | 2308 return; |
| 2304 } | 2309 } |
| 2305 if (src_length_override == 0) { | 2310 if (src_length_override == 0) { |
| 2306 src_length_override = data.View()->byteLength() - src_offset; | 2311 src_length_override = data.View()->byteLength() - src_offset; |
| 2307 } else if (src_length_override > data.View()->byteLength() - src_offset) { | 2312 } else if (src_length_override > data.View()->byteLength() - src_offset) { |
| 2308 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", | 2313 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", |
| 2309 "srcLengthOverride is out of range"); | 2314 "srcLengthOverride is out of range"); |
| 2310 return; | 2315 return; |
| 2311 } | 2316 } |
| 2312 ContextGL()->CompressedTexSubImage3D( | 2317 ContextGL()->CompressedTexSubImage3D( |
| 2313 target, level, xoffset, yoffset, zoffset, width, height, depth, format, | 2318 target, level, xoffset, yoffset, zoffset, width, height, depth, format, |
| 2314 src_length_override, | 2319 src_length_override, |
| 2315 static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); | 2320 static_cast<uint8_t*>(data.View()->BaseAddressMaybeShared()) + |
| 2321 src_offset); |
| 2316 } | 2322 } |
| 2317 | 2323 |
| 2318 void WebGL2RenderingContextBase::compressedTexSubImage3D(GLenum target, | 2324 void WebGL2RenderingContextBase::compressedTexSubImage3D(GLenum target, |
| 2319 GLint level, | 2325 GLint level, |
| 2320 GLint xoffset, | 2326 GLint xoffset, |
| 2321 GLint yoffset, | 2327 GLint yoffset, |
| 2322 GLint zoffset, | 2328 GLint zoffset, |
| 2323 GLsizei width, | 2329 GLsizei width, |
| 2324 GLsizei height, | 2330 GLsizei height, |
| 2325 GLsizei depth, | 2331 GLsizei depth, |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2788 | 2794 |
| 2789 ContextGL()->Uniform4uiv( | 2795 ContextGL()->Uniform4uiv( |
| 2790 location->Location(), | 2796 location->Location(), |
| 2791 (src_length ? src_length : (value.size() - src_offset)) >> 2, | 2797 (src_length ? src_length : (value.size() - src_offset)) >> 2, |
| 2792 value.Data() + src_offset); | 2798 value.Data() + src_offset); |
| 2793 } | 2799 } |
| 2794 | 2800 |
| 2795 void WebGL2RenderingContextBase::uniformMatrix2fv( | 2801 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 2796 const WebGLUniformLocation* location, | 2802 const WebGLUniformLocation* location, |
| 2797 GLboolean transpose, | 2803 GLboolean transpose, |
| 2798 NotShared<DOMFloat32Array> v, | 2804 MaybeShared<DOMFloat32Array> v, |
| 2799 GLuint src_offset, | 2805 GLuint src_offset, |
| 2800 GLuint src_length) { | 2806 GLuint src_length) { |
| 2801 if (isContextLost() || | 2807 if (isContextLost() || |
| 2802 !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, | 2808 !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, |
| 2803 v.View(), 4, src_offset, src_length)) | 2809 v.View(), 4, src_offset, src_length)) |
| 2804 return; | 2810 return; |
| 2805 ContextGL()->UniformMatrix2fv( | 2811 ContextGL()->UniformMatrix2fv( |
| 2806 location->Location(), | 2812 location->Location(), |
| 2807 (src_length ? src_length : (v.View()->length() - src_offset)) >> 2, | 2813 (src_length ? src_length : (v.View()->length() - src_offset)) >> 2, |
| 2808 transpose, v.View()->Data() + src_offset); | 2814 transpose, v.View()->DataMaybeShared() + src_offset); |
| 2809 } | 2815 } |
| 2810 | 2816 |
| 2811 void WebGL2RenderingContextBase::uniformMatrix2fv( | 2817 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 2812 const WebGLUniformLocation* location, | 2818 const WebGLUniformLocation* location, |
| 2813 GLboolean transpose, | 2819 GLboolean transpose, |
| 2814 Vector<GLfloat>& v, | 2820 Vector<GLfloat>& v, |
| 2815 GLuint src_offset, | 2821 GLuint src_offset, |
| 2816 GLuint src_length) { | 2822 GLuint src_length) { |
| 2817 if (isContextLost() || !ValidateUniformMatrixParameters( | 2823 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2818 "uniformMatrix2fv", location, transpose, v.Data(), | 2824 "uniformMatrix2fv", location, transpose, v.Data(), |
| 2819 v.size(), 4, src_offset, src_length)) | 2825 v.size(), 4, src_offset, src_length)) |
| 2820 return; | 2826 return; |
| 2821 ContextGL()->UniformMatrix2fv( | 2827 ContextGL()->UniformMatrix2fv( |
| 2822 location->Location(), | 2828 location->Location(), |
| 2823 (src_length ? src_length : (v.size() - src_offset)) >> 2, transpose, | 2829 (src_length ? src_length : (v.size() - src_offset)) >> 2, transpose, |
| 2824 v.Data() + src_offset); | 2830 v.Data() + src_offset); |
| 2825 } | 2831 } |
| 2826 | 2832 |
| 2827 void WebGL2RenderingContextBase::uniformMatrix3fv( | 2833 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 2828 const WebGLUniformLocation* location, | 2834 const WebGLUniformLocation* location, |
| 2829 GLboolean transpose, | 2835 GLboolean transpose, |
| 2830 NotShared<DOMFloat32Array> v, | 2836 MaybeShared<DOMFloat32Array> v, |
| 2831 GLuint src_offset, | 2837 GLuint src_offset, |
| 2832 GLuint src_length) { | 2838 GLuint src_length) { |
| 2833 if (isContextLost() || | 2839 if (isContextLost() || |
| 2834 !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, | 2840 !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, |
| 2835 v.View(), 9, src_offset, src_length)) | 2841 v.View(), 9, src_offset, src_length)) |
| 2836 return; | 2842 return; |
| 2837 ContextGL()->UniformMatrix3fv( | 2843 ContextGL()->UniformMatrix3fv( |
| 2838 location->Location(), | 2844 location->Location(), |
| 2839 (src_length ? src_length : (v.View()->length() - src_offset)) / 9, | 2845 (src_length ? src_length : (v.View()->length() - src_offset)) / 9, |
| 2840 transpose, v.View()->Data() + src_offset); | 2846 transpose, v.View()->DataMaybeShared() + src_offset); |
| 2841 } | 2847 } |
| 2842 | 2848 |
| 2843 void WebGL2RenderingContextBase::uniformMatrix3fv( | 2849 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 2844 const WebGLUniformLocation* location, | 2850 const WebGLUniformLocation* location, |
| 2845 GLboolean transpose, | 2851 GLboolean transpose, |
| 2846 Vector<GLfloat>& v, | 2852 Vector<GLfloat>& v, |
| 2847 GLuint src_offset, | 2853 GLuint src_offset, |
| 2848 GLuint src_length) { | 2854 GLuint src_length) { |
| 2849 if (isContextLost() || !ValidateUniformMatrixParameters( | 2855 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2850 "uniformMatrix3fv", location, transpose, v.Data(), | 2856 "uniformMatrix3fv", location, transpose, v.Data(), |
| 2851 v.size(), 9, src_offset, src_length)) | 2857 v.size(), 9, src_offset, src_length)) |
| 2852 return; | 2858 return; |
| 2853 ContextGL()->UniformMatrix3fv( | 2859 ContextGL()->UniformMatrix3fv( |
| 2854 location->Location(), | 2860 location->Location(), |
| 2855 (src_length ? src_length : (v.size() - src_offset)) / 9, transpose, | 2861 (src_length ? src_length : (v.size() - src_offset)) / 9, transpose, |
| 2856 v.Data() + src_offset); | 2862 v.Data() + src_offset); |
| 2857 } | 2863 } |
| 2858 | 2864 |
| 2859 void WebGL2RenderingContextBase::uniformMatrix4fv( | 2865 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 2860 const WebGLUniformLocation* location, | 2866 const WebGLUniformLocation* location, |
| 2861 GLboolean transpose, | 2867 GLboolean transpose, |
| 2862 NotShared<DOMFloat32Array> v, | 2868 MaybeShared<DOMFloat32Array> v, |
| 2863 GLuint src_offset, | 2869 GLuint src_offset, |
| 2864 GLuint src_length) { | 2870 GLuint src_length) { |
| 2865 if (isContextLost() || | 2871 if (isContextLost() || |
| 2866 !ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose, | 2872 !ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose, |
| 2867 v.View(), 16, src_offset, src_length)) | 2873 v.View(), 16, src_offset, src_length)) |
| 2868 return; | 2874 return; |
| 2869 ContextGL()->UniformMatrix4fv( | 2875 ContextGL()->UniformMatrix4fv( |
| 2870 location->Location(), | 2876 location->Location(), |
| 2871 (src_length ? src_length : (v.View()->length() - src_offset)) >> 4, | 2877 (src_length ? src_length : (v.View()->length() - src_offset)) >> 4, |
| 2872 transpose, v.View()->Data() + src_offset); | 2878 transpose, v.View()->DataMaybeShared() + src_offset); |
| 2873 } | 2879 } |
| 2874 | 2880 |
| 2875 void WebGL2RenderingContextBase::uniformMatrix4fv( | 2881 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 2876 const WebGLUniformLocation* location, | 2882 const WebGLUniformLocation* location, |
| 2877 GLboolean transpose, | 2883 GLboolean transpose, |
| 2878 Vector<GLfloat>& v, | 2884 Vector<GLfloat>& v, |
| 2879 GLuint src_offset, | 2885 GLuint src_offset, |
| 2880 GLuint src_length) { | 2886 GLuint src_length) { |
| 2881 if (isContextLost() || !ValidateUniformMatrixParameters( | 2887 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2882 "uniformMatrix4fv", location, transpose, v.Data(), | 2888 "uniformMatrix4fv", location, transpose, v.Data(), |
| 2883 v.size(), 16, src_offset, src_length)) | 2889 v.size(), 16, src_offset, src_length)) |
| 2884 return; | 2890 return; |
| 2885 ContextGL()->UniformMatrix4fv( | 2891 ContextGL()->UniformMatrix4fv( |
| 2886 location->Location(), | 2892 location->Location(), |
| 2887 (src_length ? src_length : (v.size() - src_offset)) >> 4, transpose, | 2893 (src_length ? src_length : (v.size() - src_offset)) >> 4, transpose, |
| 2888 v.Data() + src_offset); | 2894 v.Data() + src_offset); |
| 2889 } | 2895 } |
| 2890 | 2896 |
| 2891 void WebGL2RenderingContextBase::uniformMatrix2x3fv( | 2897 void WebGL2RenderingContextBase::uniformMatrix2x3fv( |
| 2892 const WebGLUniformLocation* location, | 2898 const WebGLUniformLocation* location, |
| 2893 GLboolean transpose, | 2899 GLboolean transpose, |
| 2894 NotShared<DOMFloat32Array> value, | 2900 MaybeShared<DOMFloat32Array> value, |
| 2895 GLuint src_offset, | 2901 GLuint src_offset, |
| 2896 GLuint src_length) { | 2902 GLuint src_length) { |
| 2897 if (isContextLost() || !ValidateUniformMatrixParameters( | 2903 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2898 "uniformMatrix2x3fv", location, transpose, | 2904 "uniformMatrix2x3fv", location, transpose, |
| 2899 value.View(), 6, src_offset, src_length)) | 2905 value.View(), 6, src_offset, src_length)) |
| 2900 return; | 2906 return; |
| 2901 ContextGL()->UniformMatrix2x3fv( | 2907 ContextGL()->UniformMatrix2x3fv( |
| 2902 location->Location(), | 2908 location->Location(), |
| 2903 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, | 2909 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, |
| 2904 transpose, value.View()->Data() + src_offset); | 2910 transpose, value.View()->DataMaybeShared() + src_offset); |
| 2905 } | 2911 } |
| 2906 | 2912 |
| 2907 void WebGL2RenderingContextBase::uniformMatrix2x3fv( | 2913 void WebGL2RenderingContextBase::uniformMatrix2x3fv( |
| 2908 const WebGLUniformLocation* location, | 2914 const WebGLUniformLocation* location, |
| 2909 GLboolean transpose, | 2915 GLboolean transpose, |
| 2910 Vector<GLfloat>& value, | 2916 Vector<GLfloat>& value, |
| 2911 GLuint src_offset, | 2917 GLuint src_offset, |
| 2912 GLuint src_length) { | 2918 GLuint src_length) { |
| 2913 if (isContextLost() || | 2919 if (isContextLost() || |
| 2914 !ValidateUniformMatrixParameters("uniformMatrix2x3fv", location, | 2920 !ValidateUniformMatrixParameters("uniformMatrix2x3fv", location, |
| 2915 transpose, value.Data(), value.size(), 6, | 2921 transpose, value.Data(), value.size(), 6, |
| 2916 src_offset, src_length)) | 2922 src_offset, src_length)) |
| 2917 return; | 2923 return; |
| 2918 ContextGL()->UniformMatrix2x3fv( | 2924 ContextGL()->UniformMatrix2x3fv( |
| 2919 location->Location(), | 2925 location->Location(), |
| 2920 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, | 2926 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, |
| 2921 value.Data() + src_offset); | 2927 value.Data() + src_offset); |
| 2922 } | 2928 } |
| 2923 | 2929 |
| 2924 void WebGL2RenderingContextBase::uniformMatrix3x2fv( | 2930 void WebGL2RenderingContextBase::uniformMatrix3x2fv( |
| 2925 const WebGLUniformLocation* location, | 2931 const WebGLUniformLocation* location, |
| 2926 GLboolean transpose, | 2932 GLboolean transpose, |
| 2927 NotShared<DOMFloat32Array> value, | 2933 MaybeShared<DOMFloat32Array> value, |
| 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 "uniformMatrix3x2fv", location, transpose, | 2937 "uniformMatrix3x2fv", location, transpose, |
| 2932 value.View(), 6, src_offset, src_length)) | 2938 value.View(), 6, src_offset, src_length)) |
| 2933 return; | 2939 return; |
| 2934 ContextGL()->UniformMatrix3x2fv( | 2940 ContextGL()->UniformMatrix3x2fv( |
| 2935 location->Location(), | 2941 location->Location(), |
| 2936 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, | 2942 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, |
| 2937 transpose, value.View()->Data() + src_offset); | 2943 transpose, value.View()->DataMaybeShared() + src_offset); |
| 2938 } | 2944 } |
| 2939 | 2945 |
| 2940 void WebGL2RenderingContextBase::uniformMatrix3x2fv( | 2946 void WebGL2RenderingContextBase::uniformMatrix3x2fv( |
| 2941 const WebGLUniformLocation* location, | 2947 const WebGLUniformLocation* location, |
| 2942 GLboolean transpose, | 2948 GLboolean transpose, |
| 2943 Vector<GLfloat>& value, | 2949 Vector<GLfloat>& value, |
| 2944 GLuint src_offset, | 2950 GLuint src_offset, |
| 2945 GLuint src_length) { | 2951 GLuint src_length) { |
| 2946 if (isContextLost() || | 2952 if (isContextLost() || |
| 2947 !ValidateUniformMatrixParameters("uniformMatrix3x2fv", location, | 2953 !ValidateUniformMatrixParameters("uniformMatrix3x2fv", location, |
| 2948 transpose, value.Data(), value.size(), 6, | 2954 transpose, value.Data(), value.size(), 6, |
| 2949 src_offset, src_length)) | 2955 src_offset, src_length)) |
| 2950 return; | 2956 return; |
| 2951 ContextGL()->UniformMatrix3x2fv( | 2957 ContextGL()->UniformMatrix3x2fv( |
| 2952 location->Location(), | 2958 location->Location(), |
| 2953 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, | 2959 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, |
| 2954 value.Data() + src_offset); | 2960 value.Data() + src_offset); |
| 2955 } | 2961 } |
| 2956 | 2962 |
| 2957 void WebGL2RenderingContextBase::uniformMatrix2x4fv( | 2963 void WebGL2RenderingContextBase::uniformMatrix2x4fv( |
| 2958 const WebGLUniformLocation* location, | 2964 const WebGLUniformLocation* location, |
| 2959 GLboolean transpose, | 2965 GLboolean transpose, |
| 2960 NotShared<DOMFloat32Array> value, | 2966 MaybeShared<DOMFloat32Array> value, |
| 2961 GLuint src_offset, | 2967 GLuint src_offset, |
| 2962 GLuint src_length) { | 2968 GLuint src_length) { |
| 2963 if (isContextLost() || !ValidateUniformMatrixParameters( | 2969 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2964 "uniformMatrix2x4fv", location, transpose, | 2970 "uniformMatrix2x4fv", location, transpose, |
| 2965 value.View(), 8, src_offset, src_length)) | 2971 value.View(), 8, src_offset, src_length)) |
| 2966 return; | 2972 return; |
| 2967 ContextGL()->UniformMatrix2x4fv( | 2973 ContextGL()->UniformMatrix2x4fv( |
| 2968 location->Location(), | 2974 location->Location(), |
| 2969 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, | 2975 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, |
| 2970 transpose, value.View()->Data() + src_offset); | 2976 transpose, value.View()->DataMaybeShared() + src_offset); |
| 2971 } | 2977 } |
| 2972 | 2978 |
| 2973 void WebGL2RenderingContextBase::uniformMatrix2x4fv( | 2979 void WebGL2RenderingContextBase::uniformMatrix2x4fv( |
| 2974 const WebGLUniformLocation* location, | 2980 const WebGLUniformLocation* location, |
| 2975 GLboolean transpose, | 2981 GLboolean transpose, |
| 2976 Vector<GLfloat>& value, | 2982 Vector<GLfloat>& value, |
| 2977 GLuint src_offset, | 2983 GLuint src_offset, |
| 2978 GLuint src_length) { | 2984 GLuint src_length) { |
| 2979 if (isContextLost() || | 2985 if (isContextLost() || |
| 2980 !ValidateUniformMatrixParameters("uniformMatrix2x4fv", location, | 2986 !ValidateUniformMatrixParameters("uniformMatrix2x4fv", location, |
| 2981 transpose, value.Data(), value.size(), 8, | 2987 transpose, value.Data(), value.size(), 8, |
| 2982 src_offset, src_length)) | 2988 src_offset, src_length)) |
| 2983 return; | 2989 return; |
| 2984 ContextGL()->UniformMatrix2x4fv( | 2990 ContextGL()->UniformMatrix2x4fv( |
| 2985 location->Location(), | 2991 location->Location(), |
| 2986 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, | 2992 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, |
| 2987 value.Data() + src_offset); | 2993 value.Data() + src_offset); |
| 2988 } | 2994 } |
| 2989 | 2995 |
| 2990 void WebGL2RenderingContextBase::uniformMatrix4x2fv( | 2996 void WebGL2RenderingContextBase::uniformMatrix4x2fv( |
| 2991 const WebGLUniformLocation* location, | 2997 const WebGLUniformLocation* location, |
| 2992 GLboolean transpose, | 2998 GLboolean transpose, |
| 2993 NotShared<DOMFloat32Array> value, | 2999 MaybeShared<DOMFloat32Array> value, |
| 2994 GLuint src_offset, | 3000 GLuint src_offset, |
| 2995 GLuint src_length) { | 3001 GLuint src_length) { |
| 2996 if (isContextLost() || !ValidateUniformMatrixParameters( | 3002 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 2997 "uniformMatrix4x2fv", location, transpose, | 3003 "uniformMatrix4x2fv", location, transpose, |
| 2998 value.View(), 8, src_offset, src_length)) | 3004 value.View(), 8, src_offset, src_length)) |
| 2999 return; | 3005 return; |
| 3000 ContextGL()->UniformMatrix4x2fv( | 3006 ContextGL()->UniformMatrix4x2fv( |
| 3001 location->Location(), | 3007 location->Location(), |
| 3002 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, | 3008 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, |
| 3003 transpose, value.View()->Data() + src_offset); | 3009 transpose, value.View()->DataMaybeShared() + src_offset); |
| 3004 } | 3010 } |
| 3005 | 3011 |
| 3006 void WebGL2RenderingContextBase::uniformMatrix4x2fv( | 3012 void WebGL2RenderingContextBase::uniformMatrix4x2fv( |
| 3007 const WebGLUniformLocation* location, | 3013 const WebGLUniformLocation* location, |
| 3008 GLboolean transpose, | 3014 GLboolean transpose, |
| 3009 Vector<GLfloat>& value, | 3015 Vector<GLfloat>& value, |
| 3010 GLuint src_offset, | 3016 GLuint src_offset, |
| 3011 GLuint src_length) { | 3017 GLuint src_length) { |
| 3012 if (isContextLost() || | 3018 if (isContextLost() || |
| 3013 !ValidateUniformMatrixParameters("uniformMatrix4x2fv", location, | 3019 !ValidateUniformMatrixParameters("uniformMatrix4x2fv", location, |
| 3014 transpose, value.Data(), value.size(), 8, | 3020 transpose, value.Data(), value.size(), 8, |
| 3015 src_offset, src_length)) | 3021 src_offset, src_length)) |
| 3016 return; | 3022 return; |
| 3017 ContextGL()->UniformMatrix4x2fv( | 3023 ContextGL()->UniformMatrix4x2fv( |
| 3018 location->Location(), | 3024 location->Location(), |
| 3019 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, | 3025 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, |
| 3020 value.Data() + src_offset); | 3026 value.Data() + src_offset); |
| 3021 } | 3027 } |
| 3022 | 3028 |
| 3023 void WebGL2RenderingContextBase::uniformMatrix3x4fv( | 3029 void WebGL2RenderingContextBase::uniformMatrix3x4fv( |
| 3024 const WebGLUniformLocation* location, | 3030 const WebGLUniformLocation* location, |
| 3025 GLboolean transpose, | 3031 GLboolean transpose, |
| 3026 NotShared<DOMFloat32Array> value, | 3032 MaybeShared<DOMFloat32Array> value, |
| 3027 GLuint src_offset, | 3033 GLuint src_offset, |
| 3028 GLuint src_length) { | 3034 GLuint src_length) { |
| 3029 if (isContextLost() || !ValidateUniformMatrixParameters( | 3035 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 3030 "uniformMatrix3x4fv", location, transpose, | 3036 "uniformMatrix3x4fv", location, transpose, |
| 3031 value.View(), 12, src_offset, src_length)) | 3037 value.View(), 12, src_offset, src_length)) |
| 3032 return; | 3038 return; |
| 3033 ContextGL()->UniformMatrix3x4fv( | 3039 ContextGL()->UniformMatrix3x4fv( |
| 3034 location->Location(), | 3040 location->Location(), |
| 3035 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, | 3041 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, |
| 3036 transpose, value.View()->Data() + src_offset); | 3042 transpose, value.View()->DataMaybeShared() + src_offset); |
| 3037 } | 3043 } |
| 3038 | 3044 |
| 3039 void WebGL2RenderingContextBase::uniformMatrix3x4fv( | 3045 void WebGL2RenderingContextBase::uniformMatrix3x4fv( |
| 3040 const WebGLUniformLocation* location, | 3046 const WebGLUniformLocation* location, |
| 3041 GLboolean transpose, | 3047 GLboolean transpose, |
| 3042 Vector<GLfloat>& value, | 3048 Vector<GLfloat>& value, |
| 3043 GLuint src_offset, | 3049 GLuint src_offset, |
| 3044 GLuint src_length) { | 3050 GLuint src_length) { |
| 3045 if (isContextLost() || | 3051 if (isContextLost() || |
| 3046 !ValidateUniformMatrixParameters("uniformMatrix3x4fv", location, | 3052 !ValidateUniformMatrixParameters("uniformMatrix3x4fv", location, |
| 3047 transpose, value.Data(), value.size(), | 3053 transpose, value.Data(), value.size(), |
| 3048 12, src_offset, src_length)) | 3054 12, src_offset, src_length)) |
| 3049 return; | 3055 return; |
| 3050 ContextGL()->UniformMatrix3x4fv( | 3056 ContextGL()->UniformMatrix3x4fv( |
| 3051 location->Location(), | 3057 location->Location(), |
| 3052 (src_length ? src_length : (value.size() - src_offset)) / 12, transpose, | 3058 (src_length ? src_length : (value.size() - src_offset)) / 12, transpose, |
| 3053 value.Data() + src_offset); | 3059 value.Data() + src_offset); |
| 3054 } | 3060 } |
| 3055 | 3061 |
| 3056 void WebGL2RenderingContextBase::uniformMatrix4x3fv( | 3062 void WebGL2RenderingContextBase::uniformMatrix4x3fv( |
| 3057 const WebGLUniformLocation* location, | 3063 const WebGLUniformLocation* location, |
| 3058 GLboolean transpose, | 3064 GLboolean transpose, |
| 3059 NotShared<DOMFloat32Array> value, | 3065 MaybeShared<DOMFloat32Array> value, |
| 3060 GLuint src_offset, | 3066 GLuint src_offset, |
| 3061 GLuint src_length) { | 3067 GLuint src_length) { |
| 3062 if (isContextLost() || !ValidateUniformMatrixParameters( | 3068 if (isContextLost() || !ValidateUniformMatrixParameters( |
| 3063 "uniformMatrix4x3fv", location, transpose, | 3069 "uniformMatrix4x3fv", location, transpose, |
| 3064 value.View(), 12, src_offset, src_length)) | 3070 value.View(), 12, src_offset, src_length)) |
| 3065 return; | 3071 return; |
| 3066 ContextGL()->UniformMatrix4x3fv( | 3072 ContextGL()->UniformMatrix4x3fv( |
| 3067 location->Location(), | 3073 location->Location(), |
| 3068 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, | 3074 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, |
| 3069 transpose, value.View()->Data() + src_offset); | 3075 transpose, value.View()->DataMaybeShared() + src_offset); |
| 3070 } | 3076 } |
| 3071 | 3077 |
| 3072 void WebGL2RenderingContextBase::uniformMatrix4x3fv( | 3078 void WebGL2RenderingContextBase::uniformMatrix4x3fv( |
| 3073 const WebGLUniformLocation* location, | 3079 const WebGLUniformLocation* location, |
| 3074 GLboolean transpose, | 3080 GLboolean transpose, |
| 3075 Vector<GLfloat>& value, | 3081 Vector<GLfloat>& value, |
| 3076 GLuint src_offset, | 3082 GLuint src_offset, |
| 3077 GLuint src_length) { | 3083 GLuint src_length) { |
| 3078 if (isContextLost() || | 3084 if (isContextLost() || |
| 3079 !ValidateUniformMatrixParameters("uniformMatrix4x3fv", location, | 3085 !ValidateUniformMatrixParameters("uniformMatrix4x3fv", location, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3178 | 3184 |
| 3179 void WebGL2RenderingContextBase::uniform4iv( | 3185 void WebGL2RenderingContextBase::uniform4iv( |
| 3180 const WebGLUniformLocation* location, | 3186 const WebGLUniformLocation* location, |
| 3181 Vector<GLint>& v) { | 3187 Vector<GLint>& v) { |
| 3182 WebGLRenderingContextBase::uniform4iv(location, v); | 3188 WebGLRenderingContextBase::uniform4iv(location, v); |
| 3183 } | 3189 } |
| 3184 | 3190 |
| 3185 void WebGL2RenderingContextBase::uniformMatrix2fv( | 3191 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 3186 const WebGLUniformLocation* location, | 3192 const WebGLUniformLocation* location, |
| 3187 GLboolean transpose, | 3193 GLboolean transpose, |
| 3188 NotShared<DOMFloat32Array> v) { | 3194 MaybeShared<DOMFloat32Array> v) { |
| 3189 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); | 3195 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); |
| 3190 } | 3196 } |
| 3191 | 3197 |
| 3192 void WebGL2RenderingContextBase::uniformMatrix2fv( | 3198 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 3193 const WebGLUniformLocation* location, | 3199 const WebGLUniformLocation* location, |
| 3194 GLboolean transpose, | 3200 GLboolean transpose, |
| 3195 Vector<GLfloat>& v) { | 3201 Vector<GLfloat>& v) { |
| 3196 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); | 3202 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); |
| 3197 } | 3203 } |
| 3198 | 3204 |
| 3199 void WebGL2RenderingContextBase::uniformMatrix3fv( | 3205 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 3200 const WebGLUniformLocation* location, | 3206 const WebGLUniformLocation* location, |
| 3201 GLboolean transpose, | 3207 GLboolean transpose, |
| 3202 NotShared<DOMFloat32Array> v) { | 3208 MaybeShared<DOMFloat32Array> v) { |
| 3203 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); | 3209 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); |
| 3204 } | 3210 } |
| 3205 | 3211 |
| 3206 void WebGL2RenderingContextBase::uniformMatrix3fv( | 3212 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 3207 const WebGLUniformLocation* location, | 3213 const WebGLUniformLocation* location, |
| 3208 GLboolean transpose, | 3214 GLboolean transpose, |
| 3209 Vector<GLfloat>& v) { | 3215 Vector<GLfloat>& v) { |
| 3210 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); | 3216 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); |
| 3211 } | 3217 } |
| 3212 | 3218 |
| 3213 void WebGL2RenderingContextBase::uniformMatrix4fv( | 3219 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 3214 const WebGLUniformLocation* location, | 3220 const WebGLUniformLocation* location, |
| 3215 GLboolean transpose, | 3221 GLboolean transpose, |
| 3216 NotShared<DOMFloat32Array> v) { | 3222 MaybeShared<DOMFloat32Array> v) { |
| 3217 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); | 3223 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); |
| 3218 } | 3224 } |
| 3219 | 3225 |
| 3220 void WebGL2RenderingContextBase::uniformMatrix4fv( | 3226 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 3221 const WebGLUniformLocation* location, | 3227 const WebGLUniformLocation* location, |
| 3222 GLboolean transpose, | 3228 GLboolean transpose, |
| 3223 Vector<GLfloat>& v) { | 3229 Vector<GLfloat>& v) { |
| 3224 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); | 3230 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); |
| 3225 } | 3231 } |
| 3226 | 3232 |
| 3227 void WebGL2RenderingContextBase::vertexAttribI4i(GLuint index, | 3233 void WebGL2RenderingContextBase::vertexAttribI4i(GLuint index, |
| 3228 GLint x, | 3234 GLint x, |
| 3229 GLint y, | 3235 GLint y, |
| 3230 GLint z, | 3236 GLint z, |
| 3231 GLint w) { | 3237 GLint w) { |
| 3232 if (isContextLost()) | 3238 if (isContextLost()) |
| 3233 return; | 3239 return; |
| 3234 ContextGL()->VertexAttribI4i(index, x, y, z, w); | 3240 ContextGL()->VertexAttribI4i(index, x, y, z, w); |
| 3235 SetVertexAttribType(index, kInt32ArrayType); | 3241 SetVertexAttribType(index, kInt32ArrayType); |
| 3236 } | 3242 } |
| 3237 | 3243 |
| 3238 void WebGL2RenderingContextBase::vertexAttribI4iv( | 3244 void WebGL2RenderingContextBase::vertexAttribI4iv( |
| 3239 GLuint index, | 3245 GLuint index, |
| 3240 NotShared<const DOMInt32Array> v) { | 3246 MaybeShared<const DOMInt32Array> v) { |
| 3241 if (isContextLost()) | 3247 if (isContextLost()) |
| 3242 return; | 3248 return; |
| 3243 if (!v.View() || v.View()->length() < 4) { | 3249 if (!v.View() || v.View()->length() < 4) { |
| 3244 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); | 3250 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); |
| 3245 return; | 3251 return; |
| 3246 } | 3252 } |
| 3247 ContextGL()->VertexAttribI4iv(index, v.View()->Data()); | 3253 ContextGL()->VertexAttribI4iv(index, v.View()->DataMaybeShared()); |
| 3248 SetVertexAttribType(index, kInt32ArrayType); | 3254 SetVertexAttribType(index, kInt32ArrayType); |
| 3249 } | 3255 } |
| 3250 | 3256 |
| 3251 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, | 3257 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, |
| 3252 const Vector<GLint>& v) { | 3258 const Vector<GLint>& v) { |
| 3253 if (isContextLost()) | 3259 if (isContextLost()) |
| 3254 return; | 3260 return; |
| 3255 if (v.size() < 4) { | 3261 if (v.size() < 4) { |
| 3256 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); | 3262 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); |
| 3257 return; | 3263 return; |
| 3258 } | 3264 } |
| 3259 ContextGL()->VertexAttribI4iv(index, v.Data()); | 3265 ContextGL()->VertexAttribI4iv(index, v.Data()); |
| 3260 SetVertexAttribType(index, kInt32ArrayType); | 3266 SetVertexAttribType(index, kInt32ArrayType); |
| 3261 } | 3267 } |
| 3262 | 3268 |
| 3263 void WebGL2RenderingContextBase::vertexAttribI4ui(GLuint index, | 3269 void WebGL2RenderingContextBase::vertexAttribI4ui(GLuint index, |
| 3264 GLuint x, | 3270 GLuint x, |
| 3265 GLuint y, | 3271 GLuint y, |
| 3266 GLuint z, | 3272 GLuint z, |
| 3267 GLuint w) { | 3273 GLuint w) { |
| 3268 if (isContextLost()) | 3274 if (isContextLost()) |
| 3269 return; | 3275 return; |
| 3270 ContextGL()->VertexAttribI4ui(index, x, y, z, w); | 3276 ContextGL()->VertexAttribI4ui(index, x, y, z, w); |
| 3271 SetVertexAttribType(index, kUint32ArrayType); | 3277 SetVertexAttribType(index, kUint32ArrayType); |
| 3272 } | 3278 } |
| 3273 | 3279 |
| 3274 void WebGL2RenderingContextBase::vertexAttribI4uiv( | 3280 void WebGL2RenderingContextBase::vertexAttribI4uiv( |
| 3275 GLuint index, | 3281 GLuint index, |
| 3276 NotShared<const DOMUint32Array> v) { | 3282 MaybeShared<const DOMUint32Array> v) { |
| 3277 if (isContextLost()) | 3283 if (isContextLost()) |
| 3278 return; | 3284 return; |
| 3279 if (!v.View() || v.View()->length() < 4) { | 3285 if (!v.View() || v.View()->length() < 4) { |
| 3280 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); | 3286 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); |
| 3281 return; | 3287 return; |
| 3282 } | 3288 } |
| 3283 ContextGL()->VertexAttribI4uiv(index, v.View()->Data()); | 3289 ContextGL()->VertexAttribI4uiv(index, v.View()->DataMaybeShared()); |
| 3284 SetVertexAttribType(index, kUint32ArrayType); | 3290 SetVertexAttribType(index, kUint32ArrayType); |
| 3285 } | 3291 } |
| 3286 | 3292 |
| 3287 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, | 3293 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, |
| 3288 const Vector<GLuint>& v) { | 3294 const Vector<GLuint>& v) { |
| 3289 if (isContextLost()) | 3295 if (isContextLost()) |
| 3290 return; | 3296 return; |
| 3291 if (v.size() < 4) { | 3297 if (v.size() < 4) { |
| 3292 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); | 3298 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); |
| 3293 return; | 3299 return; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3489 | 3495 |
| 3490 WebGLTexture* WebGL2RenderingContextBase::ValidateTexImageBinding( | 3496 WebGLTexture* WebGL2RenderingContextBase::ValidateTexImageBinding( |
| 3491 const char* func_name, | 3497 const char* func_name, |
| 3492 TexImageFunctionID function_id, | 3498 TexImageFunctionID function_id, |
| 3493 GLenum target) { | 3499 GLenum target) { |
| 3494 if (function_id == kTexImage3D || function_id == kTexSubImage3D) | 3500 if (function_id == kTexImage3D || function_id == kTexSubImage3D) |
| 3495 return ValidateTexture3DBinding(func_name, target); | 3501 return ValidateTexture3DBinding(func_name, target); |
| 3496 return ValidateTexture2DBinding(func_name, target); | 3502 return ValidateTexture2DBinding(func_name, target); |
| 3497 } | 3503 } |
| 3498 | 3504 |
| 3499 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, | 3505 void WebGL2RenderingContextBase::clearBufferiv( |
| 3500 GLint drawbuffer, | 3506 GLenum buffer, |
| 3501 NotShared<DOMInt32Array> value) { | 3507 GLint drawbuffer, |
| 3508 MaybeShared<DOMInt32Array> value) { |
| 3502 if (isContextLost() || | 3509 if (isContextLost() || |
| 3503 !ValidateClearBuffer("clearBufferiv", buffer, value.View()->length())) | 3510 !ValidateClearBuffer("clearBufferiv", buffer, value.View()->length())) |
| 3504 return; | 3511 return; |
| 3505 | 3512 |
| 3506 ContextGL()->ClearBufferiv(buffer, drawbuffer, value.View()->Data()); | 3513 ContextGL()->ClearBufferiv(buffer, drawbuffer, |
| 3514 value.View()->DataMaybeShared()); |
| 3507 } | 3515 } |
| 3508 | 3516 |
| 3509 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, | 3517 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, |
| 3510 GLint drawbuffer, | 3518 GLint drawbuffer, |
| 3511 const Vector<GLint>& value) { | 3519 const Vector<GLint>& value) { |
| 3512 if (isContextLost() || | 3520 if (isContextLost() || |
| 3513 !ValidateClearBuffer("clearBufferiv", buffer, value.size())) | 3521 !ValidateClearBuffer("clearBufferiv", buffer, value.size())) |
| 3514 return; | 3522 return; |
| 3515 | 3523 |
| 3516 ContextGL()->ClearBufferiv(buffer, drawbuffer, value.Data()); | 3524 ContextGL()->ClearBufferiv(buffer, drawbuffer, value.Data()); |
| 3517 } | 3525 } |
| 3518 | 3526 |
| 3519 void WebGL2RenderingContextBase::clearBufferuiv( | 3527 void WebGL2RenderingContextBase::clearBufferuiv( |
| 3520 GLenum buffer, | 3528 GLenum buffer, |
| 3521 GLint drawbuffer, | 3529 GLint drawbuffer, |
| 3522 NotShared<DOMUint32Array> value) { | 3530 MaybeShared<DOMUint32Array> value) { |
| 3523 if (isContextLost() || | 3531 if (isContextLost() || |
| 3524 !ValidateClearBuffer("clearBufferuiv", buffer, value.View()->length())) | 3532 !ValidateClearBuffer("clearBufferuiv", buffer, value.View()->length())) |
| 3525 return; | 3533 return; |
| 3526 | 3534 |
| 3527 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.View()->Data()); | 3535 ContextGL()->ClearBufferuiv(buffer, drawbuffer, |
| 3536 value.View()->DataMaybeShared()); |
| 3528 } | 3537 } |
| 3529 | 3538 |
| 3530 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, | 3539 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, |
| 3531 GLint drawbuffer, | 3540 GLint drawbuffer, |
| 3532 const Vector<GLuint>& value) { | 3541 const Vector<GLuint>& value) { |
| 3533 if (isContextLost() || | 3542 if (isContextLost() || |
| 3534 !ValidateClearBuffer("clearBufferuiv", buffer, value.size())) | 3543 !ValidateClearBuffer("clearBufferuiv", buffer, value.size())) |
| 3535 return; | 3544 return; |
| 3536 | 3545 |
| 3537 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.Data()); | 3546 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.Data()); |
| 3538 } | 3547 } |
| 3539 | 3548 |
| 3540 void WebGL2RenderingContextBase::clearBufferfv( | 3549 void WebGL2RenderingContextBase::clearBufferfv( |
| 3541 GLenum buffer, | 3550 GLenum buffer, |
| 3542 GLint drawbuffer, | 3551 GLint drawbuffer, |
| 3543 NotShared<DOMFloat32Array> value) { | 3552 MaybeShared<DOMFloat32Array> value) { |
| 3544 if (isContextLost() || | 3553 if (isContextLost() || |
| 3545 !ValidateClearBuffer("clearBufferfv", buffer, value.View()->length())) | 3554 !ValidateClearBuffer("clearBufferfv", buffer, value.View()->length())) |
| 3546 return; | 3555 return; |
| 3547 | 3556 |
| 3548 ContextGL()->ClearBufferfv(buffer, drawbuffer, value.View()->Data()); | 3557 ContextGL()->ClearBufferfv(buffer, drawbuffer, |
| 3558 value.View()->DataMaybeShared()); |
| 3549 } | 3559 } |
| 3550 | 3560 |
| 3551 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, | 3561 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, |
| 3552 GLint drawbuffer, | 3562 GLint drawbuffer, |
| 3553 const Vector<GLfloat>& value) { | 3563 const Vector<GLfloat>& value) { |
| 3554 if (isContextLost() || | 3564 if (isContextLost() || |
| 3555 !ValidateClearBuffer("clearBufferfv", buffer, value.size())) | 3565 !ValidateClearBuffer("clearBufferfv", buffer, value.size())) |
| 3556 return; | 3566 return; |
| 3557 | 3567 |
| 3558 ContextGL()->ClearBufferfv(buffer, drawbuffer, value.Data()); | 3568 ContextGL()->ClearBufferfv(buffer, drawbuffer, value.Data()); |
| (...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5690 | 5700 |
| 5691 void WebGL2RenderingContextBase:: | 5701 void WebGL2RenderingContextBase:: |
| 5692 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 5702 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
| 5693 if (!ContextGL()) | 5703 if (!ContextGL()) |
| 5694 return; | 5704 return; |
| 5695 ContextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 5705 ContextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
| 5696 ObjectOrZero(bound_pixel_unpack_buffer_.Get())); | 5706 ObjectOrZero(bound_pixel_unpack_buffer_.Get())); |
| 5697 } | 5707 } |
| 5698 | 5708 |
| 5699 } // namespace blink | 5709 } // namespace blink |
| OLD | NEW |