Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: add some layout tests Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
241 m_packSkipRows = 0; 241 m_packSkipRows = 0;
242 m_unpackRowLength = 0; 242 m_unpackRowLength = 0;
243 m_unpackImageHeight = 0; 243 m_unpackImageHeight = 0;
244 m_unpackSkipPixels = 0; 244 m_unpackSkipPixels = 0;
245 m_unpackSkipRows = 0; 245 m_unpackSkipRows = 0;
246 m_unpackSkipImages = 0; 246 m_unpackSkipImages = 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* srcData, 252 GLenum target,
253 GLenum usage, 253 NotShared<DOMArrayBufferView> srcData,
254 GLuint srcOffset, 254 GLenum usage,
255 GLuint length) { 255 GLuint srcOffset,
256 GLuint length) {
256 if (isContextLost()) 257 if (isContextLost())
257 return; 258 return;
258 void* subBaseAddress = nullptr; 259 void* subBaseAddress = nullptr;
259 long long subByteLength = 0; 260 long long subByteLength = 0;
260 if (!validateSubSourceAndGetData(srcData, srcOffset, length, &subBaseAddress, 261 if (!validateSubSourceAndGetData(srcData.view(), srcOffset, length,
261 &subByteLength)) { 262 &subBaseAddress, &subByteLength)) {
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, subByteLength, subBaseAddress, usage); 267 bufferDataImpl(target, subByteLength, subBaseAddress, 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 dstByteOffset, 289 GLenum target,
289 DOMArrayBufferView* srcData, 290 GLintptr dstByteOffset,
290 GLuint srcOffset, 291 NotShared<DOMArrayBufferView> srcData,
291 GLuint length) { 292 GLuint srcOffset,
293 GLuint length) {
292 if (isContextLost()) 294 if (isContextLost())
293 return; 295 return;
294 void* subBaseAddress = nullptr; 296 void* subBaseAddress = nullptr;
295 long long subByteLength = 0; 297 long long subByteLength = 0;
296 if (!validateSubSourceAndGetData(srcData, srcOffset, length, &subBaseAddress, 298 if (!validateSubSourceAndGetData(srcData.view(), srcOffset, length,
297 &subByteLength)) { 299 &subBaseAddress, &subByteLength)) {
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, dstByteOffset, subByteLength, subBaseAddress); 304 bufferSubDataImpl(target, dstByteOffset, subByteLength, subBaseAddress);
303 } 305 }
304 306
305 void WebGL2RenderingContextBase::bufferSubData(GLenum target, 307 void WebGL2RenderingContextBase::bufferSubData(GLenum target,
306 long long offset, 308 long long offset,
307 DOMArrayBuffer* data) { 309 DOMArrayBuffer* data) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 } 360 }
359 361
360 if (writeBuffer->getInitialTarget() == 0) 362 if (writeBuffer->getInitialTarget() == 0)
361 writeBuffer->setInitialTarget(readBuffer->getInitialTarget()); 363 writeBuffer->setInitialTarget(readBuffer->getInitialTarget());
362 364
363 contextGL()->CopyBufferSubData( 365 contextGL()->CopyBufferSubData(
364 readTarget, writeTarget, static_cast<GLintptr>(readOffset), 366 readTarget, writeTarget, static_cast<GLintptr>(readOffset),
365 static_cast<GLintptr>(writeOffset), static_cast<GLsizeiptr>(size)); 367 static_cast<GLintptr>(writeOffset), static_cast<GLsizeiptr>(size));
366 } 368 }
367 369
368 void WebGL2RenderingContextBase::getBufferSubData(GLenum target, 370 void WebGL2RenderingContextBase::getBufferSubData(
369 long long srcByteOffset, 371 GLenum target,
370 DOMArrayBufferView* dstData, 372 long long srcByteOffset,
371 GLuint dstOffset, 373 NotShared<DOMArrayBufferView> dstData,
372 GLuint length) { 374 GLuint dstOffset,
375 GLuint length) {
373 WebGLBuffer* sourceBuffer = nullptr; 376 WebGLBuffer* sourceBuffer = nullptr;
374 void* destinationDataPtr = nullptr; 377 void* destinationDataPtr = nullptr;
375 long long destinationByteLength = 0; 378 long long destinationByteLength = 0;
376 const char* message = validateGetBufferSubData( 379 const char* message = validateGetBufferSubData(
377 __FUNCTION__, target, srcByteOffset, dstData, dstOffset, length, 380 __FUNCTION__, target, srcByteOffset, dstData.view(), dstOffset, length,
378 &sourceBuffer, &destinationDataPtr, &destinationByteLength); 381 &sourceBuffer, &destinationDataPtr, &destinationByteLength);
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 (!destinationByteLength) { 389 if (!destinationByteLength) {
387 return; 390 return;
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 case GL_UNPACK_SKIP_IMAGES: 761 case GL_UNPACK_SKIP_IMAGES:
759 m_unpackSkipImages = param; 762 m_unpackSkipImages = param;
760 break; 763 break;
761 default: 764 default:
762 WebGLRenderingContextBase::pixelStorei(pname, param); 765 WebGLRenderingContextBase::pixelStorei(pname, param);
763 return; 766 return;
764 } 767 }
765 contextGL()->PixelStorei(pname, param); 768 contextGL()->PixelStorei(pname, param);
766 } 769 }
767 770
768 void WebGL2RenderingContextBase::readPixels(GLint x, 771 void WebGL2RenderingContextBase::readPixels(
769 GLint y, 772 GLint x,
770 GLsizei width, 773 GLint y,
771 GLsizei height, 774 GLsizei width,
772 GLenum format, 775 GLsizei height,
773 GLenum type, 776 GLenum format,
774 DOMArrayBufferView* pixels) { 777 GLenum type,
778 NotShared<DOMArrayBufferView> pixels) {
775 if (isContextLost()) 779 if (isContextLost())
776 return; 780 return;
777 if (m_boundPixelPackBuffer.get()) { 781 if (m_boundPixelPackBuffer.get()) {
778 synthesizeGLError(GL_INVALID_OPERATION, "readPixels", 782 synthesizeGLError(GL_INVALID_OPERATION, "readPixels",
779 "PIXEL_PACK buffer should not be bound"); 783 "PIXEL_PACK buffer should not be bound");
780 return; 784 return;
781 } 785 }
782 786
783 readPixelsHelper(x, y, width, height, format, type, pixels, 0); 787 readPixelsHelper(x, y, width, height, format, type, pixels.view(), 0);
784 } 788 }
785 789
786 void WebGL2RenderingContextBase::readPixels(GLint x, 790 void WebGL2RenderingContextBase::readPixels(
787 GLint y, 791 GLint x,
788 GLsizei width, 792 GLint y,
789 GLsizei height, 793 GLsizei width,
790 GLenum format, 794 GLsizei height,
791 GLenum type, 795 GLenum format,
792 DOMArrayBufferView* pixels, 796 GLenum type,
793 GLuint offset) { 797 NotShared<DOMArrayBufferView> pixels,
798 GLuint offset) {
794 if (isContextLost()) 799 if (isContextLost())
795 return; 800 return;
796 if (m_boundPixelPackBuffer.get()) { 801 if (m_boundPixelPackBuffer.get()) {
797 synthesizeGLError(GL_INVALID_OPERATION, "readPixels", 802 synthesizeGLError(GL_INVALID_OPERATION, "readPixels",
798 "PIXEL_PACK buffer should not be bound"); 803 "PIXEL_PACK buffer should not be bound");
799 return; 804 return;
800 } 805 }
801 806
802 readPixelsHelper(x, y, width, height, format, type, pixels, offset); 807 readPixelsHelper(x, y, width, height, format, type, pixels.view(), offset);
803 } 808 }
804 809
805 void WebGL2RenderingContextBase::readPixels(GLint x, 810 void WebGL2RenderingContextBase::readPixels(GLint x,
806 GLint y, 811 GLint y,
807 GLsizei width, 812 GLsizei width,
808 GLsizei height, 813 GLsizei height,
809 GLenum format, 814 GLenum format,
810 GLenum type, 815 GLenum type,
811 long long offset) { 816 long long offset) {
812 if (isContextLost()) 817 if (isContextLost())
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 yoffset, 0)) 1140 yoffset, 0))
1136 return; 1141 return;
1137 if (!validateValueFitNonNegInt32("texSubImage2D", "offset", offset)) 1142 if (!validateValueFitNonNegInt32("texSubImage2D", "offset", offset))
1138 return; 1143 return;
1139 1144
1140 contextGL()->TexSubImage2D(target, level, xoffset, yoffset, width, height, 1145 contextGL()->TexSubImage2D(target, level, xoffset, yoffset, width, height,
1141 format, type, 1146 format, type,
1142 reinterpret_cast<const void*>(offset)); 1147 reinterpret_cast<const void*>(offset));
1143 } 1148 }
1144 1149
1145 void WebGL2RenderingContextBase::texImage2D(GLenum target, 1150 void WebGL2RenderingContextBase::texImage2D(
1146 GLint level, 1151 GLenum target,
1147 GLint internalformat, 1152 GLint level,
1148 GLsizei width, 1153 GLint internalformat,
1149 GLsizei height, 1154 GLsizei width,
1150 GLint border, 1155 GLsizei height,
1151 GLenum format, 1156 GLint border,
1152 GLenum type, 1157 GLenum format,
1153 DOMArrayBufferView* data) { 1158 GLenum type,
1159 NotShared<DOMArrayBufferView> data) {
1154 if (isContextLost()) 1160 if (isContextLost())
1155 return; 1161 return;
1156 if (m_boundPixelUnpackBuffer) { 1162 if (m_boundPixelUnpackBuffer) {
1157 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", 1163 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D",
1158 "a buffer is bound to PIXEL_UNPACK_BUFFER"); 1164 "a buffer is bound to PIXEL_UNPACK_BUFFER");
1159 return; 1165 return;
1160 } 1166 }
1161 WebGLRenderingContextBase::texImage2D(target, level, internalformat, width, 1167 WebGLRenderingContextBase::texImage2D(target, level, internalformat, width,
1162 height, border, format, type, data); 1168 height, border, format, type, data);
1163 } 1169 }
1164 1170
1165 void WebGL2RenderingContextBase::texImage2D(GLenum target, 1171 void WebGL2RenderingContextBase::texImage2D(GLenum target,
1166 GLint level, 1172 GLint level,
1167 GLint internalformat, 1173 GLint internalformat,
1168 GLsizei width, 1174 GLsizei width,
1169 GLsizei height, 1175 GLsizei height,
1170 GLint border, 1176 GLint border,
1171 GLenum format, 1177 GLenum format,
1172 GLenum type, 1178 GLenum type,
1173 DOMArrayBufferView* data, 1179 NotShared<DOMArrayBufferView> data,
1174 GLuint srcOffset) { 1180 GLuint srcOffset) {
1175 if (isContextLost()) 1181 if (isContextLost())
1176 return; 1182 return;
1177 if (m_boundPixelUnpackBuffer) { 1183 if (m_boundPixelUnpackBuffer) {
1178 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", 1184 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D",
1179 "a buffer is bound to PIXEL_UNPACK_BUFFER"); 1185 "a buffer is bound to PIXEL_UNPACK_BUFFER");
1180 return; 1186 return;
1181 } 1187 }
1182 texImageHelperDOMArrayBufferView(TexImage2D, target, level, internalformat, 1188 texImageHelperDOMArrayBufferView(TexImage2D, target, level, internalformat,
1183 width, height, 1, border, format, type, 0, 0, 1189 width, height, 1, border, format, type, 0, 0,
1184 0, data, NullNotReachable, srcOffset); 1190 0, data.view(), NullNotReachable, srcOffset);
1185 } 1191 }
1186 1192
1187 void WebGL2RenderingContextBase::texImage2D(GLenum target, 1193 void WebGL2RenderingContextBase::texImage2D(GLenum target,
1188 GLint level, 1194 GLint level,
1189 GLint internalformat, 1195 GLint internalformat,
1190 GLsizei width, 1196 GLsizei width,
1191 GLsizei height, 1197 GLsizei height,
1192 GLint border, 1198 GLint border,
1193 GLenum format, 1199 GLenum format,
1194 GLenum type, 1200 GLenum type,
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 return; 1384 return;
1379 if (m_boundPixelUnpackBuffer) { 1385 if (m_boundPixelUnpackBuffer) {
1380 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", 1386 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D",
1381 "a buffer is bound to PIXEL_UNPACK_BUFFER"); 1387 "a buffer is bound to PIXEL_UNPACK_BUFFER");
1382 return; 1388 return;
1383 } 1389 }
1384 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, 1390 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format,
1385 type, imageBitMap, exceptionState); 1391 type, imageBitMap, exceptionState);
1386 } 1392 }
1387 1393
1388 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, 1394 void WebGL2RenderingContextBase::texSubImage2D(
1389 GLint level, 1395 GLenum target,
1390 GLint xoffset, 1396 GLint level,
1391 GLint yoffset, 1397 GLint xoffset,
1392 GLsizei width, 1398 GLint yoffset,
1393 GLsizei height, 1399 GLsizei width,
1394 GLenum format, 1400 GLsizei height,
1395 GLenum type, 1401 GLenum format,
1396 DOMArrayBufferView* pixels) { 1402 GLenum type,
1403 NotShared<DOMArrayBufferView> pixels) {
1397 if (isContextLost()) 1404 if (isContextLost())
1398 return; 1405 return;
1399 if (m_boundPixelUnpackBuffer) { 1406 if (m_boundPixelUnpackBuffer) {
1400 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", 1407 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D",
1401 "a buffer is bound to PIXEL_UNPACK_BUFFER"); 1408 "a buffer is bound to PIXEL_UNPACK_BUFFER");
1402 return; 1409 return;
1403 } 1410 }
1404 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, 1411 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset,
1405 width, height, format, type, pixels); 1412 width, height, format, type, pixels);
1406 } 1413 }
1407 1414
1408 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, 1415 void WebGL2RenderingContextBase::texSubImage2D(
1409 GLint level, 1416 GLenum target,
1410 GLint xoffset, 1417 GLint level,
1411 GLint yoffset, 1418 GLint xoffset,
1412 GLsizei width, 1419 GLint yoffset,
1413 GLsizei height, 1420 GLsizei width,
1414 GLenum format, 1421 GLsizei height,
1415 GLenum type, 1422 GLenum format,
1416 DOMArrayBufferView* pixels, 1423 GLenum type,
1417 GLuint srcOffset) { 1424 NotShared<DOMArrayBufferView> pixels,
1425 GLuint srcOffset) {
1418 if (isContextLost()) 1426 if (isContextLost())
1419 return; 1427 return;
1420 if (m_boundPixelUnpackBuffer) { 1428 if (m_boundPixelUnpackBuffer) {
1421 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", 1429 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D",
1422 "a buffer is bound to PIXEL_UNPACK_BUFFER"); 1430 "a buffer is bound to PIXEL_UNPACK_BUFFER");
1423 return; 1431 return;
1424 } 1432 }
1425 texImageHelperDOMArrayBufferView(TexSubImage2D, target, level, 0, width, 1433 texImageHelperDOMArrayBufferView(
1426 height, 1, 0, format, type, xoffset, yoffset, 1434 TexSubImage2D, target, level, 0, width, height, 1, 0, format, type,
1427 0, pixels, NullNotReachable, srcOffset); 1435 xoffset, yoffset, 0, pixels.view(), NullNotReachable, srcOffset);
1428 } 1436 }
1429 1437
1430 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, 1438 void WebGL2RenderingContextBase::texSubImage2D(GLenum target,
1431 GLint level, 1439 GLint level,
1432 GLint xoffset, 1440 GLint xoffset,
1433 GLint yoffset, 1441 GLint yoffset,
1434 GLsizei width, 1442 GLsizei width,
1435 GLsizei height, 1443 GLsizei height,
1436 GLenum format, 1444 GLenum format,
1437 GLenum type, 1445 GLenum type,
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 GLsizei depth) { 1656 GLsizei depth) {
1649 if (isContextLost() || 1657 if (isContextLost() ||
1650 !validateTexStorage("texStorage3D", target, levels, internalformat, width, 1658 !validateTexStorage("texStorage3D", target, levels, internalformat, width,
1651 height, depth, TexStorageType3D)) 1659 height, depth, TexStorageType3D))
1652 return; 1660 return;
1653 1661
1654 contextGL()->TexStorage3D(target, levels, internalformat, width, height, 1662 contextGL()->TexStorage3D(target, levels, internalformat, width, height,
1655 depth); 1663 depth);
1656 } 1664 }
1657 1665
1658 void WebGL2RenderingContextBase::texImage3D(GLenum target, 1666 void WebGL2RenderingContextBase::texImage3D(
1659 GLint level, 1667 GLenum target,
1660 GLint internalformat, 1668 GLint level,
1661 GLsizei width, 1669 GLint internalformat,
1662 GLsizei height, 1670 GLsizei width,
1663 GLsizei depth, 1671 GLsizei height,
1664 GLint border, 1672 GLsizei depth,
1665 GLenum format, 1673 GLint border,
1666 GLenum type, 1674 GLenum format,
1667 DOMArrayBufferView* pixels) { 1675 GLenum type,
1676 NotShared<DOMArrayBufferView> pixels) {
1668 texImageHelperDOMArrayBufferView(TexImage3D, target, level, internalformat, 1677 texImageHelperDOMArrayBufferView(TexImage3D, target, level, internalformat,
1669 width, height, depth, border, format, type, 1678 width, height, depth, border, format, type,
1670 0, 0, 0, pixels, NullAllowed, 0); 1679 0, 0, 0, pixels.view(), NullAllowed, 0);
1671 } 1680 }
1672 1681
1673 void WebGL2RenderingContextBase::texImage3D(GLenum target, 1682 void WebGL2RenderingContextBase::texImage3D(
1674 GLint level, 1683 GLenum target,
1675 GLint internalformat, 1684 GLint level,
1676 GLsizei width, 1685 GLint internalformat,
1677 GLsizei height, 1686 GLsizei width,
1678 GLsizei depth, 1687 GLsizei height,
1679 GLint border, 1688 GLsizei depth,
1680 GLenum format, 1689 GLint border,
1681 GLenum type, 1690 GLenum format,
1682 DOMArrayBufferView* pixels, 1691 GLenum type,
1683 GLuint srcOffset) { 1692 NotShared<DOMArrayBufferView> pixels,
1693 GLuint srcOffset) {
1684 if (isContextLost()) 1694 if (isContextLost())
1685 return; 1695 return;
1686 if (m_boundPixelUnpackBuffer) { 1696 if (m_boundPixelUnpackBuffer) {
1687 synthesizeGLError(GL_INVALID_OPERATION, "texImage3D", 1697 synthesizeGLError(GL_INVALID_OPERATION, "texImage3D",
1688 "a buffer is bound to PIXEL_UNPACK_BUFFER"); 1698 "a buffer is bound to PIXEL_UNPACK_BUFFER");
1689 return; 1699 return;
1690 } 1700 }
1691 texImageHelperDOMArrayBufferView( 1701 texImageHelperDOMArrayBufferView(
1692 TexImage3D, target, level, internalformat, width, height, depth, border, 1702 TexImage3D, target, level, internalformat, width, height, depth, border,
1693 format, type, 0, 0, 0, pixels, NullNotReachable, srcOffset); 1703 format, type, 0, 0, 0, pixels.view(), NullNotReachable, srcOffset);
1694 } 1704 }
1695 1705
1696 void WebGL2RenderingContextBase::texImage3D(GLenum target, 1706 void WebGL2RenderingContextBase::texImage3D(GLenum target,
1697 GLint level, 1707 GLint level,
1698 GLint internalformat, 1708 GLint internalformat,
1699 GLsizei width, 1709 GLsizei width,
1700 GLsizei height, 1710 GLsizei height,
1701 GLsizei depth, 1711 GLsizei depth,
1702 GLint border, 1712 GLint border,
1703 GLenum format, 1713 GLenum format,
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 synthesizeGLError(GL_INVALID_OPERATION, "texImage3D", 1843 synthesizeGLError(GL_INVALID_OPERATION, "texImage3D",
1834 "a buffer is bound to PIXEL_UNPACK_BUFFER"); 1844 "a buffer is bound to PIXEL_UNPACK_BUFFER");
1835 return; 1845 return;
1836 } 1846 }
1837 texImageHelperImageBitmap(TexImage3D, target, level, internalformat, format, 1847 texImageHelperImageBitmap(TexImage3D, target, level, internalformat, format,
1838 type, 0, 0, 0, bitmap, 1848 type, 0, 0, 0, bitmap,
1839 getTextureSourceSubRectangle(width, height), depth, 1849 getTextureSourceSubRectangle(width, height), depth,
1840 m_unpackImageHeight, exceptionState); 1850 m_unpackImageHeight, exceptionState);
1841 } 1851 }
1842 1852
1843 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, 1853 void WebGL2RenderingContextBase::texSubImage3D(
1844 GLint level, 1854 GLenum target,
1845 GLint xoffset, 1855 GLint level,
1846 GLint yoffset, 1856 GLint xoffset,
1847 GLint zoffset, 1857 GLint yoffset,
1848 GLsizei width, 1858 GLint zoffset,
1849 GLsizei height, 1859 GLsizei width,
1850 GLsizei depth, 1860 GLsizei height,
1851 GLenum format, 1861 GLsizei depth,
1852 GLenum type, 1862 GLenum format,
1853 DOMArrayBufferView* pixels, 1863 GLenum type,
1854 GLuint srcOffset) { 1864 NotShared<DOMArrayBufferView> pixels,
1865 GLuint srcOffset) {
1855 if (isContextLost()) 1866 if (isContextLost())
1856 return; 1867 return;
1857 if (m_boundPixelUnpackBuffer) { 1868 if (m_boundPixelUnpackBuffer) {
1858 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", 1869 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D",
1859 "a buffer is bound to PIXEL_UNPACK_BUFFER"); 1870 "a buffer is bound to PIXEL_UNPACK_BUFFER");
1860 return; 1871 return;
1861 } 1872 }
1862 texImageHelperDOMArrayBufferView( 1873 texImageHelperDOMArrayBufferView(
1863 TexSubImage3D, target, level, 0, width, height, depth, 0, format, type, 1874 TexSubImage3D, target, level, 0, width, height, depth, 0, format, type,
1864 xoffset, yoffset, zoffset, pixels, NullNotReachable, srcOffset); 1875 xoffset, yoffset, zoffset, pixels.view(), NullNotReachable, srcOffset);
1865 } 1876 }
1866 1877
1867 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, 1878 void WebGL2RenderingContextBase::texSubImage3D(GLenum target,
1868 GLint level, 1879 GLint level,
1869 GLint xoffset, 1880 GLint xoffset,
1870 GLint yoffset, 1881 GLint yoffset,
1871 GLint zoffset, 1882 GLint zoffset,
1872 GLsizei width, 1883 GLsizei width,
1873 GLsizei height, 1884 GLsizei height,
1874 GLsizei depth, 1885 GLsizei depth,
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
2044 width, height); 2055 width, height);
2045 } 2056 }
2046 2057
2047 void WebGL2RenderingContextBase::compressedTexImage2D( 2058 void WebGL2RenderingContextBase::compressedTexImage2D(
2048 GLenum target, 2059 GLenum target,
2049 GLint level, 2060 GLint level,
2050 GLenum internalformat, 2061 GLenum internalformat,
2051 GLsizei width, 2062 GLsizei width,
2052 GLsizei height, 2063 GLsizei height,
2053 GLint border, 2064 GLint border,
2054 DOMArrayBufferView* data) { 2065 NotShared<DOMArrayBufferView> data) {
2055 if (isContextLost()) 2066 if (isContextLost())
2056 return; 2067 return;
2057 if (m_boundPixelUnpackBuffer) { 2068 if (m_boundPixelUnpackBuffer) {
2058 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", 2069 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D",
2059 "a buffer is bound to PIXEL_UNPACK_BUFFER"); 2070 "a buffer is bound to PIXEL_UNPACK_BUFFER");
2060 return; 2071 return;
2061 } 2072 }
2062 WebGLRenderingContextBase::compressedTexImage2D(target, level, internalformat, 2073 WebGLRenderingContextBase::compressedTexImage2D(target, level, internalformat,
2063 width, height, border, data); 2074 width, height, border, data);
2064 } 2075 }
2065 2076
2066 void WebGL2RenderingContextBase::compressedTexImage2D( 2077 void WebGL2RenderingContextBase::compressedTexImage2D(
2067 GLenum target, 2078 GLenum target,
2068 GLint level, 2079 GLint level,
2069 GLenum internalformat, 2080 GLenum internalformat,
2070 GLsizei width, 2081 GLsizei width,
2071 GLsizei height, 2082 GLsizei height,
2072 GLint border, 2083 GLint border,
2073 DOMArrayBufferView* data, 2084 NotShared<DOMArrayBufferView> data,
2074 GLuint srcOffset, 2085 GLuint srcOffset,
2075 GLuint srcLengthOverride) { 2086 GLuint srcLengthOverride) {
2076 if (isContextLost()) 2087 if (isContextLost())
2077 return; 2088 return;
2078 if (m_boundPixelUnpackBuffer) { 2089 if (m_boundPixelUnpackBuffer) {
2079 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", 2090 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D",
2080 "a buffer is bound to PIXEL_UNPACK_BUFFER"); 2091 "a buffer is bound to PIXEL_UNPACK_BUFFER");
2081 return; 2092 return;
2082 } 2093 }
2083 if (!validateTexture2DBinding("compressedTexImage2D", target)) 2094 if (!validateTexture2DBinding("compressedTexImage2D", target))
2084 return; 2095 return;
2085 if (!validateCompressedTexFormat("compressedTexImage2D", internalformat)) 2096 if (!validateCompressedTexFormat("compressedTexImage2D", internalformat))
2086 return; 2097 return;
2087 if (srcOffset > data->byteLength()) { 2098 if (srcOffset > data.view()->byteLength()) {
2088 synthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", 2099 synthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D",
2089 "srcOffset is out of range"); 2100 "srcOffset is out of range");
2090 return; 2101 return;
2091 } 2102 }
2092 if (srcLengthOverride == 0) { 2103 if (srcLengthOverride == 0) {
2093 srcLengthOverride = data->byteLength() - srcOffset; 2104 srcLengthOverride = data.view()->byteLength() - srcOffset;
2094 } else if (srcLengthOverride > data->byteLength() - srcOffset) { 2105 } else if (srcLengthOverride > data.view()->byteLength() - srcOffset) {
2095 synthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", 2106 synthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D",
2096 "srcLengthOverride is out of range"); 2107 "srcLengthOverride is out of range");
2097 return; 2108 return;
2098 } 2109 }
2099 contextGL()->CompressedTexImage2D( 2110 contextGL()->CompressedTexImage2D(
2100 target, level, internalformat, width, height, border, srcLengthOverride, 2111 target, level, internalformat, width, height, border, srcLengthOverride,
2101 static_cast<uint8_t*>(data->baseAddress()) + srcOffset); 2112 static_cast<uint8_t*>(data.view()->baseAddress()) + srcOffset);
2102 } 2113 }
2103 2114
2104 void WebGL2RenderingContextBase::compressedTexImage2D(GLenum target, 2115 void WebGL2RenderingContextBase::compressedTexImage2D(GLenum target,
2105 GLint level, 2116 GLint level,
2106 GLenum internalformat, 2117 GLenum internalformat,
2107 GLsizei width, 2118 GLsizei width,
2108 GLsizei height, 2119 GLsizei height,
2109 GLint border, 2120 GLint border,
2110 GLsizei imageSize, 2121 GLsizei imageSize,
2111 GLintptr offset) { 2122 GLintptr offset) {
(...skipping 10 matching lines...) Expand all
2122 } 2133 }
2123 2134
2124 void WebGL2RenderingContextBase::compressedTexSubImage2D( 2135 void WebGL2RenderingContextBase::compressedTexSubImage2D(
2125 GLenum target, 2136 GLenum target,
2126 GLint level, 2137 GLint level,
2127 GLint xoffset, 2138 GLint xoffset,
2128 GLint yoffset, 2139 GLint yoffset,
2129 GLsizei width, 2140 GLsizei width,
2130 GLsizei height, 2141 GLsizei height,
2131 GLenum format, 2142 GLenum format,
2132 DOMArrayBufferView* data) { 2143 NotShared<DOMArrayBufferView> data) {
2133 if (isContextLost()) 2144 if (isContextLost())
2134 return; 2145 return;
2135 if (m_boundPixelUnpackBuffer) { 2146 if (m_boundPixelUnpackBuffer) {
2136 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", 2147 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D",
2137 "a buffer is bound to PIXEL_UNPACK_BUFFER"); 2148 "a buffer is bound to PIXEL_UNPACK_BUFFER");
2138 return; 2149 return;
2139 } 2150 }
2140 WebGLRenderingContextBase::compressedTexSubImage2D( 2151 WebGLRenderingContextBase::compressedTexSubImage2D(
2141 target, level, xoffset, yoffset, width, height, format, data); 2152 target, level, xoffset, yoffset, width, height, format, data);
2142 } 2153 }
2143 2154
2144 void WebGL2RenderingContextBase::compressedTexSubImage2D( 2155 void WebGL2RenderingContextBase::compressedTexSubImage2D(
2145 GLenum target, 2156 GLenum target,
2146 GLint level, 2157 GLint level,
2147 GLint xoffset, 2158 GLint xoffset,
2148 GLint yoffset, 2159 GLint yoffset,
2149 GLsizei width, 2160 GLsizei width,
2150 GLsizei height, 2161 GLsizei height,
2151 GLenum format, 2162 GLenum format,
2152 DOMArrayBufferView* data, 2163 NotShared<DOMArrayBufferView> data,
2153 GLuint srcOffset, 2164 GLuint srcOffset,
2154 GLuint srcLengthOverride) { 2165 GLuint srcLengthOverride) {
2155 if (isContextLost()) 2166 if (isContextLost())
2156 return; 2167 return;
2157 if (m_boundPixelUnpackBuffer) { 2168 if (m_boundPixelUnpackBuffer) {
2158 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", 2169 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D",
2159 "a buffer is bound to PIXEL_UNPACK_BUFFER"); 2170 "a buffer is bound to PIXEL_UNPACK_BUFFER");
2160 return; 2171 return;
2161 } 2172 }
2162 if (!validateTexture2DBinding("compressedTexSubImage2D", target)) 2173 if (!validateTexture2DBinding("compressedTexSubImage2D", target))
2163 return; 2174 return;
2164 if (!validateCompressedTexFormat("compressedTexSubImage2D", format)) 2175 if (!validateCompressedTexFormat("compressedTexSubImage2D", format))
2165 return; 2176 return;
2166 if (srcOffset > data->byteLength()) { 2177 if (srcOffset > data.view()->byteLength()) {
2167 synthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D", 2178 synthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D",
2168 "srcOffset is out of range"); 2179 "srcOffset is out of range");
2169 return; 2180 return;
2170 } 2181 }
2171 if (srcLengthOverride == 0) { 2182 if (srcLengthOverride == 0) {
2172 srcLengthOverride = data->byteLength() - srcOffset; 2183 srcLengthOverride = data.view()->byteLength() - srcOffset;
2173 } else if (srcLengthOverride > data->byteLength() - srcOffset) { 2184 } else if (srcLengthOverride > data.view()->byteLength() - srcOffset) {
2174 synthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", 2185 synthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D",
2175 "srcLengthOverride is out of range"); 2186 "srcLengthOverride is out of range");
2176 return; 2187 return;
2177 } 2188 }
2178 contextGL()->CompressedTexSubImage2D( 2189 contextGL()->CompressedTexSubImage2D(
2179 target, level, xoffset, yoffset, width, height, format, srcLengthOverride, 2190 target, level, xoffset, yoffset, width, height, format, srcLengthOverride,
2180 static_cast<uint8_t*>(data->baseAddress()) + srcOffset); 2191 static_cast<uint8_t*>(data.view()->baseAddress()) + srcOffset);
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 imageSize, 2201 GLsizei imageSize,
(...skipping 11 matching lines...) Expand all
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 srcOffset, 2224 GLuint srcOffset,
2214 GLuint srcLengthOverride) { 2225 GLuint srcLengthOverride) {
2215 if (isContextLost()) 2226 if (isContextLost())
2216 return; 2227 return;
2217 if (m_boundPixelUnpackBuffer) { 2228 if (m_boundPixelUnpackBuffer) {
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 (srcOffset > data->byteLength()) { 2237 if (srcOffset > 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 (srcLengthOverride == 0) { 2242 if (srcLengthOverride == 0) {
2232 srcLengthOverride = data->byteLength() - srcOffset; 2243 srcLengthOverride = data.view()->byteLength() - srcOffset;
2233 } else if (srcLengthOverride > data->byteLength() - srcOffset) { 2244 } else if (srcLengthOverride > data.view()->byteLength() - srcOffset) {
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 srcLengthOverride, 2251 srcLengthOverride,
2241 static_cast<uint8_t*>(data->baseAddress()) + srcOffset); 2252 static_cast<uint8_t*>(data.view()->baseAddress()) + srcOffset);
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 imageSize, 2262 GLsizei imageSize,
(...skipping 13 matching lines...) Expand all
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 srcOffset, 2287 GLuint srcOffset,
2277 GLuint srcLengthOverride) { 2288 GLuint srcLengthOverride) {
2278 if (isContextLost()) 2289 if (isContextLost())
2279 return; 2290 return;
2280 if (m_boundPixelUnpackBuffer) { 2291 if (m_boundPixelUnpackBuffer) {
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 (srcOffset > data->byteLength()) { 2300 if (srcOffset > 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 (srcLengthOverride == 0) { 2305 if (srcLengthOverride == 0) {
2295 srcLengthOverride = data->byteLength() - srcOffset; 2306 srcLengthOverride = data.view()->byteLength() - srcOffset;
2296 } else if (srcLengthOverride > data->byteLength() - srcOffset) { 2307 } else if (srcLengthOverride > data.view()->byteLength() - srcOffset) {
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 srcLengthOverride, 2314 srcLengthOverride,
2304 static_cast<uint8_t*>(data->baseAddress()) + srcOffset); 2315 static_cast<uint8_t*>(data.view()->baseAddress()) + srcOffset);
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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
2770 2781
2771 contextGL()->Uniform4uiv( 2782 contextGL()->Uniform4uiv(
2772 location->location(), 2783 location->location(),
2773 (srcLength ? srcLength : (value.size() - srcOffset)) >> 2, 2784 (srcLength ? srcLength : (value.size() - srcOffset)) >> 2,
2774 value.data() + srcOffset); 2785 value.data() + srcOffset);
2775 } 2786 }
2776 2787
2777 void WebGL2RenderingContextBase::uniformMatrix2fv( 2788 void WebGL2RenderingContextBase::uniformMatrix2fv(
2778 const WebGLUniformLocation* location, 2789 const WebGLUniformLocation* location,
2779 GLboolean transpose, 2790 GLboolean transpose,
2780 DOMFloat32Array* v, 2791 NotShared<DOMFloat32Array> v,
2781 GLuint srcOffset, 2792 GLuint srcOffset,
2782 GLuint srcLength) { 2793 GLuint srcLength) {
2783 if (isContextLost() || 2794 if (isContextLost() ||
2784 !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, 2795 !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose,
2785 v, 4, srcOffset, srcLength)) 2796 v.view(), 4, srcOffset, srcLength))
2786 return; 2797 return;
2787 contextGL()->UniformMatrix2fv( 2798 contextGL()->UniformMatrix2fv(
2788 location->location(), 2799 location->location(),
2789 (srcLength ? srcLength : (v->length() - srcOffset)) >> 2, transpose, 2800 (srcLength ? srcLength : (v.view()->length() - srcOffset)) >> 2,
2790 v->data() + srcOffset); 2801 transpose, v.view()->data() + srcOffset);
2791 } 2802 }
2792 2803
2793 void WebGL2RenderingContextBase::uniformMatrix2fv( 2804 void WebGL2RenderingContextBase::uniformMatrix2fv(
2794 const WebGLUniformLocation* location, 2805 const WebGLUniformLocation* location,
2795 GLboolean transpose, 2806 GLboolean transpose,
2796 Vector<GLfloat>& v, 2807 Vector<GLfloat>& v,
2797 GLuint srcOffset, 2808 GLuint srcOffset,
2798 GLuint srcLength) { 2809 GLuint srcLength) {
2799 if (isContextLost() || 2810 if (isContextLost() ||
2800 !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, 2811 !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose,
2801 v.data(), v.size(), 4, srcOffset, 2812 v.data(), v.size(), 4, srcOffset,
2802 srcLength)) 2813 srcLength))
2803 return; 2814 return;
2804 contextGL()->UniformMatrix2fv( 2815 contextGL()->UniformMatrix2fv(
2805 location->location(), 2816 location->location(),
2806 (srcLength ? srcLength : (v.size() - srcOffset)) >> 2, transpose, 2817 (srcLength ? srcLength : (v.size() - srcOffset)) >> 2, transpose,
2807 v.data() + srcOffset); 2818 v.data() + srcOffset);
2808 } 2819 }
2809 2820
2810 void WebGL2RenderingContextBase::uniformMatrix3fv( 2821 void WebGL2RenderingContextBase::uniformMatrix3fv(
2811 const WebGLUniformLocation* location, 2822 const WebGLUniformLocation* location,
2812 GLboolean transpose, 2823 GLboolean transpose,
2813 DOMFloat32Array* v, 2824 NotShared<DOMFloat32Array> v,
2814 GLuint srcOffset, 2825 GLuint srcOffset,
2815 GLuint srcLength) { 2826 GLuint srcLength) {
2816 if (isContextLost() || 2827 if (isContextLost() ||
2817 !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, 2828 !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose,
2818 v, 9, srcOffset, srcLength)) 2829 v.view(), 9, srcOffset, srcLength))
2819 return; 2830 return;
2820 contextGL()->UniformMatrix3fv( 2831 contextGL()->UniformMatrix3fv(
2821 location->location(), 2832 location->location(),
2822 (srcLength ? srcLength : (v->length() - srcOffset)) / 9, transpose, 2833 (srcLength ? srcLength : (v.view()->length() - srcOffset)) / 9, transpose,
2823 v->data() + srcOffset); 2834 v.view()->data() + srcOffset);
2824 } 2835 }
2825 2836
2826 void WebGL2RenderingContextBase::uniformMatrix3fv( 2837 void WebGL2RenderingContextBase::uniformMatrix3fv(
2827 const WebGLUniformLocation* location, 2838 const WebGLUniformLocation* location,
2828 GLboolean transpose, 2839 GLboolean transpose,
2829 Vector<GLfloat>& v, 2840 Vector<GLfloat>& v,
2830 GLuint srcOffset, 2841 GLuint srcOffset,
2831 GLuint srcLength) { 2842 GLuint srcLength) {
2832 if (isContextLost() || 2843 if (isContextLost() ||
2833 !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, 2844 !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose,
2834 v.data(), v.size(), 9, srcOffset, 2845 v.data(), v.size(), 9, srcOffset,
2835 srcLength)) 2846 srcLength))
2836 return; 2847 return;
2837 contextGL()->UniformMatrix3fv( 2848 contextGL()->UniformMatrix3fv(
2838 location->location(), 2849 location->location(),
2839 (srcLength ? srcLength : (v.size() - srcOffset)) / 9, transpose, 2850 (srcLength ? srcLength : (v.size() - srcOffset)) / 9, transpose,
2840 v.data() + srcOffset); 2851 v.data() + srcOffset);
2841 } 2852 }
2842 2853
2843 void WebGL2RenderingContextBase::uniformMatrix4fv( 2854 void WebGL2RenderingContextBase::uniformMatrix4fv(
2844 const WebGLUniformLocation* location, 2855 const WebGLUniformLocation* location,
2845 GLboolean transpose, 2856 GLboolean transpose,
2846 DOMFloat32Array* v, 2857 NotShared<DOMFloat32Array> v,
2847 GLuint srcOffset, 2858 GLuint srcOffset,
2848 GLuint srcLength) { 2859 GLuint srcLength) {
2849 if (isContextLost() || 2860 if (isContextLost() ||
2850 !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, 2861 !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose,
2851 v, 16, srcOffset, srcLength)) 2862 v.view(), 16, srcOffset, srcLength))
2852 return; 2863 return;
2853 contextGL()->UniformMatrix4fv( 2864 contextGL()->UniformMatrix4fv(
2854 location->location(), 2865 location->location(),
2855 (srcLength ? srcLength : (v->length() - srcOffset)) >> 4, transpose, 2866 (srcLength ? srcLength : (v.view()->length() - srcOffset)) >> 4,
2856 v->data() + srcOffset); 2867 transpose, v.view()->data() + srcOffset);
2857 } 2868 }
2858 2869
2859 void WebGL2RenderingContextBase::uniformMatrix4fv( 2870 void WebGL2RenderingContextBase::uniformMatrix4fv(
2860 const WebGLUniformLocation* location, 2871 const WebGLUniformLocation* location,
2861 GLboolean transpose, 2872 GLboolean transpose,
2862 Vector<GLfloat>& v, 2873 Vector<GLfloat>& v,
2863 GLuint srcOffset, 2874 GLuint srcOffset,
2864 GLuint srcLength) { 2875 GLuint srcLength) {
2865 if (isContextLost() || 2876 if (isContextLost() ||
2866 !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, 2877 !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose,
2867 v.data(), v.size(), 16, srcOffset, 2878 v.data(), v.size(), 16, srcOffset,
2868 srcLength)) 2879 srcLength))
2869 return; 2880 return;
2870 contextGL()->UniformMatrix4fv( 2881 contextGL()->UniformMatrix4fv(
2871 location->location(), 2882 location->location(),
2872 (srcLength ? srcLength : (v.size() - srcOffset)) >> 4, transpose, 2883 (srcLength ? srcLength : (v.size() - srcOffset)) >> 4, transpose,
2873 v.data() + srcOffset); 2884 v.data() + srcOffset);
2874 } 2885 }
2875 2886
2876 void WebGL2RenderingContextBase::uniformMatrix2x3fv( 2887 void WebGL2RenderingContextBase::uniformMatrix2x3fv(
2877 const WebGLUniformLocation* location, 2888 const WebGLUniformLocation* location,
2878 GLboolean transpose, 2889 GLboolean transpose,
2879 DOMFloat32Array* value, 2890 NotShared<DOMFloat32Array> value,
2880 GLuint srcOffset, 2891 GLuint srcOffset,
2881 GLuint srcLength) { 2892 GLuint srcLength) {
2882 if (isContextLost() || 2893 if (isContextLost() || !validateUniformMatrixParameters(
2883 !validateUniformMatrixParameters("uniformMatrix2x3fv", location, 2894 "uniformMatrix2x3fv", location, transpose,
2884 transpose, value, 6, srcOffset, 2895 value.view(), 6, srcOffset, srcLength))
2885 srcLength))
2886 return; 2896 return;
2887 contextGL()->UniformMatrix2x3fv( 2897 contextGL()->UniformMatrix2x3fv(
2888 location->location(), 2898 location->location(),
2889 (srcLength ? srcLength : (value->length() - srcOffset)) / 6, transpose, 2899 (srcLength ? srcLength : (value.view()->length() - srcOffset)) / 6,
2890 value->data() + srcOffset); 2900 transpose, value.view()->data() + srcOffset);
2891 } 2901 }
2892 2902
2893 void WebGL2RenderingContextBase::uniformMatrix2x3fv( 2903 void WebGL2RenderingContextBase::uniformMatrix2x3fv(
2894 const WebGLUniformLocation* location, 2904 const WebGLUniformLocation* location,
2895 GLboolean transpose, 2905 GLboolean transpose,
2896 Vector<GLfloat>& value, 2906 Vector<GLfloat>& value,
2897 GLuint srcOffset, 2907 GLuint srcOffset,
2898 GLuint srcLength) { 2908 GLuint srcLength) {
2899 if (isContextLost() || 2909 if (isContextLost() ||
2900 !validateUniformMatrixParameters("uniformMatrix2x3fv", location, 2910 !validateUniformMatrixParameters("uniformMatrix2x3fv", location,
2901 transpose, value.data(), value.size(), 6, 2911 transpose, value.data(), value.size(), 6,
2902 srcOffset, srcLength)) 2912 srcOffset, srcLength))
2903 return; 2913 return;
2904 contextGL()->UniformMatrix2x3fv( 2914 contextGL()->UniformMatrix2x3fv(
2905 location->location(), 2915 location->location(),
2906 (srcLength ? srcLength : (value.size() - srcOffset)) / 6, transpose, 2916 (srcLength ? srcLength : (value.size() - srcOffset)) / 6, transpose,
2907 value.data() + srcOffset); 2917 value.data() + srcOffset);
2908 } 2918 }
2909 2919
2910 void WebGL2RenderingContextBase::uniformMatrix3x2fv( 2920 void WebGL2RenderingContextBase::uniformMatrix3x2fv(
2911 const WebGLUniformLocation* location, 2921 const WebGLUniformLocation* location,
2912 GLboolean transpose, 2922 GLboolean transpose,
2913 DOMFloat32Array* value, 2923 NotShared<DOMFloat32Array> value,
2914 GLuint srcOffset, 2924 GLuint srcOffset,
2915 GLuint srcLength) { 2925 GLuint srcLength) {
2916 if (isContextLost() || 2926 if (isContextLost() || !validateUniformMatrixParameters(
2917 !validateUniformMatrixParameters("uniformMatrix3x2fv", location, 2927 "uniformMatrix3x2fv", location, transpose,
2918 transpose, value, 6, srcOffset, 2928 value.view(), 6, srcOffset, srcLength))
2919 srcLength))
2920 return; 2929 return;
2921 contextGL()->UniformMatrix3x2fv( 2930 contextGL()->UniformMatrix3x2fv(
2922 location->location(), 2931 location->location(),
2923 (srcLength ? srcLength : (value->length() - srcOffset)) / 6, transpose, 2932 (srcLength ? srcLength : (value.view()->length() - srcOffset)) / 6,
2924 value->data() + srcOffset); 2933 transpose, value.view()->data() + srcOffset);
2925 } 2934 }
2926 2935
2927 void WebGL2RenderingContextBase::uniformMatrix3x2fv( 2936 void WebGL2RenderingContextBase::uniformMatrix3x2fv(
2928 const WebGLUniformLocation* location, 2937 const WebGLUniformLocation* location,
2929 GLboolean transpose, 2938 GLboolean transpose,
2930 Vector<GLfloat>& value, 2939 Vector<GLfloat>& value,
2931 GLuint srcOffset, 2940 GLuint srcOffset,
2932 GLuint srcLength) { 2941 GLuint srcLength) {
2933 if (isContextLost() || 2942 if (isContextLost() ||
2934 !validateUniformMatrixParameters("uniformMatrix3x2fv", location, 2943 !validateUniformMatrixParameters("uniformMatrix3x2fv", location,
2935 transpose, value.data(), value.size(), 6, 2944 transpose, value.data(), value.size(), 6,
2936 srcOffset, srcLength)) 2945 srcOffset, srcLength))
2937 return; 2946 return;
2938 contextGL()->UniformMatrix3x2fv( 2947 contextGL()->UniformMatrix3x2fv(
2939 location->location(), 2948 location->location(),
2940 (srcLength ? srcLength : (value.size() - srcOffset)) / 6, transpose, 2949 (srcLength ? srcLength : (value.size() - srcOffset)) / 6, transpose,
2941 value.data() + srcOffset); 2950 value.data() + srcOffset);
2942 } 2951 }
2943 2952
2944 void WebGL2RenderingContextBase::uniformMatrix2x4fv( 2953 void WebGL2RenderingContextBase::uniformMatrix2x4fv(
2945 const WebGLUniformLocation* location, 2954 const WebGLUniformLocation* location,
2946 GLboolean transpose, 2955 GLboolean transpose,
2947 DOMFloat32Array* value, 2956 NotShared<DOMFloat32Array> value,
2948 GLuint srcOffset, 2957 GLuint srcOffset,
2949 GLuint srcLength) { 2958 GLuint srcLength) {
2950 if (isContextLost() || 2959 if (isContextLost() || !validateUniformMatrixParameters(
2951 !validateUniformMatrixParameters("uniformMatrix2x4fv", location, 2960 "uniformMatrix2x4fv", location, transpose,
2952 transpose, value, 8, srcOffset, 2961 value.view(), 8, srcOffset, srcLength))
2953 srcLength))
2954 return; 2962 return;
2955 contextGL()->UniformMatrix2x4fv( 2963 contextGL()->UniformMatrix2x4fv(
2956 location->location(), 2964 location->location(),
2957 (srcLength ? srcLength : (value->length() - srcOffset)) >> 3, transpose, 2965 (srcLength ? srcLength : (value.view()->length() - srcOffset)) >> 3,
2958 value->data() + srcOffset); 2966 transpose, value.view()->data() + srcOffset);
2959 } 2967 }
2960 2968
2961 void WebGL2RenderingContextBase::uniformMatrix2x4fv( 2969 void WebGL2RenderingContextBase::uniformMatrix2x4fv(
2962 const WebGLUniformLocation* location, 2970 const WebGLUniformLocation* location,
2963 GLboolean transpose, 2971 GLboolean transpose,
2964 Vector<GLfloat>& value, 2972 Vector<GLfloat>& value,
2965 GLuint srcOffset, 2973 GLuint srcOffset,
2966 GLuint srcLength) { 2974 GLuint srcLength) {
2967 if (isContextLost() || 2975 if (isContextLost() ||
2968 !validateUniformMatrixParameters("uniformMatrix2x4fv", location, 2976 !validateUniformMatrixParameters("uniformMatrix2x4fv", location,
2969 transpose, value.data(), value.size(), 8, 2977 transpose, value.data(), value.size(), 8,
2970 srcOffset, srcLength)) 2978 srcOffset, srcLength))
2971 return; 2979 return;
2972 contextGL()->UniformMatrix2x4fv( 2980 contextGL()->UniformMatrix2x4fv(
2973 location->location(), 2981 location->location(),
2974 (srcLength ? srcLength : (value.size() - srcOffset)) >> 3, transpose, 2982 (srcLength ? srcLength : (value.size() - srcOffset)) >> 3, transpose,
2975 value.data() + srcOffset); 2983 value.data() + srcOffset);
2976 } 2984 }
2977 2985
2978 void WebGL2RenderingContextBase::uniformMatrix4x2fv( 2986 void WebGL2RenderingContextBase::uniformMatrix4x2fv(
2979 const WebGLUniformLocation* location, 2987 const WebGLUniformLocation* location,
2980 GLboolean transpose, 2988 GLboolean transpose,
2981 DOMFloat32Array* value, 2989 NotShared<DOMFloat32Array> value,
2982 GLuint srcOffset, 2990 GLuint srcOffset,
2983 GLuint srcLength) { 2991 GLuint srcLength) {
2984 if (isContextLost() || 2992 if (isContextLost() || !validateUniformMatrixParameters(
2985 !validateUniformMatrixParameters("uniformMatrix4x2fv", location, 2993 "uniformMatrix4x2fv", location, transpose,
2986 transpose, value, 8, srcOffset, 2994 value.view(), 8, srcOffset, srcLength))
2987 srcLength))
2988 return; 2995 return;
2989 contextGL()->UniformMatrix4x2fv( 2996 contextGL()->UniformMatrix4x2fv(
2990 location->location(), 2997 location->location(),
2991 (srcLength ? srcLength : (value->length() - srcOffset)) >> 3, transpose, 2998 (srcLength ? srcLength : (value.view()->length() - srcOffset)) >> 3,
2992 value->data() + srcOffset); 2999 transpose, value.view()->data() + srcOffset);
2993 } 3000 }
2994 3001
2995 void WebGL2RenderingContextBase::uniformMatrix4x2fv( 3002 void WebGL2RenderingContextBase::uniformMatrix4x2fv(
2996 const WebGLUniformLocation* location, 3003 const WebGLUniformLocation* location,
2997 GLboolean transpose, 3004 GLboolean transpose,
2998 Vector<GLfloat>& value, 3005 Vector<GLfloat>& value,
2999 GLuint srcOffset, 3006 GLuint srcOffset,
3000 GLuint srcLength) { 3007 GLuint srcLength) {
3001 if (isContextLost() || 3008 if (isContextLost() ||
3002 !validateUniformMatrixParameters("uniformMatrix4x2fv", location, 3009 !validateUniformMatrixParameters("uniformMatrix4x2fv", location,
3003 transpose, value.data(), value.size(), 8, 3010 transpose, value.data(), value.size(), 8,
3004 srcOffset, srcLength)) 3011 srcOffset, srcLength))
3005 return; 3012 return;
3006 contextGL()->UniformMatrix4x2fv( 3013 contextGL()->UniformMatrix4x2fv(
3007 location->location(), 3014 location->location(),
3008 (srcLength ? srcLength : (value.size() - srcOffset)) >> 3, transpose, 3015 (srcLength ? srcLength : (value.size() - srcOffset)) >> 3, transpose,
3009 value.data() + srcOffset); 3016 value.data() + srcOffset);
3010 } 3017 }
3011 3018
3012 void WebGL2RenderingContextBase::uniformMatrix3x4fv( 3019 void WebGL2RenderingContextBase::uniformMatrix3x4fv(
3013 const WebGLUniformLocation* location, 3020 const WebGLUniformLocation* location,
3014 GLboolean transpose, 3021 GLboolean transpose,
3015 DOMFloat32Array* value, 3022 NotShared<DOMFloat32Array> value,
3016 GLuint srcOffset, 3023 GLuint srcOffset,
3017 GLuint srcLength) { 3024 GLuint srcLength) {
3018 if (isContextLost() || 3025 if (isContextLost() || !validateUniformMatrixParameters(
3019 !validateUniformMatrixParameters("uniformMatrix3x4fv", location, 3026 "uniformMatrix3x4fv", location, transpose,
3020 transpose, value, 12, srcOffset, 3027 value.view(), 12, srcOffset, srcLength))
3021 srcLength))
3022 return; 3028 return;
3023 contextGL()->UniformMatrix3x4fv( 3029 contextGL()->UniformMatrix3x4fv(
3024 location->location(), 3030 location->location(),
3025 (srcLength ? srcLength : (value->length() - srcOffset)) / 12, transpose, 3031 (srcLength ? srcLength : (value.view()->length() - srcOffset)) / 12,
3026 value->data() + srcOffset); 3032 transpose, value.view()->data() + srcOffset);
3027 } 3033 }
3028 3034
3029 void WebGL2RenderingContextBase::uniformMatrix3x4fv( 3035 void WebGL2RenderingContextBase::uniformMatrix3x4fv(
3030 const WebGLUniformLocation* location, 3036 const WebGLUniformLocation* location,
3031 GLboolean transpose, 3037 GLboolean transpose,
3032 Vector<GLfloat>& value, 3038 Vector<GLfloat>& value,
3033 GLuint srcOffset, 3039 GLuint srcOffset,
3034 GLuint srcLength) { 3040 GLuint srcLength) {
3035 if (isContextLost() || 3041 if (isContextLost() ||
3036 !validateUniformMatrixParameters("uniformMatrix3x4fv", location, 3042 !validateUniformMatrixParameters("uniformMatrix3x4fv", location,
3037 transpose, value.data(), value.size(), 3043 transpose, value.data(), value.size(),
3038 12, srcOffset, srcLength)) 3044 12, srcOffset, srcLength))
3039 return; 3045 return;
3040 contextGL()->UniformMatrix3x4fv( 3046 contextGL()->UniformMatrix3x4fv(
3041 location->location(), 3047 location->location(),
3042 (srcLength ? srcLength : (value.size() - srcOffset)) / 12, transpose, 3048 (srcLength ? srcLength : (value.size() - srcOffset)) / 12, transpose,
3043 value.data() + srcOffset); 3049 value.data() + srcOffset);
3044 } 3050 }
3045 3051
3046 void WebGL2RenderingContextBase::uniformMatrix4x3fv( 3052 void WebGL2RenderingContextBase::uniformMatrix4x3fv(
3047 const WebGLUniformLocation* location, 3053 const WebGLUniformLocation* location,
3048 GLboolean transpose, 3054 GLboolean transpose,
3049 DOMFloat32Array* value, 3055 NotShared<DOMFloat32Array> value,
3050 GLuint srcOffset, 3056 GLuint srcOffset,
3051 GLuint srcLength) { 3057 GLuint srcLength) {
3052 if (isContextLost() || 3058 if (isContextLost() || !validateUniformMatrixParameters(
3053 !validateUniformMatrixParameters("uniformMatrix4x3fv", location, 3059 "uniformMatrix4x3fv", location, transpose,
3054 transpose, value, 12, srcOffset, 3060 value.view(), 12, srcOffset, srcLength))
3055 srcLength))
3056 return; 3061 return;
3057 contextGL()->UniformMatrix4x3fv( 3062 contextGL()->UniformMatrix4x3fv(
3058 location->location(), 3063 location->location(),
3059 (srcLength ? srcLength : (value->length() - srcOffset)) / 12, transpose, 3064 (srcLength ? srcLength : (value.view()->length() - srcOffset)) / 12,
3060 value->data() + srcOffset); 3065 transpose, value.view()->data() + srcOffset);
3061 } 3066 }
3062 3067
3063 void WebGL2RenderingContextBase::uniformMatrix4x3fv( 3068 void WebGL2RenderingContextBase::uniformMatrix4x3fv(
3064 const WebGLUniformLocation* location, 3069 const WebGLUniformLocation* location,
3065 GLboolean transpose, 3070 GLboolean transpose,
3066 Vector<GLfloat>& value, 3071 Vector<GLfloat>& value,
3067 GLuint srcOffset, 3072 GLuint srcOffset,
3068 GLuint srcLength) { 3073 GLuint srcLength) {
3069 if (isContextLost() || 3074 if (isContextLost() ||
3070 !validateUniformMatrixParameters("uniformMatrix4x3fv", location, 3075 !validateUniformMatrixParameters("uniformMatrix4x3fv", location,
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
3169 3174
3170 void WebGL2RenderingContextBase::uniform4iv( 3175 void WebGL2RenderingContextBase::uniform4iv(
3171 const WebGLUniformLocation* location, 3176 const WebGLUniformLocation* location,
3172 Vector<GLint>& v) { 3177 Vector<GLint>& v) {
3173 WebGLRenderingContextBase::uniform4iv(location, v); 3178 WebGLRenderingContextBase::uniform4iv(location, v);
3174 } 3179 }
3175 3180
3176 void WebGL2RenderingContextBase::uniformMatrix2fv( 3181 void WebGL2RenderingContextBase::uniformMatrix2fv(
3177 const WebGLUniformLocation* location, 3182 const WebGLUniformLocation* location,
3178 GLboolean transpose, 3183 GLboolean transpose,
3179 DOMFloat32Array* v) { 3184 NotShared<DOMFloat32Array> v) {
3180 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); 3185 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v);
3181 } 3186 }
3182 3187
3183 void WebGL2RenderingContextBase::uniformMatrix2fv( 3188 void WebGL2RenderingContextBase::uniformMatrix2fv(
3184 const WebGLUniformLocation* location, 3189 const WebGLUniformLocation* location,
3185 GLboolean transpose, 3190 GLboolean transpose,
3186 Vector<GLfloat>& v) { 3191 Vector<GLfloat>& v) {
3187 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); 3192 WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v);
3188 } 3193 }
3189 3194
3190 void WebGL2RenderingContextBase::uniformMatrix3fv( 3195 void WebGL2RenderingContextBase::uniformMatrix3fv(
3191 const WebGLUniformLocation* location, 3196 const WebGLUniformLocation* location,
3192 GLboolean transpose, 3197 GLboolean transpose,
3193 DOMFloat32Array* v) { 3198 NotShared<DOMFloat32Array> v) {
3194 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); 3199 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v);
3195 } 3200 }
3196 3201
3197 void WebGL2RenderingContextBase::uniformMatrix3fv( 3202 void WebGL2RenderingContextBase::uniformMatrix3fv(
3198 const WebGLUniformLocation* location, 3203 const WebGLUniformLocation* location,
3199 GLboolean transpose, 3204 GLboolean transpose,
3200 Vector<GLfloat>& v) { 3205 Vector<GLfloat>& v) {
3201 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); 3206 WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v);
3202 } 3207 }
3203 3208
3204 void WebGL2RenderingContextBase::uniformMatrix4fv( 3209 void WebGL2RenderingContextBase::uniformMatrix4fv(
3205 const WebGLUniformLocation* location, 3210 const WebGLUniformLocation* location,
3206 GLboolean transpose, 3211 GLboolean transpose,
3207 DOMFloat32Array* v) { 3212 NotShared<DOMFloat32Array> v) {
3208 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); 3213 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v);
3209 } 3214 }
3210 3215
3211 void WebGL2RenderingContextBase::uniformMatrix4fv( 3216 void WebGL2RenderingContextBase::uniformMatrix4fv(
3212 const WebGLUniformLocation* location, 3217 const WebGLUniformLocation* location,
3213 GLboolean transpose, 3218 GLboolean transpose,
3214 Vector<GLfloat>& v) { 3219 Vector<GLfloat>& v) {
3215 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); 3220 WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v);
3216 } 3221 }
3217 3222
3218 void WebGL2RenderingContextBase::vertexAttribI4i(GLuint index, 3223 void WebGL2RenderingContextBase::vertexAttribI4i(GLuint index,
3219 GLint x, 3224 GLint x,
3220 GLint y, 3225 GLint y,
3221 GLint z, 3226 GLint z,
3222 GLint w) { 3227 GLint w) {
3223 if (isContextLost()) 3228 if (isContextLost())
3224 return; 3229 return;
3225 contextGL()->VertexAttribI4i(index, x, y, z, w); 3230 contextGL()->VertexAttribI4i(index, x, y, z, w);
3226 setVertexAttribType(index, Int32ArrayType); 3231 setVertexAttribType(index, Int32ArrayType);
3227 } 3232 }
3228 3233
3229 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, 3234 void WebGL2RenderingContextBase::vertexAttribI4iv(
3230 const DOMInt32Array* v) { 3235 GLuint index,
3236 NotShared<const DOMInt32Array> v) {
3231 if (isContextLost()) 3237 if (isContextLost())
3232 return; 3238 return;
3233 if (!v || v->length() < 4) { 3239 if (!v.view() || v.view()->length() < 4) {
3234 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); 3240 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array");
3235 return; 3241 return;
3236 } 3242 }
3237 contextGL()->VertexAttribI4iv(index, v->data()); 3243 contextGL()->VertexAttribI4iv(index, v.view()->data());
3238 setVertexAttribType(index, Int32ArrayType); 3244 setVertexAttribType(index, Int32ArrayType);
3239 } 3245 }
3240 3246
3241 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, 3247 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index,
3242 const Vector<GLint>& v) { 3248 const Vector<GLint>& v) {
3243 if (isContextLost()) 3249 if (isContextLost())
3244 return; 3250 return;
3245 if (v.size() < 4) { 3251 if (v.size() < 4) {
3246 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); 3252 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array");
3247 return; 3253 return;
3248 } 3254 }
3249 contextGL()->VertexAttribI4iv(index, v.data()); 3255 contextGL()->VertexAttribI4iv(index, v.data());
3250 setVertexAttribType(index, Int32ArrayType); 3256 setVertexAttribType(index, Int32ArrayType);
3251 } 3257 }
3252 3258
3253 void WebGL2RenderingContextBase::vertexAttribI4ui(GLuint index, 3259 void WebGL2RenderingContextBase::vertexAttribI4ui(GLuint index,
3254 GLuint x, 3260 GLuint x,
3255 GLuint y, 3261 GLuint y,
3256 GLuint z, 3262 GLuint z,
3257 GLuint w) { 3263 GLuint w) {
3258 if (isContextLost()) 3264 if (isContextLost())
3259 return; 3265 return;
3260 contextGL()->VertexAttribI4ui(index, x, y, z, w); 3266 contextGL()->VertexAttribI4ui(index, x, y, z, w);
3261 setVertexAttribType(index, Uint32ArrayType); 3267 setVertexAttribType(index, Uint32ArrayType);
3262 } 3268 }
3263 3269
3264 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, 3270 void WebGL2RenderingContextBase::vertexAttribI4uiv(
3265 const DOMUint32Array* v) { 3271 GLuint index,
3272 NotShared<const DOMUint32Array> v) {
3266 if (isContextLost()) 3273 if (isContextLost())
3267 return; 3274 return;
3268 if (!v || v->length() < 4) { 3275 if (!v.view() || v.view()->length() < 4) {
3269 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); 3276 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array");
3270 return; 3277 return;
3271 } 3278 }
3272 contextGL()->VertexAttribI4uiv(index, v->data()); 3279 contextGL()->VertexAttribI4uiv(index, v.view()->data());
3273 setVertexAttribType(index, Uint32ArrayType); 3280 setVertexAttribType(index, Uint32ArrayType);
3274 } 3281 }
3275 3282
3276 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, 3283 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index,
3277 const Vector<GLuint>& v) { 3284 const Vector<GLuint>& v) {
3278 if (isContextLost()) 3285 if (isContextLost())
3279 return; 3286 return;
3280 if (v.size() < 4) { 3287 if (v.size() < 4) {
3281 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); 3288 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array");
3282 return; 3289 return;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
3477 const char* funcName, 3484 const char* funcName,
3478 TexImageFunctionID functionID, 3485 TexImageFunctionID functionID,
3479 GLenum target) { 3486 GLenum target) {
3480 if (functionID == TexImage3D || functionID == TexSubImage3D) 3487 if (functionID == TexImage3D || functionID == TexSubImage3D)
3481 return validateTexture3DBinding(funcName, target); 3488 return validateTexture3DBinding(funcName, target);
3482 return validateTexture2DBinding(funcName, target); 3489 return validateTexture2DBinding(funcName, target);
3483 } 3490 }
3484 3491
3485 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, 3492 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer,
3486 GLint drawbuffer, 3493 GLint drawbuffer,
3487 DOMInt32Array* value) { 3494 NotShared<DOMInt32Array> value) {
3488 if (isContextLost() || 3495 if (isContextLost() ||
3489 !validateClearBuffer("clearBufferiv", buffer, value->length())) 3496 !validateClearBuffer("clearBufferiv", buffer, value.view()->length()))
3490 return; 3497 return;
3491 3498
3492 contextGL()->ClearBufferiv(buffer, drawbuffer, value->data()); 3499 contextGL()->ClearBufferiv(buffer, drawbuffer, value.view()->data());
3493 } 3500 }
3494 3501
3495 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, 3502 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer,
3496 GLint drawbuffer, 3503 GLint drawbuffer,
3497 const Vector<GLint>& value) { 3504 const Vector<GLint>& value) {
3498 if (isContextLost() || 3505 if (isContextLost() ||
3499 !validateClearBuffer("clearBufferiv", buffer, value.size())) 3506 !validateClearBuffer("clearBufferiv", buffer, value.size()))
3500 return; 3507 return;
3501 3508
3502 contextGL()->ClearBufferiv(buffer, drawbuffer, value.data()); 3509 contextGL()->ClearBufferiv(buffer, drawbuffer, value.data());
3503 } 3510 }
3504 3511
3505 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, 3512 void WebGL2RenderingContextBase::clearBufferuiv(
3506 GLint drawbuffer, 3513 GLenum buffer,
3507 DOMUint32Array* value) { 3514 GLint drawbuffer,
3515 NotShared<DOMUint32Array> value) {
3508 if (isContextLost() || 3516 if (isContextLost() ||
3509 !validateClearBuffer("clearBufferuiv", buffer, value->length())) 3517 !validateClearBuffer("clearBufferuiv", buffer, value.view()->length()))
3510 return; 3518 return;
3511 3519
3512 contextGL()->ClearBufferuiv(buffer, drawbuffer, value->data()); 3520 contextGL()->ClearBufferuiv(buffer, drawbuffer, value.view()->data());
3513 } 3521 }
3514 3522
3515 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, 3523 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer,
3516 GLint drawbuffer, 3524 GLint drawbuffer,
3517 const Vector<GLuint>& value) { 3525 const Vector<GLuint>& value) {
3518 if (isContextLost() || 3526 if (isContextLost() ||
3519 !validateClearBuffer("clearBufferuiv", buffer, value.size())) 3527 !validateClearBuffer("clearBufferuiv", buffer, value.size()))
3520 return; 3528 return;
3521 3529
3522 contextGL()->ClearBufferuiv(buffer, drawbuffer, value.data()); 3530 contextGL()->ClearBufferuiv(buffer, drawbuffer, value.data());
3523 } 3531 }
3524 3532
3525 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, 3533 void WebGL2RenderingContextBase::clearBufferfv(
3526 GLint drawbuffer, 3534 GLenum buffer,
3527 DOMFloat32Array* value) { 3535 GLint drawbuffer,
3536 NotShared<DOMFloat32Array> value) {
3528 if (isContextLost() || 3537 if (isContextLost() ||
3529 !validateClearBuffer("clearBufferfv", buffer, value->length())) 3538 !validateClearBuffer("clearBufferfv", buffer, value.view()->length()))
3530 return; 3539 return;
3531 3540
3532 contextGL()->ClearBufferfv(buffer, drawbuffer, value->data()); 3541 contextGL()->ClearBufferfv(buffer, drawbuffer, value.view()->data());
3533 } 3542 }
3534 3543
3535 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, 3544 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer,
3536 GLint drawbuffer, 3545 GLint drawbuffer,
3537 const Vector<GLfloat>& value) { 3546 const Vector<GLfloat>& value) {
3538 if (isContextLost() || 3547 if (isContextLost() ||
3539 !validateClearBuffer("clearBufferfv", buffer, value.size())) 3548 !validateClearBuffer("clearBufferfv", buffer, value.size()))
3540 return; 3549 return;
3541 3550
3542 contextGL()->ClearBufferfv(buffer, drawbuffer, value.data()); 3551 contextGL()->ClearBufferfv(buffer, drawbuffer, value.data());
(...skipping 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after
5667 5676
5668 void WebGL2RenderingContextBase:: 5677 void WebGL2RenderingContextBase::
5669 DrawingBufferClientRestorePixelUnpackBufferBinding() { 5678 DrawingBufferClientRestorePixelUnpackBufferBinding() {
5670 if (!contextGL()) 5679 if (!contextGL())
5671 return; 5680 return;
5672 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 5681 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER,
5673 objectOrZero(m_boundPixelUnpackBuffer.get())); 5682 objectOrZero(m_boundPixelUnpackBuffer.get()));
5674 } 5683 }
5675 5684
5676 } // namespace blink 5685 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698