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