OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/webgl/WebGL2RenderingContextBase.h" | 5 #include "modules/webgl/WebGL2RenderingContextBase.h" |
6 | 6 |
7 #include "bindings/modules/v8/WebGLAny.h" | 7 #include "bindings/modules/v8/WebGLAny.h" |
8 #include "core/frame/ImageBitmap.h" | 8 #include "core/frame/ImageBitmap.h" |
9 #include "core/html/HTMLCanvasElement.h" | 9 #include "core/html/HTMLCanvasElement.h" |
10 #include "core/html/HTMLImageElement.h" | 10 #include "core/html/HTMLImageElement.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 pack_skip_rows_ = 0; | 241 pack_skip_rows_ = 0; |
242 unpack_row_length_ = 0; | 242 unpack_row_length_ = 0; |
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(GLenum target, | 251 void WebGL2RenderingContextBase::bufferData( |
252 DOMArrayBufferView* src_data, | 252 GLenum target, |
253 GLenum usage, | 253 NotShared<DOMArrayBufferView> src_data, |
254 GLuint src_offset, | 254 GLenum usage, |
255 GLuint length) { | 255 GLuint src_offset, |
| 256 GLuint length) { |
256 if (isContextLost()) | 257 if (isContextLost()) |
257 return; | 258 return; |
258 void* sub_base_address = nullptr; | 259 void* sub_base_address = nullptr; |
259 long long sub_byte_length = 0; | 260 long long sub_byte_length = 0; |
260 if (!ValidateSubSourceAndGetData(src_data, src_offset, length, | 261 if (!ValidateSubSourceAndGetData(src_data.View(), src_offset, length, |
261 &sub_base_address, &sub_byte_length)) { | 262 &sub_base_address, &sub_byte_length)) { |
262 SynthesizeGLError(GL_INVALID_VALUE, "bufferData", | 263 SynthesizeGLError(GL_INVALID_VALUE, "bufferData", |
263 "srcOffset + length too large"); | 264 "srcOffset + length too large"); |
264 return; | 265 return; |
265 } | 266 } |
266 BufferDataImpl(target, sub_byte_length, sub_base_address, usage); | 267 BufferDataImpl(target, sub_byte_length, sub_base_address, usage); |
267 } | 268 } |
268 | 269 |
269 void WebGL2RenderingContextBase::bufferData(GLenum target, | 270 void WebGL2RenderingContextBase::bufferData(GLenum target, |
270 long long size, | 271 long long size, |
271 GLenum usage) { | 272 GLenum usage) { |
272 WebGLRenderingContextBase::bufferData(target, size, usage); | 273 WebGLRenderingContextBase::bufferData(target, size, usage); |
273 } | 274 } |
274 | 275 |
275 void WebGL2RenderingContextBase::bufferData(GLenum target, | 276 void WebGL2RenderingContextBase::bufferData(GLenum target, |
276 DOMArrayBuffer* data, | 277 DOMArrayBuffer* data, |
277 GLenum usage) { | 278 GLenum usage) { |
278 WebGLRenderingContextBase::bufferData(target, data, usage); | 279 WebGLRenderingContextBase::bufferData(target, data, usage); |
279 } | 280 } |
280 | 281 |
281 void WebGL2RenderingContextBase::bufferData(GLenum target, | 282 void WebGL2RenderingContextBase::bufferData(GLenum target, |
282 DOMArrayBufferView* data, | 283 NotShared<DOMArrayBufferView> data, |
283 GLenum usage) { | 284 GLenum usage) { |
284 WebGLRenderingContextBase::bufferData(target, data, usage); | 285 WebGLRenderingContextBase::bufferData(target, data, usage); |
285 } | 286 } |
286 | 287 |
287 void WebGL2RenderingContextBase::bufferSubData(GLenum target, | 288 void WebGL2RenderingContextBase::bufferSubData( |
288 GLintptr dst_byte_offset, | 289 GLenum target, |
289 DOMArrayBufferView* src_data, | 290 GLintptr dst_byte_offset, |
290 GLuint src_offset, | 291 NotShared<DOMArrayBufferView> src_data, |
291 GLuint length) { | 292 GLuint src_offset, |
| 293 GLuint length) { |
292 if (isContextLost()) | 294 if (isContextLost()) |
293 return; | 295 return; |
294 void* sub_base_address = nullptr; | 296 void* sub_base_address = nullptr; |
295 long long sub_byte_length = 0; | 297 long long sub_byte_length = 0; |
296 if (!ValidateSubSourceAndGetData(src_data, src_offset, length, | 298 if (!ValidateSubSourceAndGetData(src_data.View(), src_offset, length, |
297 &sub_base_address, &sub_byte_length)) { | 299 &sub_base_address, &sub_byte_length)) { |
298 SynthesizeGLError(GL_INVALID_VALUE, "bufferSubData", | 300 SynthesizeGLError(GL_INVALID_VALUE, "bufferSubData", |
299 "srcOffset + length too large"); | 301 "srcOffset + length too large"); |
300 return; | 302 return; |
301 } | 303 } |
302 BufferSubDataImpl(target, dst_byte_offset, sub_byte_length, sub_base_address); | 304 BufferSubDataImpl(target, dst_byte_offset, sub_byte_length, sub_base_address); |
303 } | 305 } |
304 | 306 |
305 void WebGL2RenderingContextBase::bufferSubData(GLenum target, | 307 void WebGL2RenderingContextBase::bufferSubData(GLenum target, |
306 long long offset, | 308 long long offset, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 } | 360 } |
359 | 361 |
360 if (write_buffer->GetInitialTarget() == 0) | 362 if (write_buffer->GetInitialTarget() == 0) |
361 write_buffer->SetInitialTarget(read_buffer->GetInitialTarget()); | 363 write_buffer->SetInitialTarget(read_buffer->GetInitialTarget()); |
362 | 364 |
363 ContextGL()->CopyBufferSubData( | 365 ContextGL()->CopyBufferSubData( |
364 read_target, write_target, static_cast<GLintptr>(read_offset), | 366 read_target, write_target, static_cast<GLintptr>(read_offset), |
365 static_cast<GLintptr>(write_offset), static_cast<GLsizeiptr>(size)); | 367 static_cast<GLintptr>(write_offset), static_cast<GLsizeiptr>(size)); |
366 } | 368 } |
367 | 369 |
368 void WebGL2RenderingContextBase::getBufferSubData(GLenum target, | 370 void WebGL2RenderingContextBase::getBufferSubData( |
369 long long src_byte_offset, | 371 GLenum target, |
370 DOMArrayBufferView* dst_data, | 372 long long src_byte_offset, |
371 GLuint dst_offset, | 373 NotShared<DOMArrayBufferView> dst_data, |
372 GLuint length) { | 374 GLuint dst_offset, |
| 375 GLuint length) { |
373 WebGLBuffer* source_buffer = nullptr; | 376 WebGLBuffer* source_buffer = nullptr; |
374 void* destination_data_ptr = nullptr; | 377 void* destination_data_ptr = nullptr; |
375 long long destination_byte_length = 0; | 378 long long destination_byte_length = 0; |
376 const char* message = ValidateGetBufferSubData( | 379 const char* message = ValidateGetBufferSubData( |
377 __FUNCTION__, target, src_byte_offset, dst_data, dst_offset, length, | 380 __FUNCTION__, target, src_byte_offset, dst_data.View(), dst_offset, |
378 &source_buffer, &destination_data_ptr, &destination_byte_length); | 381 length, &source_buffer, &destination_data_ptr, &destination_byte_length); |
379 if (message) { | 382 if (message) { |
380 // If there was a GL error, it was already synthesized in | 383 // If there was a GL error, it was already synthesized in |
381 // validateGetBufferSubData, so it's not done here. | 384 // validateGetBufferSubData, so it's not done here. |
382 return; | 385 return; |
383 } | 386 } |
384 | 387 |
385 // If the length of the copy is zero, this is a no-op. | 388 // If the length of the copy is zero, this is a no-op. |
386 if (!destination_byte_length) { | 389 if (!destination_byte_length) { |
387 return; | 390 return; |
388 } | 391 } |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 case GL_UNPACK_SKIP_IMAGES: | 745 case GL_UNPACK_SKIP_IMAGES: |
743 unpack_skip_images_ = param; | 746 unpack_skip_images_ = param; |
744 break; | 747 break; |
745 default: | 748 default: |
746 WebGLRenderingContextBase::pixelStorei(pname, param); | 749 WebGLRenderingContextBase::pixelStorei(pname, param); |
747 return; | 750 return; |
748 } | 751 } |
749 ContextGL()->PixelStorei(pname, param); | 752 ContextGL()->PixelStorei(pname, param); |
750 } | 753 } |
751 | 754 |
752 void WebGL2RenderingContextBase::readPixels(GLint x, | 755 void WebGL2RenderingContextBase::readPixels( |
753 GLint y, | 756 GLint x, |
754 GLsizei width, | 757 GLint y, |
755 GLsizei height, | 758 GLsizei width, |
756 GLenum format, | 759 GLsizei height, |
757 GLenum type, | 760 GLenum format, |
758 DOMArrayBufferView* pixels) { | 761 GLenum type, |
| 762 NotShared<DOMArrayBufferView> pixels) { |
759 if (isContextLost()) | 763 if (isContextLost()) |
760 return; | 764 return; |
761 if (bound_pixel_pack_buffer_.Get()) { | 765 if (bound_pixel_pack_buffer_.Get()) { |
762 SynthesizeGLError(GL_INVALID_OPERATION, "readPixels", | 766 SynthesizeGLError(GL_INVALID_OPERATION, "readPixels", |
763 "PIXEL_PACK buffer should not be bound"); | 767 "PIXEL_PACK buffer should not be bound"); |
764 return; | 768 return; |
765 } | 769 } |
766 | 770 |
767 ReadPixelsHelper(x, y, width, height, format, type, pixels, 0); | 771 ReadPixelsHelper(x, y, width, height, format, type, pixels.View(), 0); |
768 } | 772 } |
769 | 773 |
770 void WebGL2RenderingContextBase::readPixels(GLint x, | 774 void WebGL2RenderingContextBase::readPixels( |
771 GLint y, | 775 GLint x, |
772 GLsizei width, | 776 GLint y, |
773 GLsizei height, | 777 GLsizei width, |
774 GLenum format, | 778 GLsizei height, |
775 GLenum type, | 779 GLenum format, |
776 DOMArrayBufferView* pixels, | 780 GLenum type, |
777 GLuint offset) { | 781 NotShared<DOMArrayBufferView> pixels, |
| 782 GLuint offset) { |
778 if (isContextLost()) | 783 if (isContextLost()) |
779 return; | 784 return; |
780 if (bound_pixel_pack_buffer_.Get()) { | 785 if (bound_pixel_pack_buffer_.Get()) { |
781 SynthesizeGLError(GL_INVALID_OPERATION, "readPixels", | 786 SynthesizeGLError(GL_INVALID_OPERATION, "readPixels", |
782 "PIXEL_PACK buffer should not be bound"); | 787 "PIXEL_PACK buffer should not be bound"); |
783 return; | 788 return; |
784 } | 789 } |
785 | 790 |
786 ReadPixelsHelper(x, y, width, height, format, type, pixels, offset); | 791 ReadPixelsHelper(x, y, width, height, format, type, pixels.View(), offset); |
787 } | 792 } |
788 | 793 |
789 void WebGL2RenderingContextBase::readPixels(GLint x, | 794 void WebGL2RenderingContextBase::readPixels(GLint x, |
790 GLint y, | 795 GLint y, |
791 GLsizei width, | 796 GLsizei width, |
792 GLsizei height, | 797 GLsizei height, |
793 GLenum format, | 798 GLenum format, |
794 GLenum type, | 799 GLenum type, |
795 long long offset) { | 800 long long offset) { |
796 if (isContextLost()) | 801 if (isContextLost()) |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 xoffset, yoffset, 0)) | 1123 xoffset, yoffset, 0)) |
1119 return; | 1124 return; |
1120 if (!ValidateValueFitNonNegInt32("texSubImage2D", "offset", offset)) | 1125 if (!ValidateValueFitNonNegInt32("texSubImage2D", "offset", offset)) |
1121 return; | 1126 return; |
1122 | 1127 |
1123 ContextGL()->TexSubImage2D(target, level, xoffset, yoffset, width, height, | 1128 ContextGL()->TexSubImage2D(target, level, xoffset, yoffset, width, height, |
1124 format, type, | 1129 format, type, |
1125 reinterpret_cast<const void*>(offset)); | 1130 reinterpret_cast<const void*>(offset)); |
1126 } | 1131 } |
1127 | 1132 |
1128 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1133 void WebGL2RenderingContextBase::texImage2D( |
1129 GLint level, | 1134 GLenum target, |
1130 GLint internalformat, | 1135 GLint level, |
1131 GLsizei width, | 1136 GLint internalformat, |
1132 GLsizei height, | 1137 GLsizei width, |
1133 GLint border, | 1138 GLsizei height, |
1134 GLenum format, | 1139 GLint border, |
1135 GLenum type, | 1140 GLenum format, |
1136 DOMArrayBufferView* data) { | 1141 GLenum type, |
| 1142 NotShared<DOMArrayBufferView> data) { |
1137 if (isContextLost()) | 1143 if (isContextLost()) |
1138 return; | 1144 return; |
1139 if (bound_pixel_unpack_buffer_) { | 1145 if (bound_pixel_unpack_buffer_) { |
1140 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1146 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
1141 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1147 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
1142 return; | 1148 return; |
1143 } | 1149 } |
1144 WebGLRenderingContextBase::texImage2D(target, level, internalformat, width, | 1150 WebGLRenderingContextBase::texImage2D(target, level, internalformat, width, |
1145 height, border, format, type, data); | 1151 height, border, format, type, data); |
1146 } | 1152 } |
1147 | 1153 |
1148 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1154 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
1149 GLint level, | 1155 GLint level, |
1150 GLint internalformat, | 1156 GLint internalformat, |
1151 GLsizei width, | 1157 GLsizei width, |
1152 GLsizei height, | 1158 GLsizei height, |
1153 GLint border, | 1159 GLint border, |
1154 GLenum format, | 1160 GLenum format, |
1155 GLenum type, | 1161 GLenum type, |
1156 DOMArrayBufferView* data, | 1162 NotShared<DOMArrayBufferView> data, |
1157 GLuint src_offset) { | 1163 GLuint src_offset) { |
1158 if (isContextLost()) | 1164 if (isContextLost()) |
1159 return; | 1165 return; |
1160 if (bound_pixel_unpack_buffer_) { | 1166 if (bound_pixel_unpack_buffer_) { |
1161 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1167 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
1162 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1168 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
1163 return; | 1169 return; |
1164 } | 1170 } |
1165 TexImageHelperDOMArrayBufferView(kTexImage2D, target, level, internalformat, | 1171 TexImageHelperDOMArrayBufferView( |
1166 width, height, 1, border, format, type, 0, 0, | 1172 kTexImage2D, target, level, internalformat, width, height, 1, border, |
1167 0, data, kNullNotReachable, src_offset); | 1173 format, type, 0, 0, 0, data.View(), kNullNotReachable, src_offset); |
1168 } | 1174 } |
1169 | 1175 |
1170 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1176 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
1171 GLint level, | 1177 GLint level, |
1172 GLint internalformat, | 1178 GLint internalformat, |
1173 GLsizei width, | 1179 GLsizei width, |
1174 GLsizei height, | 1180 GLsizei height, |
1175 GLint border, | 1181 GLint border, |
1176 GLenum format, | 1182 GLenum format, |
1177 GLenum type, | 1183 GLenum type, |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 return; | 1367 return; |
1362 if (bound_pixel_unpack_buffer_) { | 1368 if (bound_pixel_unpack_buffer_) { |
1363 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1369 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
1364 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1370 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
1365 return; | 1371 return; |
1366 } | 1372 } |
1367 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, | 1373 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, |
1368 type, image_bit_map, exception_state); | 1374 type, image_bit_map, exception_state); |
1369 } | 1375 } |
1370 | 1376 |
1371 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1377 void WebGL2RenderingContextBase::texSubImage2D( |
1372 GLint level, | 1378 GLenum target, |
1373 GLint xoffset, | 1379 GLint level, |
1374 GLint yoffset, | 1380 GLint xoffset, |
1375 GLsizei width, | 1381 GLint yoffset, |
1376 GLsizei height, | 1382 GLsizei width, |
1377 GLenum format, | 1383 GLsizei height, |
1378 GLenum type, | 1384 GLenum format, |
1379 DOMArrayBufferView* pixels) { | 1385 GLenum type, |
| 1386 NotShared<DOMArrayBufferView> pixels) { |
1380 if (isContextLost()) | 1387 if (isContextLost()) |
1381 return; | 1388 return; |
1382 if (bound_pixel_unpack_buffer_) { | 1389 if (bound_pixel_unpack_buffer_) { |
1383 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1390 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
1384 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1391 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
1385 return; | 1392 return; |
1386 } | 1393 } |
1387 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, | 1394 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, |
1388 width, height, format, type, pixels); | 1395 width, height, format, type, pixels); |
1389 } | 1396 } |
1390 | 1397 |
1391 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1398 void WebGL2RenderingContextBase::texSubImage2D( |
1392 GLint level, | 1399 GLenum target, |
1393 GLint xoffset, | 1400 GLint level, |
1394 GLint yoffset, | 1401 GLint xoffset, |
1395 GLsizei width, | 1402 GLint yoffset, |
1396 GLsizei height, | 1403 GLsizei width, |
1397 GLenum format, | 1404 GLsizei height, |
1398 GLenum type, | 1405 GLenum format, |
1399 DOMArrayBufferView* pixels, | 1406 GLenum type, |
1400 GLuint src_offset) { | 1407 NotShared<DOMArrayBufferView> pixels, |
| 1408 GLuint src_offset) { |
1401 if (isContextLost()) | 1409 if (isContextLost()) |
1402 return; | 1410 return; |
1403 if (bound_pixel_unpack_buffer_) { | 1411 if (bound_pixel_unpack_buffer_) { |
1404 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1412 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
1405 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1413 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
1406 return; | 1414 return; |
1407 } | 1415 } |
1408 TexImageHelperDOMArrayBufferView(kTexSubImage2D, target, level, 0, width, | 1416 TexImageHelperDOMArrayBufferView( |
1409 height, 1, 0, format, type, xoffset, yoffset, | 1417 kTexSubImage2D, target, level, 0, width, height, 1, 0, format, type, |
1410 0, pixels, kNullNotReachable, src_offset); | 1418 xoffset, yoffset, 0, pixels.View(), kNullNotReachable, src_offset); |
1411 } | 1419 } |
1412 | 1420 |
1413 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1421 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
1414 GLint level, | 1422 GLint level, |
1415 GLint xoffset, | 1423 GLint xoffset, |
1416 GLint yoffset, | 1424 GLint yoffset, |
1417 GLsizei width, | 1425 GLsizei width, |
1418 GLsizei height, | 1426 GLsizei height, |
1419 GLenum format, | 1427 GLenum format, |
1420 GLenum type, | 1428 GLenum type, |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 GLsizei depth) { | 1649 GLsizei depth) { |
1642 if (isContextLost() || | 1650 if (isContextLost() || |
1643 !ValidateTexStorage("texStorage3D", target, levels, internalformat, width, | 1651 !ValidateTexStorage("texStorage3D", target, levels, internalformat, width, |
1644 height, depth, kTexStorageType3D)) | 1652 height, depth, kTexStorageType3D)) |
1645 return; | 1653 return; |
1646 | 1654 |
1647 ContextGL()->TexStorage3D(target, levels, internalformat, width, height, | 1655 ContextGL()->TexStorage3D(target, levels, internalformat, width, height, |
1648 depth); | 1656 depth); |
1649 } | 1657 } |
1650 | 1658 |
1651 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1659 void WebGL2RenderingContextBase::texImage3D( |
1652 GLint level, | 1660 GLenum target, |
1653 GLint internalformat, | 1661 GLint level, |
1654 GLsizei width, | 1662 GLint internalformat, |
1655 GLsizei height, | 1663 GLsizei width, |
1656 GLsizei depth, | 1664 GLsizei height, |
1657 GLint border, | 1665 GLsizei depth, |
1658 GLenum format, | 1666 GLint border, |
1659 GLenum type, | 1667 GLenum format, |
1660 DOMArrayBufferView* pixels) { | 1668 GLenum type, |
| 1669 NotShared<DOMArrayBufferView> pixels) { |
1661 TexImageHelperDOMArrayBufferView(kTexImage3D, target, level, internalformat, | 1670 TexImageHelperDOMArrayBufferView(kTexImage3D, target, level, internalformat, |
1662 width, height, depth, border, format, type, | 1671 width, height, depth, border, format, type, |
1663 0, 0, 0, pixels, kNullAllowed, 0); | 1672 0, 0, 0, pixels.View(), kNullAllowed, 0); |
1664 } | 1673 } |
1665 | 1674 |
1666 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1675 void WebGL2RenderingContextBase::texImage3D( |
1667 GLint level, | 1676 GLenum target, |
1668 GLint internalformat, | 1677 GLint level, |
1669 GLsizei width, | 1678 GLint internalformat, |
1670 GLsizei height, | 1679 GLsizei width, |
1671 GLsizei depth, | 1680 GLsizei height, |
1672 GLint border, | 1681 GLsizei depth, |
1673 GLenum format, | 1682 GLint border, |
1674 GLenum type, | 1683 GLenum format, |
1675 DOMArrayBufferView* pixels, | 1684 GLenum type, |
1676 GLuint src_offset) { | 1685 NotShared<DOMArrayBufferView> pixels, |
| 1686 GLuint src_offset) { |
1677 if (isContextLost()) | 1687 if (isContextLost()) |
1678 return; | 1688 return; |
1679 if (bound_pixel_unpack_buffer_) { | 1689 if (bound_pixel_unpack_buffer_) { |
1680 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", | 1690 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", |
1681 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1691 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
1682 return; | 1692 return; |
1683 } | 1693 } |
1684 TexImageHelperDOMArrayBufferView( | 1694 TexImageHelperDOMArrayBufferView( |
1685 kTexImage3D, target, level, internalformat, width, height, depth, border, | 1695 kTexImage3D, target, level, internalformat, width, height, depth, border, |
1686 format, type, 0, 0, 0, pixels, kNullNotReachable, src_offset); | 1696 format, type, 0, 0, 0, pixels.View(), kNullNotReachable, src_offset); |
1687 } | 1697 } |
1688 | 1698 |
1689 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1699 void WebGL2RenderingContextBase::texImage3D(GLenum target, |
1690 GLint level, | 1700 GLint level, |
1691 GLint internalformat, | 1701 GLint internalformat, |
1692 GLsizei width, | 1702 GLsizei width, |
1693 GLsizei height, | 1703 GLsizei height, |
1694 GLsizei depth, | 1704 GLsizei depth, |
1695 GLint border, | 1705 GLint border, |
1696 GLenum format, | 1706 GLenum format, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1827 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", | 1837 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", |
1828 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1838 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
1829 return; | 1839 return; |
1830 } | 1840 } |
1831 TexImageHelperImageBitmap(kTexImage3D, target, level, internalformat, format, | 1841 TexImageHelperImageBitmap(kTexImage3D, target, level, internalformat, format, |
1832 type, 0, 0, 0, bitmap, | 1842 type, 0, 0, 0, bitmap, |
1833 GetTextureSourceSubRectangle(width, height), depth, | 1843 GetTextureSourceSubRectangle(width, height), depth, |
1834 unpack_image_height_, exception_state); | 1844 unpack_image_height_, exception_state); |
1835 } | 1845 } |
1836 | 1846 |
1837 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1847 void WebGL2RenderingContextBase::texSubImage3D( |
1838 GLint level, | 1848 GLenum target, |
1839 GLint xoffset, | 1849 GLint level, |
1840 GLint yoffset, | 1850 GLint xoffset, |
1841 GLint zoffset, | 1851 GLint yoffset, |
1842 GLsizei width, | 1852 GLint zoffset, |
1843 GLsizei height, | 1853 GLsizei width, |
1844 GLsizei depth, | 1854 GLsizei height, |
1845 GLenum format, | 1855 GLsizei depth, |
1846 GLenum type, | 1856 GLenum format, |
1847 DOMArrayBufferView* pixels, | 1857 GLenum type, |
1848 GLuint src_offset) { | 1858 NotShared<DOMArrayBufferView> pixels, |
| 1859 GLuint src_offset) { |
1849 if (isContextLost()) | 1860 if (isContextLost()) |
1850 return; | 1861 return; |
1851 if (bound_pixel_unpack_buffer_) { | 1862 if (bound_pixel_unpack_buffer_) { |
1852 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", | 1863 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", |
1853 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1864 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
1854 return; | 1865 return; |
1855 } | 1866 } |
1856 TexImageHelperDOMArrayBufferView( | 1867 TexImageHelperDOMArrayBufferView( |
1857 kTexSubImage3D, target, level, 0, width, height, depth, 0, format, type, | 1868 kTexSubImage3D, target, level, 0, width, height, depth, 0, format, type, |
1858 xoffset, yoffset, zoffset, pixels, kNullNotReachable, src_offset); | 1869 xoffset, yoffset, zoffset, pixels.View(), kNullNotReachable, src_offset); |
1859 } | 1870 } |
1860 | 1871 |
1861 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1872 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
1862 GLint level, | 1873 GLint level, |
1863 GLint xoffset, | 1874 GLint xoffset, |
1864 GLint yoffset, | 1875 GLint yoffset, |
1865 GLint zoffset, | 1876 GLint zoffset, |
1866 GLsizei width, | 1877 GLsizei width, |
1867 GLsizei height, | 1878 GLsizei height, |
1868 GLsizei depth, | 1879 GLsizei depth, |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2043 width, height); | 2054 width, height); |
2044 } | 2055 } |
2045 | 2056 |
2046 void WebGL2RenderingContextBase::compressedTexImage2D( | 2057 void WebGL2RenderingContextBase::compressedTexImage2D( |
2047 GLenum target, | 2058 GLenum target, |
2048 GLint level, | 2059 GLint level, |
2049 GLenum internalformat, | 2060 GLenum internalformat, |
2050 GLsizei width, | 2061 GLsizei width, |
2051 GLsizei height, | 2062 GLsizei height, |
2052 GLint border, | 2063 GLint border, |
2053 DOMArrayBufferView* data) { | 2064 NotShared<DOMArrayBufferView> data) { |
2054 if (isContextLost()) | 2065 if (isContextLost()) |
2055 return; | 2066 return; |
2056 if (bound_pixel_unpack_buffer_) { | 2067 if (bound_pixel_unpack_buffer_) { |
2057 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", | 2068 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", |
2058 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2069 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
2059 return; | 2070 return; |
2060 } | 2071 } |
2061 WebGLRenderingContextBase::compressedTexImage2D(target, level, internalformat, | 2072 WebGLRenderingContextBase::compressedTexImage2D(target, level, internalformat, |
2062 width, height, border, data); | 2073 width, height, border, data); |
2063 } | 2074 } |
2064 | 2075 |
2065 void WebGL2RenderingContextBase::compressedTexImage2D( | 2076 void WebGL2RenderingContextBase::compressedTexImage2D( |
2066 GLenum target, | 2077 GLenum target, |
2067 GLint level, | 2078 GLint level, |
2068 GLenum internalformat, | 2079 GLenum internalformat, |
2069 GLsizei width, | 2080 GLsizei width, |
2070 GLsizei height, | 2081 GLsizei height, |
2071 GLint border, | 2082 GLint border, |
2072 DOMArrayBufferView* data, | 2083 NotShared<DOMArrayBufferView> data, |
2073 GLuint src_offset, | 2084 GLuint src_offset, |
2074 GLuint src_length_override) { | 2085 GLuint src_length_override) { |
2075 if (isContextLost()) | 2086 if (isContextLost()) |
2076 return; | 2087 return; |
2077 if (bound_pixel_unpack_buffer_) { | 2088 if (bound_pixel_unpack_buffer_) { |
2078 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", | 2089 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", |
2079 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2090 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
2080 return; | 2091 return; |
2081 } | 2092 } |
2082 if (!ValidateTexture2DBinding("compressedTexImage2D", target)) | 2093 if (!ValidateTexture2DBinding("compressedTexImage2D", target)) |
2083 return; | 2094 return; |
2084 if (!ValidateCompressedTexFormat("compressedTexImage2D", internalformat)) | 2095 if (!ValidateCompressedTexFormat("compressedTexImage2D", internalformat)) |
2085 return; | 2096 return; |
2086 if (src_offset > data->byteLength()) { | 2097 if (src_offset > data.View()->byteLength()) { |
2087 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", | 2098 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", |
2088 "srcOffset is out of range"); | 2099 "srcOffset is out of range"); |
2089 return; | 2100 return; |
2090 } | 2101 } |
2091 if (src_length_override == 0) { | 2102 if (src_length_override == 0) { |
2092 src_length_override = data->byteLength() - src_offset; | 2103 src_length_override = data.View()->byteLength() - src_offset; |
2093 } else if (src_length_override > data->byteLength() - src_offset) { | 2104 } else if (src_length_override > data.View()->byteLength() - src_offset) { |
2094 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", | 2105 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", |
2095 "srcLengthOverride is out of range"); | 2106 "srcLengthOverride is out of range"); |
2096 return; | 2107 return; |
2097 } | 2108 } |
2098 ContextGL()->CompressedTexImage2D( | 2109 ContextGL()->CompressedTexImage2D( |
2099 target, level, internalformat, width, height, border, src_length_override, | 2110 target, level, internalformat, width, height, border, src_length_override, |
2100 static_cast<uint8_t*>(data->BaseAddress()) + src_offset); | 2111 static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); |
2101 } | 2112 } |
2102 | 2113 |
2103 void WebGL2RenderingContextBase::compressedTexImage2D(GLenum target, | 2114 void WebGL2RenderingContextBase::compressedTexImage2D(GLenum target, |
2104 GLint level, | 2115 GLint level, |
2105 GLenum internalformat, | 2116 GLenum internalformat, |
2106 GLsizei width, | 2117 GLsizei width, |
2107 GLsizei height, | 2118 GLsizei height, |
2108 GLint border, | 2119 GLint border, |
2109 GLsizei image_size, | 2120 GLsizei image_size, |
2110 GLintptr offset) { | 2121 GLintptr offset) { |
(...skipping 10 matching lines...) Expand all Loading... |
2121 } | 2132 } |
2122 | 2133 |
2123 void WebGL2RenderingContextBase::compressedTexSubImage2D( | 2134 void WebGL2RenderingContextBase::compressedTexSubImage2D( |
2124 GLenum target, | 2135 GLenum target, |
2125 GLint level, | 2136 GLint level, |
2126 GLint xoffset, | 2137 GLint xoffset, |
2127 GLint yoffset, | 2138 GLint yoffset, |
2128 GLsizei width, | 2139 GLsizei width, |
2129 GLsizei height, | 2140 GLsizei height, |
2130 GLenum format, | 2141 GLenum format, |
2131 DOMArrayBufferView* data) { | 2142 NotShared<DOMArrayBufferView> data) { |
2132 if (isContextLost()) | 2143 if (isContextLost()) |
2133 return; | 2144 return; |
2134 if (bound_pixel_unpack_buffer_) { | 2145 if (bound_pixel_unpack_buffer_) { |
2135 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", | 2146 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", |
2136 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2147 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
2137 return; | 2148 return; |
2138 } | 2149 } |
2139 WebGLRenderingContextBase::compressedTexSubImage2D( | 2150 WebGLRenderingContextBase::compressedTexSubImage2D( |
2140 target, level, xoffset, yoffset, width, height, format, data); | 2151 target, level, xoffset, yoffset, width, height, format, data); |
2141 } | 2152 } |
2142 | 2153 |
2143 void WebGL2RenderingContextBase::compressedTexSubImage2D( | 2154 void WebGL2RenderingContextBase::compressedTexSubImage2D( |
2144 GLenum target, | 2155 GLenum target, |
2145 GLint level, | 2156 GLint level, |
2146 GLint xoffset, | 2157 GLint xoffset, |
2147 GLint yoffset, | 2158 GLint yoffset, |
2148 GLsizei width, | 2159 GLsizei width, |
2149 GLsizei height, | 2160 GLsizei height, |
2150 GLenum format, | 2161 GLenum format, |
2151 DOMArrayBufferView* data, | 2162 NotShared<DOMArrayBufferView> data, |
2152 GLuint src_offset, | 2163 GLuint src_offset, |
2153 GLuint src_length_override) { | 2164 GLuint src_length_override) { |
2154 if (isContextLost()) | 2165 if (isContextLost()) |
2155 return; | 2166 return; |
2156 if (bound_pixel_unpack_buffer_) { | 2167 if (bound_pixel_unpack_buffer_) { |
2157 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", | 2168 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", |
2158 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2169 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
2159 return; | 2170 return; |
2160 } | 2171 } |
2161 if (!ValidateTexture2DBinding("compressedTexSubImage2D", target)) | 2172 if (!ValidateTexture2DBinding("compressedTexSubImage2D", target)) |
2162 return; | 2173 return; |
2163 if (!ValidateCompressedTexFormat("compressedTexSubImage2D", format)) | 2174 if (!ValidateCompressedTexFormat("compressedTexSubImage2D", format)) |
2164 return; | 2175 return; |
2165 if (src_offset > data->byteLength()) { | 2176 if (src_offset > data.View()->byteLength()) { |
2166 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D", | 2177 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D", |
2167 "srcOffset is out of range"); | 2178 "srcOffset is out of range"); |
2168 return; | 2179 return; |
2169 } | 2180 } |
2170 if (src_length_override == 0) { | 2181 if (src_length_override == 0) { |
2171 src_length_override = data->byteLength() - src_offset; | 2182 src_length_override = data.View()->byteLength() - src_offset; |
2172 } else if (src_length_override > data->byteLength() - src_offset) { | 2183 } else if (src_length_override > data.View()->byteLength() - src_offset) { |
2173 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", | 2184 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", |
2174 "srcLengthOverride is out of range"); | 2185 "srcLengthOverride is out of range"); |
2175 return; | 2186 return; |
2176 } | 2187 } |
2177 ContextGL()->CompressedTexSubImage2D( | 2188 ContextGL()->CompressedTexSubImage2D( |
2178 target, level, xoffset, yoffset, width, height, format, | 2189 target, level, xoffset, yoffset, width, height, format, |
2179 src_length_override, | 2190 src_length_override, |
2180 static_cast<uint8_t*>(data->BaseAddress()) + src_offset); | 2191 static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); |
2181 } | 2192 } |
2182 | 2193 |
2183 void WebGL2RenderingContextBase::compressedTexSubImage2D(GLenum target, | 2194 void WebGL2RenderingContextBase::compressedTexSubImage2D(GLenum target, |
2184 GLint level, | 2195 GLint level, |
2185 GLint xoffset, | 2196 GLint xoffset, |
2186 GLint yoffset, | 2197 GLint yoffset, |
2187 GLsizei width, | 2198 GLsizei width, |
2188 GLsizei height, | 2199 GLsizei height, |
2189 GLenum format, | 2200 GLenum format, |
2190 GLsizei image_size, | 2201 GLsizei image_size, |
(...skipping 11 matching lines...) Expand all Loading... |
2202 } | 2213 } |
2203 | 2214 |
2204 void WebGL2RenderingContextBase::compressedTexImage3D( | 2215 void WebGL2RenderingContextBase::compressedTexImage3D( |
2205 GLenum target, | 2216 GLenum target, |
2206 GLint level, | 2217 GLint level, |
2207 GLenum internalformat, | 2218 GLenum internalformat, |
2208 GLsizei width, | 2219 GLsizei width, |
2209 GLsizei height, | 2220 GLsizei height, |
2210 GLsizei depth, | 2221 GLsizei depth, |
2211 GLint border, | 2222 GLint border, |
2212 DOMArrayBufferView* data, | 2223 NotShared<DOMArrayBufferView> data, |
2213 GLuint src_offset, | 2224 GLuint src_offset, |
2214 GLuint src_length_override) { | 2225 GLuint src_length_override) { |
2215 if (isContextLost()) | 2226 if (isContextLost()) |
2216 return; | 2227 return; |
2217 if (bound_pixel_unpack_buffer_) { | 2228 if (bound_pixel_unpack_buffer_) { |
2218 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage3D", | 2229 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage3D", |
2219 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2230 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
2220 return; | 2231 return; |
2221 } | 2232 } |
2222 if (!ValidateTexture3DBinding("compressedTexImage3D", target)) | 2233 if (!ValidateTexture3DBinding("compressedTexImage3D", target)) |
2223 return; | 2234 return; |
2224 if (!ValidateCompressedTexFormat("compressedTexImage3D", internalformat)) | 2235 if (!ValidateCompressedTexFormat("compressedTexImage3D", internalformat)) |
2225 return; | 2236 return; |
2226 if (src_offset > data->byteLength()) { | 2237 if (src_offset > data.View()->byteLength()) { |
2227 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", | 2238 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", |
2228 "srcOffset is out of range"); | 2239 "srcOffset is out of range"); |
2229 return; | 2240 return; |
2230 } | 2241 } |
2231 if (src_length_override == 0) { | 2242 if (src_length_override == 0) { |
2232 src_length_override = data->byteLength() - src_offset; | 2243 src_length_override = data.View()->byteLength() - src_offset; |
2233 } else if (src_length_override > data->byteLength() - src_offset) { | 2244 } else if (src_length_override > data.View()->byteLength() - src_offset) { |
2234 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", | 2245 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", |
2235 "srcLengthOverride is out of range"); | 2246 "srcLengthOverride is out of range"); |
2236 return; | 2247 return; |
2237 } | 2248 } |
2238 ContextGL()->CompressedTexImage3D( | 2249 ContextGL()->CompressedTexImage3D( |
2239 target, level, internalformat, width, height, depth, border, | 2250 target, level, internalformat, width, height, depth, border, |
2240 src_length_override, | 2251 src_length_override, |
2241 static_cast<uint8_t*>(data->BaseAddress()) + src_offset); | 2252 static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); |
2242 } | 2253 } |
2243 | 2254 |
2244 void WebGL2RenderingContextBase::compressedTexImage3D(GLenum target, | 2255 void WebGL2RenderingContextBase::compressedTexImage3D(GLenum target, |
2245 GLint level, | 2256 GLint level, |
2246 GLenum internalformat, | 2257 GLenum internalformat, |
2247 GLsizei width, | 2258 GLsizei width, |
2248 GLsizei height, | 2259 GLsizei height, |
2249 GLsizei depth, | 2260 GLsizei depth, |
2250 GLint border, | 2261 GLint border, |
2251 GLsizei image_size, | 2262 GLsizei image_size, |
(...skipping 13 matching lines...) Expand all Loading... |
2265 void WebGL2RenderingContextBase::compressedTexSubImage3D( | 2276 void WebGL2RenderingContextBase::compressedTexSubImage3D( |
2266 GLenum target, | 2277 GLenum target, |
2267 GLint level, | 2278 GLint level, |
2268 GLint xoffset, | 2279 GLint xoffset, |
2269 GLint yoffset, | 2280 GLint yoffset, |
2270 GLint zoffset, | 2281 GLint zoffset, |
2271 GLsizei width, | 2282 GLsizei width, |
2272 GLsizei height, | 2283 GLsizei height, |
2273 GLsizei depth, | 2284 GLsizei depth, |
2274 GLenum format, | 2285 GLenum format, |
2275 DOMArrayBufferView* data, | 2286 NotShared<DOMArrayBufferView> data, |
2276 GLuint src_offset, | 2287 GLuint src_offset, |
2277 GLuint src_length_override) { | 2288 GLuint src_length_override) { |
2278 if (isContextLost()) | 2289 if (isContextLost()) |
2279 return; | 2290 return; |
2280 if (bound_pixel_unpack_buffer_) { | 2291 if (bound_pixel_unpack_buffer_) { |
2281 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage3D", | 2292 SynthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage3D", |
2282 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2293 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
2283 return; | 2294 return; |
2284 } | 2295 } |
2285 if (!ValidateTexture3DBinding("compressedTexSubImage3D", target)) | 2296 if (!ValidateTexture3DBinding("compressedTexSubImage3D", target)) |
2286 return; | 2297 return; |
2287 if (!ValidateCompressedTexFormat("compressedTexSubImage3D", format)) | 2298 if (!ValidateCompressedTexFormat("compressedTexSubImage3D", format)) |
2288 return; | 2299 return; |
2289 if (src_offset > data->byteLength()) { | 2300 if (src_offset > data.View()->byteLength()) { |
2290 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", | 2301 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", |
2291 "srcOffset is out of range"); | 2302 "srcOffset is out of range"); |
2292 return; | 2303 return; |
2293 } | 2304 } |
2294 if (src_length_override == 0) { | 2305 if (src_length_override == 0) { |
2295 src_length_override = data->byteLength() - src_offset; | 2306 src_length_override = data.View()->byteLength() - src_offset; |
2296 } else if (src_length_override > data->byteLength() - src_offset) { | 2307 } else if (src_length_override > data.View()->byteLength() - src_offset) { |
2297 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", | 2308 SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", |
2298 "srcLengthOverride is out of range"); | 2309 "srcLengthOverride is out of range"); |
2299 return; | 2310 return; |
2300 } | 2311 } |
2301 ContextGL()->CompressedTexSubImage3D( | 2312 ContextGL()->CompressedTexSubImage3D( |
2302 target, level, xoffset, yoffset, zoffset, width, height, depth, format, | 2313 target, level, xoffset, yoffset, zoffset, width, height, depth, format, |
2303 src_length_override, | 2314 src_length_override, |
2304 static_cast<uint8_t*>(data->BaseAddress()) + src_offset); | 2315 static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); |
2305 } | 2316 } |
2306 | 2317 |
2307 void WebGL2RenderingContextBase::compressedTexSubImage3D(GLenum target, | 2318 void WebGL2RenderingContextBase::compressedTexSubImage3D(GLenum target, |
2308 GLint level, | 2319 GLint level, |
2309 GLint xoffset, | 2320 GLint xoffset, |
2310 GLint yoffset, | 2321 GLint yoffset, |
2311 GLint zoffset, | 2322 GLint zoffset, |
2312 GLsizei width, | 2323 GLsizei width, |
2313 GLsizei height, | 2324 GLsizei height, |
2314 GLsizei depth, | 2325 GLsizei depth, |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2777 | 2788 |
2778 ContextGL()->Uniform4uiv( | 2789 ContextGL()->Uniform4uiv( |
2779 location->Location(), | 2790 location->Location(), |
2780 (src_length ? src_length : (value.size() - src_offset)) >> 2, | 2791 (src_length ? src_length : (value.size() - src_offset)) >> 2, |
2781 value.Data() + src_offset); | 2792 value.Data() + src_offset); |
2782 } | 2793 } |
2783 | 2794 |
2784 void WebGL2RenderingContextBase::uniformMatrix2fv( | 2795 void WebGL2RenderingContextBase::uniformMatrix2fv( |
2785 const WebGLUniformLocation* location, | 2796 const WebGLUniformLocation* location, |
2786 GLboolean transpose, | 2797 GLboolean transpose, |
2787 DOMFloat32Array* v, | 2798 NotShared<DOMFloat32Array> v, |
2788 GLuint src_offset, | 2799 GLuint src_offset, |
2789 GLuint src_length) { | 2800 GLuint src_length) { |
2790 if (isContextLost() || | 2801 if (isContextLost() || |
2791 !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, | 2802 !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, |
2792 v, 4, src_offset, src_length)) | 2803 v.View(), 4, src_offset, src_length)) |
2793 return; | 2804 return; |
2794 ContextGL()->UniformMatrix2fv( | 2805 ContextGL()->UniformMatrix2fv( |
2795 location->Location(), | 2806 location->Location(), |
2796 (src_length ? src_length : (v->length() - src_offset)) >> 2, transpose, | 2807 (src_length ? src_length : (v.View()->length() - src_offset)) >> 2, |
2797 v->Data() + src_offset); | 2808 transpose, v.View()->Data() + src_offset); |
2798 } | 2809 } |
2799 | 2810 |
2800 void WebGL2RenderingContextBase::uniformMatrix2fv( | 2811 void WebGL2RenderingContextBase::uniformMatrix2fv( |
2801 const WebGLUniformLocation* location, | 2812 const WebGLUniformLocation* location, |
2802 GLboolean transpose, | 2813 GLboolean transpose, |
2803 Vector<GLfloat>& v, | 2814 Vector<GLfloat>& v, |
2804 GLuint src_offset, | 2815 GLuint src_offset, |
2805 GLuint src_length) { | 2816 GLuint src_length) { |
2806 if (isContextLost() || !ValidateUniformMatrixParameters( | 2817 if (isContextLost() || !ValidateUniformMatrixParameters( |
2807 "uniformMatrix2fv", location, transpose, v.Data(), | 2818 "uniformMatrix2fv", location, transpose, v.Data(), |
2808 v.size(), 4, src_offset, src_length)) | 2819 v.size(), 4, src_offset, src_length)) |
2809 return; | 2820 return; |
2810 ContextGL()->UniformMatrix2fv( | 2821 ContextGL()->UniformMatrix2fv( |
2811 location->Location(), | 2822 location->Location(), |
2812 (src_length ? src_length : (v.size() - src_offset)) >> 2, transpose, | 2823 (src_length ? src_length : (v.size() - src_offset)) >> 2, transpose, |
2813 v.Data() + src_offset); | 2824 v.Data() + src_offset); |
2814 } | 2825 } |
2815 | 2826 |
2816 void WebGL2RenderingContextBase::uniformMatrix3fv( | 2827 void WebGL2RenderingContextBase::uniformMatrix3fv( |
2817 const WebGLUniformLocation* location, | 2828 const WebGLUniformLocation* location, |
2818 GLboolean transpose, | 2829 GLboolean transpose, |
2819 DOMFloat32Array* v, | 2830 NotShared<DOMFloat32Array> v, |
2820 GLuint src_offset, | 2831 GLuint src_offset, |
2821 GLuint src_length) { | 2832 GLuint src_length) { |
2822 if (isContextLost() || | 2833 if (isContextLost() || |
2823 !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, | 2834 !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, |
2824 v, 9, src_offset, src_length)) | 2835 v.View(), 9, src_offset, src_length)) |
2825 return; | 2836 return; |
2826 ContextGL()->UniformMatrix3fv( | 2837 ContextGL()->UniformMatrix3fv( |
2827 location->Location(), | 2838 location->Location(), |
2828 (src_length ? src_length : (v->length() - src_offset)) / 9, transpose, | 2839 (src_length ? src_length : (v.View()->length() - src_offset)) / 9, |
2829 v->Data() + src_offset); | 2840 transpose, v.View()->Data() + src_offset); |
2830 } | 2841 } |
2831 | 2842 |
2832 void WebGL2RenderingContextBase::uniformMatrix3fv( | 2843 void WebGL2RenderingContextBase::uniformMatrix3fv( |
2833 const WebGLUniformLocation* location, | 2844 const WebGLUniformLocation* location, |
2834 GLboolean transpose, | 2845 GLboolean transpose, |
2835 Vector<GLfloat>& v, | 2846 Vector<GLfloat>& v, |
2836 GLuint src_offset, | 2847 GLuint src_offset, |
2837 GLuint src_length) { | 2848 GLuint src_length) { |
2838 if (isContextLost() || !ValidateUniformMatrixParameters( | 2849 if (isContextLost() || !ValidateUniformMatrixParameters( |
2839 "uniformMatrix3fv", location, transpose, v.Data(), | 2850 "uniformMatrix3fv", location, transpose, v.Data(), |
2840 v.size(), 9, src_offset, src_length)) | 2851 v.size(), 9, src_offset, src_length)) |
2841 return; | 2852 return; |
2842 ContextGL()->UniformMatrix3fv( | 2853 ContextGL()->UniformMatrix3fv( |
2843 location->Location(), | 2854 location->Location(), |
2844 (src_length ? src_length : (v.size() - src_offset)) / 9, transpose, | 2855 (src_length ? src_length : (v.size() - src_offset)) / 9, transpose, |
2845 v.Data() + src_offset); | 2856 v.Data() + src_offset); |
2846 } | 2857 } |
2847 | 2858 |
2848 void WebGL2RenderingContextBase::uniformMatrix4fv( | 2859 void WebGL2RenderingContextBase::uniformMatrix4fv( |
2849 const WebGLUniformLocation* location, | 2860 const WebGLUniformLocation* location, |
2850 GLboolean transpose, | 2861 GLboolean transpose, |
2851 DOMFloat32Array* v, | 2862 NotShared<DOMFloat32Array> v, |
2852 GLuint src_offset, | 2863 GLuint src_offset, |
2853 GLuint src_length) { | 2864 GLuint src_length) { |
2854 if (isContextLost() || | 2865 if (isContextLost() || |
2855 !ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose, | 2866 !ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose, |
2856 v, 16, src_offset, src_length)) | 2867 v.View(), 16, src_offset, src_length)) |
2857 return; | 2868 return; |
2858 ContextGL()->UniformMatrix4fv( | 2869 ContextGL()->UniformMatrix4fv( |
2859 location->Location(), | 2870 location->Location(), |
2860 (src_length ? src_length : (v->length() - src_offset)) >> 4, transpose, | 2871 (src_length ? src_length : (v.View()->length() - src_offset)) >> 4, |
2861 v->Data() + src_offset); | 2872 transpose, v.View()->Data() + src_offset); |
2862 } | 2873 } |
2863 | 2874 |
2864 void WebGL2RenderingContextBase::uniformMatrix4fv( | 2875 void WebGL2RenderingContextBase::uniformMatrix4fv( |
2865 const WebGLUniformLocation* location, | 2876 const WebGLUniformLocation* location, |
2866 GLboolean transpose, | 2877 GLboolean transpose, |
2867 Vector<GLfloat>& v, | 2878 Vector<GLfloat>& v, |
2868 GLuint src_offset, | 2879 GLuint src_offset, |
2869 GLuint src_length) { | 2880 GLuint src_length) { |
2870 if (isContextLost() || !ValidateUniformMatrixParameters( | 2881 if (isContextLost() || !ValidateUniformMatrixParameters( |
2871 "uniformMatrix4fv", location, transpose, v.Data(), | 2882 "uniformMatrix4fv", location, transpose, v.Data(), |
2872 v.size(), 16, src_offset, src_length)) | 2883 v.size(), 16, src_offset, src_length)) |
2873 return; | 2884 return; |
2874 ContextGL()->UniformMatrix4fv( | 2885 ContextGL()->UniformMatrix4fv( |
2875 location->Location(), | 2886 location->Location(), |
2876 (src_length ? src_length : (v.size() - src_offset)) >> 4, transpose, | 2887 (src_length ? src_length : (v.size() - src_offset)) >> 4, transpose, |
2877 v.Data() + src_offset); | 2888 v.Data() + src_offset); |
2878 } | 2889 } |
2879 | 2890 |
2880 void WebGL2RenderingContextBase::uniformMatrix2x3fv( | 2891 void WebGL2RenderingContextBase::uniformMatrix2x3fv( |
2881 const WebGLUniformLocation* location, | 2892 const WebGLUniformLocation* location, |
2882 GLboolean transpose, | 2893 GLboolean transpose, |
2883 DOMFloat32Array* value, | 2894 NotShared<DOMFloat32Array> value, |
2884 GLuint src_offset, | 2895 GLuint src_offset, |
2885 GLuint src_length) { | 2896 GLuint src_length) { |
2886 if (isContextLost() || !ValidateUniformMatrixParameters( | 2897 if (isContextLost() || !ValidateUniformMatrixParameters( |
2887 "uniformMatrix2x3fv", location, transpose, value, | 2898 "uniformMatrix2x3fv", location, transpose, |
2888 6, src_offset, src_length)) | 2899 value.View(), 6, src_offset, src_length)) |
2889 return; | 2900 return; |
2890 ContextGL()->UniformMatrix2x3fv( | 2901 ContextGL()->UniformMatrix2x3fv( |
2891 location->Location(), | 2902 location->Location(), |
2892 (src_length ? src_length : (value->length() - src_offset)) / 6, transpose, | 2903 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, |
2893 value->Data() + src_offset); | 2904 transpose, value.View()->Data() + src_offset); |
2894 } | 2905 } |
2895 | 2906 |
2896 void WebGL2RenderingContextBase::uniformMatrix2x3fv( | 2907 void WebGL2RenderingContextBase::uniformMatrix2x3fv( |
2897 const WebGLUniformLocation* location, | 2908 const WebGLUniformLocation* location, |
2898 GLboolean transpose, | 2909 GLboolean transpose, |
2899 Vector<GLfloat>& value, | 2910 Vector<GLfloat>& value, |
2900 GLuint src_offset, | 2911 GLuint src_offset, |
2901 GLuint src_length) { | 2912 GLuint src_length) { |
2902 if (isContextLost() || | 2913 if (isContextLost() || |
2903 !ValidateUniformMatrixParameters("uniformMatrix2x3fv", location, | 2914 !ValidateUniformMatrixParameters("uniformMatrix2x3fv", location, |
2904 transpose, value.Data(), value.size(), 6, | 2915 transpose, value.Data(), value.size(), 6, |
2905 src_offset, src_length)) | 2916 src_offset, src_length)) |
2906 return; | 2917 return; |
2907 ContextGL()->UniformMatrix2x3fv( | 2918 ContextGL()->UniformMatrix2x3fv( |
2908 location->Location(), | 2919 location->Location(), |
2909 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, | 2920 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, |
2910 value.Data() + src_offset); | 2921 value.Data() + src_offset); |
2911 } | 2922 } |
2912 | 2923 |
2913 void WebGL2RenderingContextBase::uniformMatrix3x2fv( | 2924 void WebGL2RenderingContextBase::uniformMatrix3x2fv( |
2914 const WebGLUniformLocation* location, | 2925 const WebGLUniformLocation* location, |
2915 GLboolean transpose, | 2926 GLboolean transpose, |
2916 DOMFloat32Array* value, | 2927 NotShared<DOMFloat32Array> value, |
2917 GLuint src_offset, | 2928 GLuint src_offset, |
2918 GLuint src_length) { | 2929 GLuint src_length) { |
2919 if (isContextLost() || !ValidateUniformMatrixParameters( | 2930 if (isContextLost() || !ValidateUniformMatrixParameters( |
2920 "uniformMatrix3x2fv", location, transpose, value, | 2931 "uniformMatrix3x2fv", location, transpose, |
2921 6, src_offset, src_length)) | 2932 value.View(), 6, src_offset, src_length)) |
2922 return; | 2933 return; |
2923 ContextGL()->UniformMatrix3x2fv( | 2934 ContextGL()->UniformMatrix3x2fv( |
2924 location->Location(), | 2935 location->Location(), |
2925 (src_length ? src_length : (value->length() - src_offset)) / 6, transpose, | 2936 (src_length ? src_length : (value.View()->length() - src_offset)) / 6, |
2926 value->Data() + src_offset); | 2937 transpose, value.View()->Data() + src_offset); |
2927 } | 2938 } |
2928 | 2939 |
2929 void WebGL2RenderingContextBase::uniformMatrix3x2fv( | 2940 void WebGL2RenderingContextBase::uniformMatrix3x2fv( |
2930 const WebGLUniformLocation* location, | 2941 const WebGLUniformLocation* location, |
2931 GLboolean transpose, | 2942 GLboolean transpose, |
2932 Vector<GLfloat>& value, | 2943 Vector<GLfloat>& value, |
2933 GLuint src_offset, | 2944 GLuint src_offset, |
2934 GLuint src_length) { | 2945 GLuint src_length) { |
2935 if (isContextLost() || | 2946 if (isContextLost() || |
2936 !ValidateUniformMatrixParameters("uniformMatrix3x2fv", location, | 2947 !ValidateUniformMatrixParameters("uniformMatrix3x2fv", location, |
2937 transpose, value.Data(), value.size(), 6, | 2948 transpose, value.Data(), value.size(), 6, |
2938 src_offset, src_length)) | 2949 src_offset, src_length)) |
2939 return; | 2950 return; |
2940 ContextGL()->UniformMatrix3x2fv( | 2951 ContextGL()->UniformMatrix3x2fv( |
2941 location->Location(), | 2952 location->Location(), |
2942 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, | 2953 (src_length ? src_length : (value.size() - src_offset)) / 6, transpose, |
2943 value.Data() + src_offset); | 2954 value.Data() + src_offset); |
2944 } | 2955 } |
2945 | 2956 |
2946 void WebGL2RenderingContextBase::uniformMatrix2x4fv( | 2957 void WebGL2RenderingContextBase::uniformMatrix2x4fv( |
2947 const WebGLUniformLocation* location, | 2958 const WebGLUniformLocation* location, |
2948 GLboolean transpose, | 2959 GLboolean transpose, |
2949 DOMFloat32Array* value, | 2960 NotShared<DOMFloat32Array> value, |
2950 GLuint src_offset, | 2961 GLuint src_offset, |
2951 GLuint src_length) { | 2962 GLuint src_length) { |
2952 if (isContextLost() || !ValidateUniformMatrixParameters( | 2963 if (isContextLost() || !ValidateUniformMatrixParameters( |
2953 "uniformMatrix2x4fv", location, transpose, value, | 2964 "uniformMatrix2x4fv", location, transpose, |
2954 8, src_offset, src_length)) | 2965 value.View(), 8, src_offset, src_length)) |
2955 return; | 2966 return; |
2956 ContextGL()->UniformMatrix2x4fv( | 2967 ContextGL()->UniformMatrix2x4fv( |
2957 location->Location(), | 2968 location->Location(), |
2958 (src_length ? src_length : (value->length() - src_offset)) >> 3, | 2969 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, |
2959 transpose, value->Data() + src_offset); | 2970 transpose, value.View()->Data() + src_offset); |
2960 } | 2971 } |
2961 | 2972 |
2962 void WebGL2RenderingContextBase::uniformMatrix2x4fv( | 2973 void WebGL2RenderingContextBase::uniformMatrix2x4fv( |
2963 const WebGLUniformLocation* location, | 2974 const WebGLUniformLocation* location, |
2964 GLboolean transpose, | 2975 GLboolean transpose, |
2965 Vector<GLfloat>& value, | 2976 Vector<GLfloat>& value, |
2966 GLuint src_offset, | 2977 GLuint src_offset, |
2967 GLuint src_length) { | 2978 GLuint src_length) { |
2968 if (isContextLost() || | 2979 if (isContextLost() || |
2969 !ValidateUniformMatrixParameters("uniformMatrix2x4fv", location, | 2980 !ValidateUniformMatrixParameters("uniformMatrix2x4fv", location, |
2970 transpose, value.Data(), value.size(), 8, | 2981 transpose, value.Data(), value.size(), 8, |
2971 src_offset, src_length)) | 2982 src_offset, src_length)) |
2972 return; | 2983 return; |
2973 ContextGL()->UniformMatrix2x4fv( | 2984 ContextGL()->UniformMatrix2x4fv( |
2974 location->Location(), | 2985 location->Location(), |
2975 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, | 2986 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, |
2976 value.Data() + src_offset); | 2987 value.Data() + src_offset); |
2977 } | 2988 } |
2978 | 2989 |
2979 void WebGL2RenderingContextBase::uniformMatrix4x2fv( | 2990 void WebGL2RenderingContextBase::uniformMatrix4x2fv( |
2980 const WebGLUniformLocation* location, | 2991 const WebGLUniformLocation* location, |
2981 GLboolean transpose, | 2992 GLboolean transpose, |
2982 DOMFloat32Array* value, | 2993 NotShared<DOMFloat32Array> value, |
2983 GLuint src_offset, | 2994 GLuint src_offset, |
2984 GLuint src_length) { | 2995 GLuint src_length) { |
2985 if (isContextLost() || !ValidateUniformMatrixParameters( | 2996 if (isContextLost() || !ValidateUniformMatrixParameters( |
2986 "uniformMatrix4x2fv", location, transpose, value, | 2997 "uniformMatrix4x2fv", location, transpose, |
2987 8, src_offset, src_length)) | 2998 value.View(), 8, src_offset, src_length)) |
2988 return; | 2999 return; |
2989 ContextGL()->UniformMatrix4x2fv( | 3000 ContextGL()->UniformMatrix4x2fv( |
2990 location->Location(), | 3001 location->Location(), |
2991 (src_length ? src_length : (value->length() - src_offset)) >> 3, | 3002 (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, |
2992 transpose, value->Data() + src_offset); | 3003 transpose, value.View()->Data() + src_offset); |
2993 } | 3004 } |
2994 | 3005 |
2995 void WebGL2RenderingContextBase::uniformMatrix4x2fv( | 3006 void WebGL2RenderingContextBase::uniformMatrix4x2fv( |
2996 const WebGLUniformLocation* location, | 3007 const WebGLUniformLocation* location, |
2997 GLboolean transpose, | 3008 GLboolean transpose, |
2998 Vector<GLfloat>& value, | 3009 Vector<GLfloat>& value, |
2999 GLuint src_offset, | 3010 GLuint src_offset, |
3000 GLuint src_length) { | 3011 GLuint src_length) { |
3001 if (isContextLost() || | 3012 if (isContextLost() || |
3002 !ValidateUniformMatrixParameters("uniformMatrix4x2fv", location, | 3013 !ValidateUniformMatrixParameters("uniformMatrix4x2fv", location, |
3003 transpose, value.Data(), value.size(), 8, | 3014 transpose, value.Data(), value.size(), 8, |
3004 src_offset, src_length)) | 3015 src_offset, src_length)) |
3005 return; | 3016 return; |
3006 ContextGL()->UniformMatrix4x2fv( | 3017 ContextGL()->UniformMatrix4x2fv( |
3007 location->Location(), | 3018 location->Location(), |
3008 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, | 3019 (src_length ? src_length : (value.size() - src_offset)) >> 3, transpose, |
3009 value.Data() + src_offset); | 3020 value.Data() + src_offset); |
3010 } | 3021 } |
3011 | 3022 |
3012 void WebGL2RenderingContextBase::uniformMatrix3x4fv( | 3023 void WebGL2RenderingContextBase::uniformMatrix3x4fv( |
3013 const WebGLUniformLocation* location, | 3024 const WebGLUniformLocation* location, |
3014 GLboolean transpose, | 3025 GLboolean transpose, |
3015 DOMFloat32Array* value, | 3026 NotShared<DOMFloat32Array> value, |
3016 GLuint src_offset, | 3027 GLuint src_offset, |
3017 GLuint src_length) { | 3028 GLuint src_length) { |
3018 if (isContextLost() || !ValidateUniformMatrixParameters( | 3029 if (isContextLost() || !ValidateUniformMatrixParameters( |
3019 "uniformMatrix3x4fv", location, transpose, value, | 3030 "uniformMatrix3x4fv", location, transpose, |
3020 12, src_offset, src_length)) | 3031 value.View(), 12, src_offset, src_length)) |
3021 return; | 3032 return; |
3022 ContextGL()->UniformMatrix3x4fv( | 3033 ContextGL()->UniformMatrix3x4fv( |
3023 location->Location(), | 3034 location->Location(), |
3024 (src_length ? src_length : (value->length() - src_offset)) / 12, | 3035 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, |
3025 transpose, value->Data() + src_offset); | 3036 transpose, value.View()->Data() + src_offset); |
3026 } | 3037 } |
3027 | 3038 |
3028 void WebGL2RenderingContextBase::uniformMatrix3x4fv( | 3039 void WebGL2RenderingContextBase::uniformMatrix3x4fv( |
3029 const WebGLUniformLocation* location, | 3040 const WebGLUniformLocation* location, |
3030 GLboolean transpose, | 3041 GLboolean transpose, |
3031 Vector<GLfloat>& value, | 3042 Vector<GLfloat>& value, |
3032 GLuint src_offset, | 3043 GLuint src_offset, |
3033 GLuint src_length) { | 3044 GLuint src_length) { |
3034 if (isContextLost() || | 3045 if (isContextLost() || |
3035 !ValidateUniformMatrixParameters("uniformMatrix3x4fv", location, | 3046 !ValidateUniformMatrixParameters("uniformMatrix3x4fv", location, |
3036 transpose, value.Data(), value.size(), | 3047 transpose, value.Data(), value.size(), |
3037 12, src_offset, src_length)) | 3048 12, src_offset, src_length)) |
3038 return; | 3049 return; |
3039 ContextGL()->UniformMatrix3x4fv( | 3050 ContextGL()->UniformMatrix3x4fv( |
3040 location->Location(), | 3051 location->Location(), |
3041 (src_length ? src_length : (value.size() - src_offset)) / 12, transpose, | 3052 (src_length ? src_length : (value.size() - src_offset)) / 12, transpose, |
3042 value.Data() + src_offset); | 3053 value.Data() + src_offset); |
3043 } | 3054 } |
3044 | 3055 |
3045 void WebGL2RenderingContextBase::uniformMatrix4x3fv( | 3056 void WebGL2RenderingContextBase::uniformMatrix4x3fv( |
3046 const WebGLUniformLocation* location, | 3057 const WebGLUniformLocation* location, |
3047 GLboolean transpose, | 3058 GLboolean transpose, |
3048 DOMFloat32Array* value, | 3059 NotShared<DOMFloat32Array> value, |
3049 GLuint src_offset, | 3060 GLuint src_offset, |
3050 GLuint src_length) { | 3061 GLuint src_length) { |
3051 if (isContextLost() || !ValidateUniformMatrixParameters( | 3062 if (isContextLost() || !ValidateUniformMatrixParameters( |
3052 "uniformMatrix4x3fv", location, transpose, value, | 3063 "uniformMatrix4x3fv", location, transpose, |
3053 12, src_offset, src_length)) | 3064 value.View(), 12, src_offset, src_length)) |
3054 return; | 3065 return; |
3055 ContextGL()->UniformMatrix4x3fv( | 3066 ContextGL()->UniformMatrix4x3fv( |
3056 location->Location(), | 3067 location->Location(), |
3057 (src_length ? src_length : (value->length() - src_offset)) / 12, | 3068 (src_length ? src_length : (value.View()->length() - src_offset)) / 12, |
3058 transpose, value->Data() + src_offset); | 3069 transpose, value.View()->Data() + src_offset); |
3059 } | 3070 } |
3060 | 3071 |
3061 void WebGL2RenderingContextBase::uniformMatrix4x3fv( | 3072 void WebGL2RenderingContextBase::uniformMatrix4x3fv( |
3062 const WebGLUniformLocation* location, | 3073 const WebGLUniformLocation* location, |
3063 GLboolean transpose, | 3074 GLboolean transpose, |
3064 Vector<GLfloat>& value, | 3075 Vector<GLfloat>& value, |
3065 GLuint src_offset, | 3076 GLuint src_offset, |
3066 GLuint src_length) { | 3077 GLuint src_length) { |
3067 if (isContextLost() || | 3078 if (isContextLost() || |
3068 !ValidateUniformMatrixParameters("uniformMatrix4x3fv", location, | 3079 !ValidateUniformMatrixParameters("uniformMatrix4x3fv", location, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3167 | 3178 |
3168 void WebGL2RenderingContextBase::uniform4iv( | 3179 void WebGL2RenderingContextBase::uniform4iv( |
3169 const WebGLUniformLocation* location, | 3180 const WebGLUniformLocation* location, |
3170 Vector<GLint>& v) { | 3181 Vector<GLint>& v) { |
3171 WebGLRenderingContextBase::uniform4iv(location, v); | 3182 WebGLRenderingContextBase::uniform4iv(location, v); |
3172 } | 3183 } |
3173 | 3184 |
3174 void WebGL2RenderingContextBase::uniformMatrix2fv( | 3185 void WebGL2RenderingContextBase::uniformMatrix2fv( |
3175 const WebGLUniformLocation* location, | 3186 const WebGLUniformLocation* location, |
3176 GLboolean transpose, | 3187 GLboolean transpose, |
3177 DOMFloat32Array* v) { | 3188 NotShared<DOMFloat32Array> v) { |
3178 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); | 3189 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); |
3179 } | 3190 } |
3180 | 3191 |
3181 void WebGL2RenderingContextBase::uniformMatrix2fv( | 3192 void WebGL2RenderingContextBase::uniformMatrix2fv( |
3182 const WebGLUniformLocation* location, | 3193 const WebGLUniformLocation* location, |
3183 GLboolean transpose, | 3194 GLboolean transpose, |
3184 Vector<GLfloat>& v) { | 3195 Vector<GLfloat>& v) { |
3185 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); | 3196 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); |
3186 } | 3197 } |
3187 | 3198 |
3188 void WebGL2RenderingContextBase::uniformMatrix3fv( | 3199 void WebGL2RenderingContextBase::uniformMatrix3fv( |
3189 const WebGLUniformLocation* location, | 3200 const WebGLUniformLocation* location, |
3190 GLboolean transpose, | 3201 GLboolean transpose, |
3191 DOMFloat32Array* v) { | 3202 NotShared<DOMFloat32Array> v) { |
3192 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); | 3203 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); |
3193 } | 3204 } |
3194 | 3205 |
3195 void WebGL2RenderingContextBase::uniformMatrix3fv( | 3206 void WebGL2RenderingContextBase::uniformMatrix3fv( |
3196 const WebGLUniformLocation* location, | 3207 const WebGLUniformLocation* location, |
3197 GLboolean transpose, | 3208 GLboolean transpose, |
3198 Vector<GLfloat>& v) { | 3209 Vector<GLfloat>& v) { |
3199 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); | 3210 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); |
3200 } | 3211 } |
3201 | 3212 |
3202 void WebGL2RenderingContextBase::uniformMatrix4fv( | 3213 void WebGL2RenderingContextBase::uniformMatrix4fv( |
3203 const WebGLUniformLocation* location, | 3214 const WebGLUniformLocation* location, |
3204 GLboolean transpose, | 3215 GLboolean transpose, |
3205 DOMFloat32Array* v) { | 3216 NotShared<DOMFloat32Array> v) { |
3206 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); | 3217 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); |
3207 } | 3218 } |
3208 | 3219 |
3209 void WebGL2RenderingContextBase::uniformMatrix4fv( | 3220 void WebGL2RenderingContextBase::uniformMatrix4fv( |
3210 const WebGLUniformLocation* location, | 3221 const WebGLUniformLocation* location, |
3211 GLboolean transpose, | 3222 GLboolean transpose, |
3212 Vector<GLfloat>& v) { | 3223 Vector<GLfloat>& v) { |
3213 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); | 3224 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); |
3214 } | 3225 } |
3215 | 3226 |
3216 void WebGL2RenderingContextBase::vertexAttribI4i(GLuint index, | 3227 void WebGL2RenderingContextBase::vertexAttribI4i(GLuint index, |
3217 GLint x, | 3228 GLint x, |
3218 GLint y, | 3229 GLint y, |
3219 GLint z, | 3230 GLint z, |
3220 GLint w) { | 3231 GLint w) { |
3221 if (isContextLost()) | 3232 if (isContextLost()) |
3222 return; | 3233 return; |
3223 ContextGL()->VertexAttribI4i(index, x, y, z, w); | 3234 ContextGL()->VertexAttribI4i(index, x, y, z, w); |
3224 SetVertexAttribType(index, kInt32ArrayType); | 3235 SetVertexAttribType(index, kInt32ArrayType); |
3225 } | 3236 } |
3226 | 3237 |
3227 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, | 3238 void WebGL2RenderingContextBase::vertexAttribI4iv( |
3228 const DOMInt32Array* v) { | 3239 GLuint index, |
| 3240 NotShared<const DOMInt32Array> v) { |
3229 if (isContextLost()) | 3241 if (isContextLost()) |
3230 return; | 3242 return; |
3231 if (!v || v->length() < 4) { | 3243 if (!v.View() || v.View()->length() < 4) { |
3232 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); | 3244 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); |
3233 return; | 3245 return; |
3234 } | 3246 } |
3235 ContextGL()->VertexAttribI4iv(index, v->Data()); | 3247 ContextGL()->VertexAttribI4iv(index, v.View()->Data()); |
3236 SetVertexAttribType(index, kInt32ArrayType); | 3248 SetVertexAttribType(index, kInt32ArrayType); |
3237 } | 3249 } |
3238 | 3250 |
3239 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, | 3251 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, |
3240 const Vector<GLint>& v) { | 3252 const Vector<GLint>& v) { |
3241 if (isContextLost()) | 3253 if (isContextLost()) |
3242 return; | 3254 return; |
3243 if (v.size() < 4) { | 3255 if (v.size() < 4) { |
3244 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); | 3256 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); |
3245 return; | 3257 return; |
3246 } | 3258 } |
3247 ContextGL()->VertexAttribI4iv(index, v.Data()); | 3259 ContextGL()->VertexAttribI4iv(index, v.Data()); |
3248 SetVertexAttribType(index, kInt32ArrayType); | 3260 SetVertexAttribType(index, kInt32ArrayType); |
3249 } | 3261 } |
3250 | 3262 |
3251 void WebGL2RenderingContextBase::vertexAttribI4ui(GLuint index, | 3263 void WebGL2RenderingContextBase::vertexAttribI4ui(GLuint index, |
3252 GLuint x, | 3264 GLuint x, |
3253 GLuint y, | 3265 GLuint y, |
3254 GLuint z, | 3266 GLuint z, |
3255 GLuint w) { | 3267 GLuint w) { |
3256 if (isContextLost()) | 3268 if (isContextLost()) |
3257 return; | 3269 return; |
3258 ContextGL()->VertexAttribI4ui(index, x, y, z, w); | 3270 ContextGL()->VertexAttribI4ui(index, x, y, z, w); |
3259 SetVertexAttribType(index, kUint32ArrayType); | 3271 SetVertexAttribType(index, kUint32ArrayType); |
3260 } | 3272 } |
3261 | 3273 |
3262 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, | 3274 void WebGL2RenderingContextBase::vertexAttribI4uiv( |
3263 const DOMUint32Array* v) { | 3275 GLuint index, |
| 3276 NotShared<const DOMUint32Array> v) { |
3264 if (isContextLost()) | 3277 if (isContextLost()) |
3265 return; | 3278 return; |
3266 if (!v || v->length() < 4) { | 3279 if (!v.View() || v.View()->length() < 4) { |
3267 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); | 3280 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); |
3268 return; | 3281 return; |
3269 } | 3282 } |
3270 ContextGL()->VertexAttribI4uiv(index, v->Data()); | 3283 ContextGL()->VertexAttribI4uiv(index, v.View()->Data()); |
3271 SetVertexAttribType(index, kUint32ArrayType); | 3284 SetVertexAttribType(index, kUint32ArrayType); |
3272 } | 3285 } |
3273 | 3286 |
3274 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, | 3287 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, |
3275 const Vector<GLuint>& v) { | 3288 const Vector<GLuint>& v) { |
3276 if (isContextLost()) | 3289 if (isContextLost()) |
3277 return; | 3290 return; |
3278 if (v.size() < 4) { | 3291 if (v.size() < 4) { |
3279 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); | 3292 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); |
3280 return; | 3293 return; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3478 const char* func_name, | 3491 const char* func_name, |
3479 TexImageFunctionID function_id, | 3492 TexImageFunctionID function_id, |
3480 GLenum target) { | 3493 GLenum target) { |
3481 if (function_id == kTexImage3D || function_id == kTexSubImage3D) | 3494 if (function_id == kTexImage3D || function_id == kTexSubImage3D) |
3482 return ValidateTexture3DBinding(func_name, target); | 3495 return ValidateTexture3DBinding(func_name, target); |
3483 return ValidateTexture2DBinding(func_name, target); | 3496 return ValidateTexture2DBinding(func_name, target); |
3484 } | 3497 } |
3485 | 3498 |
3486 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, | 3499 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, |
3487 GLint drawbuffer, | 3500 GLint drawbuffer, |
3488 DOMInt32Array* value) { | 3501 NotShared<DOMInt32Array> value) { |
3489 if (isContextLost() || | 3502 if (isContextLost() || |
3490 !ValidateClearBuffer("clearBufferiv", buffer, value->length())) | 3503 !ValidateClearBuffer("clearBufferiv", buffer, value.View()->length())) |
3491 return; | 3504 return; |
3492 | 3505 |
3493 ContextGL()->ClearBufferiv(buffer, drawbuffer, value->Data()); | 3506 ContextGL()->ClearBufferiv(buffer, drawbuffer, value.View()->Data()); |
3494 } | 3507 } |
3495 | 3508 |
3496 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, | 3509 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, |
3497 GLint drawbuffer, | 3510 GLint drawbuffer, |
3498 const Vector<GLint>& value) { | 3511 const Vector<GLint>& value) { |
3499 if (isContextLost() || | 3512 if (isContextLost() || |
3500 !ValidateClearBuffer("clearBufferiv", buffer, value.size())) | 3513 !ValidateClearBuffer("clearBufferiv", buffer, value.size())) |
3501 return; | 3514 return; |
3502 | 3515 |
3503 ContextGL()->ClearBufferiv(buffer, drawbuffer, value.Data()); | 3516 ContextGL()->ClearBufferiv(buffer, drawbuffer, value.Data()); |
3504 } | 3517 } |
3505 | 3518 |
3506 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, | 3519 void WebGL2RenderingContextBase::clearBufferuiv( |
3507 GLint drawbuffer, | 3520 GLenum buffer, |
3508 DOMUint32Array* value) { | 3521 GLint drawbuffer, |
| 3522 NotShared<DOMUint32Array> value) { |
3509 if (isContextLost() || | 3523 if (isContextLost() || |
3510 !ValidateClearBuffer("clearBufferuiv", buffer, value->length())) | 3524 !ValidateClearBuffer("clearBufferuiv", buffer, value.View()->length())) |
3511 return; | 3525 return; |
3512 | 3526 |
3513 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value->Data()); | 3527 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.View()->Data()); |
3514 } | 3528 } |
3515 | 3529 |
3516 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, | 3530 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, |
3517 GLint drawbuffer, | 3531 GLint drawbuffer, |
3518 const Vector<GLuint>& value) { | 3532 const Vector<GLuint>& value) { |
3519 if (isContextLost() || | 3533 if (isContextLost() || |
3520 !ValidateClearBuffer("clearBufferuiv", buffer, value.size())) | 3534 !ValidateClearBuffer("clearBufferuiv", buffer, value.size())) |
3521 return; | 3535 return; |
3522 | 3536 |
3523 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.Data()); | 3537 ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.Data()); |
3524 } | 3538 } |
3525 | 3539 |
3526 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, | 3540 void WebGL2RenderingContextBase::clearBufferfv( |
3527 GLint drawbuffer, | 3541 GLenum buffer, |
3528 DOMFloat32Array* value) { | 3542 GLint drawbuffer, |
| 3543 NotShared<DOMFloat32Array> value) { |
3529 if (isContextLost() || | 3544 if (isContextLost() || |
3530 !ValidateClearBuffer("clearBufferfv", buffer, value->length())) | 3545 !ValidateClearBuffer("clearBufferfv", buffer, value.View()->length())) |
3531 return; | 3546 return; |
3532 | 3547 |
3533 ContextGL()->ClearBufferfv(buffer, drawbuffer, value->Data()); | 3548 ContextGL()->ClearBufferfv(buffer, drawbuffer, value.View()->Data()); |
3534 } | 3549 } |
3535 | 3550 |
3536 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, | 3551 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, |
3537 GLint drawbuffer, | 3552 GLint drawbuffer, |
3538 const Vector<GLfloat>& value) { | 3553 const Vector<GLfloat>& value) { |
3539 if (isContextLost() || | 3554 if (isContextLost() || |
3540 !ValidateClearBuffer("clearBufferfv", buffer, value.size())) | 3555 !ValidateClearBuffer("clearBufferfv", buffer, value.size())) |
3541 return; | 3556 return; |
3542 | 3557 |
3543 ContextGL()->ClearBufferfv(buffer, drawbuffer, value.Data()); | 3558 ContextGL()->ClearBufferfv(buffer, drawbuffer, value.Data()); |
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5675 | 5690 |
5676 void WebGL2RenderingContextBase:: | 5691 void WebGL2RenderingContextBase:: |
5677 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 5692 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
5678 if (!ContextGL()) | 5693 if (!ContextGL()) |
5679 return; | 5694 return; |
5680 ContextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 5695 ContextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
5681 ObjectOrZero(bound_pixel_unpack_buffer_.Get())); | 5696 ObjectOrZero(bound_pixel_unpack_buffer_.Get())); |
5682 } | 5697 } |
5683 | 5698 |
5684 } // namespace blink | 5699 } // namespace blink |
OLD | NEW |