| 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 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1182 if (bound_pixel_unpack_buffer_) { | 1182 if (bound_pixel_unpack_buffer_) { |
| 1183 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1183 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1184 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1184 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1185 return; | 1185 return; |
| 1186 } | 1186 } |
| 1187 TexImageHelperImageData(kTexImage2D, target, level, internalformat, 0, format, | 1187 TexImageHelperImageData(kTexImage2D, target, level, internalformat, 0, format, |
| 1188 type, 1, 0, 0, 0, pixels, | 1188 type, 1, 0, 0, 0, pixels, |
| 1189 GetTextureSourceSubRectangle(width, height), 0); | 1189 GetTextureSourceSubRectangle(width, height), 0); |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1192 void WebGL2RenderingContextBase::texImage2D(ExecutionContext* execution_context, |
| 1193 GLenum target, |
| 1193 GLint level, | 1194 GLint level, |
| 1194 GLint internalformat, | 1195 GLint internalformat, |
| 1195 GLsizei width, | 1196 GLsizei width, |
| 1196 GLsizei height, | 1197 GLsizei height, |
| 1197 GLint border, | 1198 GLint border, |
| 1198 GLenum format, | 1199 GLenum format, |
| 1199 GLenum type, | 1200 GLenum type, |
| 1200 HTMLImageElement* image, | 1201 HTMLImageElement* image, |
| 1201 ExceptionState& exception_state) { | 1202 ExceptionState& exception_state) { |
| 1202 if (isContextLost()) | 1203 if (isContextLost()) |
| 1203 return; | 1204 return; |
| 1204 if (bound_pixel_unpack_buffer_) { | 1205 if (bound_pixel_unpack_buffer_) { |
| 1205 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1206 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1206 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1207 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1207 return; | 1208 return; |
| 1208 } | 1209 } |
| 1209 TexImageHelperHTMLImageElement(kTexImage2D, target, level, internalformat, | 1210 TexImageHelperHTMLImageElement(execution_context->GetSecurityOrigin(), |
| 1211 kTexImage2D, target, level, internalformat, |
| 1210 format, type, 0, 0, 0, image, | 1212 format, type, 0, 0, 0, image, |
| 1211 GetTextureSourceSubRectangle(width, height), 1, | 1213 GetTextureSourceSubRectangle(width, height), 1, |
| 1212 unpack_image_height_, exception_state); | 1214 unpack_image_height_, exception_state); |
| 1213 } | 1215 } |
| 1214 | 1216 |
| 1215 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1217 void WebGL2RenderingContextBase::texImage2D(ExecutionContext* execution_context, |
| 1218 GLenum target, |
| 1216 GLint level, | 1219 GLint level, |
| 1217 GLint internalformat, | 1220 GLint internalformat, |
| 1218 GLsizei width, | 1221 GLsizei width, |
| 1219 GLsizei height, | 1222 GLsizei height, |
| 1220 GLint border, | 1223 GLint border, |
| 1221 GLenum format, | 1224 GLenum format, |
| 1222 GLenum type, | 1225 GLenum type, |
| 1223 HTMLCanvasElement* canvas, | 1226 HTMLCanvasElement* canvas, |
| 1224 ExceptionState& exception_state) { | 1227 ExceptionState& exception_state) { |
| 1225 if (isContextLost()) | 1228 if (isContextLost()) |
| 1226 return; | 1229 return; |
| 1227 if (bound_pixel_unpack_buffer_) { | 1230 if (bound_pixel_unpack_buffer_) { |
| 1228 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1231 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1229 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1232 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1230 return; | 1233 return; |
| 1231 } | 1234 } |
| 1235 |
| 1232 TexImageHelperHTMLCanvasElement( | 1236 TexImageHelperHTMLCanvasElement( |
| 1233 kTexImage2D, target, level, internalformat, format, type, 0, 0, 0, canvas, | 1237 execution_context->GetSecurityOrigin(), kTexImage2D, target, level, |
| 1238 internalformat, format, type, 0, 0, 0, canvas, |
| 1234 GetTextureSourceSubRectangle(width, height), 1, 0, exception_state); | 1239 GetTextureSourceSubRectangle(width, height), 1, 0, exception_state); |
| 1235 } | 1240 } |
| 1236 | 1241 |
| 1237 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1242 void WebGL2RenderingContextBase::texImage2D(ExecutionContext* execution_context, |
| 1243 GLenum target, |
| 1238 GLint level, | 1244 GLint level, |
| 1239 GLint internalformat, | 1245 GLint internalformat, |
| 1240 GLsizei width, | 1246 GLsizei width, |
| 1241 GLsizei height, | 1247 GLsizei height, |
| 1242 GLint border, | 1248 GLint border, |
| 1243 GLenum format, | 1249 GLenum format, |
| 1244 GLenum type, | 1250 GLenum type, |
| 1245 HTMLVideoElement* video, | 1251 HTMLVideoElement* video, |
| 1246 ExceptionState& exception_state) { | 1252 ExceptionState& exception_state) { |
| 1247 if (isContextLost()) | 1253 if (isContextLost()) |
| 1248 return; | 1254 return; |
| 1249 if (bound_pixel_unpack_buffer_) { | 1255 if (bound_pixel_unpack_buffer_) { |
| 1250 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1256 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1251 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1257 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1252 return; | 1258 return; |
| 1253 } | 1259 } |
| 1260 |
| 1254 TexImageHelperHTMLVideoElement( | 1261 TexImageHelperHTMLVideoElement( |
| 1255 kTexImage2D, target, level, internalformat, format, type, 0, 0, 0, video, | 1262 execution_context->GetSecurityOrigin(), kTexImage2D, target, level, |
| 1263 internalformat, format, type, 0, 0, 0, video, |
| 1256 GetTextureSourceSubRectangle(width, height), 1, 0, exception_state); | 1264 GetTextureSourceSubRectangle(width, height), 1, 0, exception_state); |
| 1257 } | 1265 } |
| 1258 | 1266 |
| 1259 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1267 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1260 GLint level, | 1268 GLint level, |
| 1261 GLint internalformat, | 1269 GLint internalformat, |
| 1262 GLsizei width, | 1270 GLsizei width, |
| 1263 GLsizei height, | 1271 GLsizei height, |
| 1264 GLint border, | 1272 GLint border, |
| 1265 GLenum format, | 1273 GLenum format, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1289 return; | 1297 return; |
| 1290 if (bound_pixel_unpack_buffer_) { | 1298 if (bound_pixel_unpack_buffer_) { |
| 1291 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1299 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1292 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1300 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1293 return; | 1301 return; |
| 1294 } | 1302 } |
| 1295 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, | 1303 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, |
| 1296 type, image_data); | 1304 type, image_data); |
| 1297 } | 1305 } |
| 1298 | 1306 |
| 1299 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1307 void WebGL2RenderingContextBase::texImage2D(ExecutionContext* execution_context, |
| 1308 GLenum target, |
| 1300 GLint level, | 1309 GLint level, |
| 1301 GLint internalformat, | 1310 GLint internalformat, |
| 1302 GLenum format, | 1311 GLenum format, |
| 1303 GLenum type, | 1312 GLenum type, |
| 1304 HTMLImageElement* image, | 1313 HTMLImageElement* image, |
| 1305 ExceptionState& exception_state) { | 1314 ExceptionState& exception_state) { |
| 1306 if (isContextLost()) | 1315 if (isContextLost()) |
| 1307 return; | 1316 return; |
| 1308 if (bound_pixel_unpack_buffer_) { | 1317 if (bound_pixel_unpack_buffer_) { |
| 1309 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1318 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1310 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1319 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1311 return; | 1320 return; |
| 1312 } | 1321 } |
| 1313 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, | 1322 |
| 1314 type, image, exception_state); | 1323 WebGLRenderingContextBase::texImage2D(execution_context, target, level, |
| 1324 internalformat, format, type, image, |
| 1325 exception_state); |
| 1315 } | 1326 } |
| 1316 | 1327 |
| 1317 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1328 void WebGL2RenderingContextBase::texImage2D(ExecutionContext* execution_context, |
| 1329 GLenum target, |
| 1318 GLint level, | 1330 GLint level, |
| 1319 GLint internalformat, | 1331 GLint internalformat, |
| 1320 GLenum format, | 1332 GLenum format, |
| 1321 GLenum type, | 1333 GLenum type, |
| 1322 HTMLCanvasElement* canvas, | 1334 HTMLCanvasElement* canvas, |
| 1323 ExceptionState& exception_state) { | 1335 ExceptionState& exception_state) { |
| 1324 if (isContextLost()) | 1336 if (isContextLost()) |
| 1325 return; | 1337 return; |
| 1326 if (bound_pixel_unpack_buffer_) { | 1338 if (bound_pixel_unpack_buffer_) { |
| 1327 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1339 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1328 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1340 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1329 return; | 1341 return; |
| 1330 } | 1342 } |
| 1331 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, | 1343 |
| 1332 type, canvas, exception_state); | 1344 WebGLRenderingContextBase::texImage2D(execution_context, target, level, |
| 1345 internalformat, format, type, canvas, |
| 1346 exception_state); |
| 1333 } | 1347 } |
| 1334 | 1348 |
| 1335 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1349 void WebGL2RenderingContextBase::texImage2D(ExecutionContext* execution_context, |
| 1350 GLenum target, |
| 1336 GLint level, | 1351 GLint level, |
| 1337 GLint internalformat, | 1352 GLint internalformat, |
| 1338 GLenum format, | 1353 GLenum format, |
| 1339 GLenum type, | 1354 GLenum type, |
| 1340 HTMLVideoElement* video, | 1355 HTMLVideoElement* video, |
| 1341 ExceptionState& exception_state) { | 1356 ExceptionState& exception_state) { |
| 1342 if (isContextLost()) | 1357 if (isContextLost()) |
| 1343 return; | 1358 return; |
| 1344 if (bound_pixel_unpack_buffer_) { | 1359 if (bound_pixel_unpack_buffer_) { |
| 1345 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", | 1360 SynthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1346 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1361 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1347 return; | 1362 return; |
| 1348 } | 1363 } |
| 1349 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, | 1364 |
| 1350 type, video, exception_state); | 1365 WebGLRenderingContextBase::texImage2D(execution_context, target, level, |
| 1366 internalformat, format, type, video, |
| 1367 exception_state); |
| 1351 } | 1368 } |
| 1352 | 1369 |
| 1353 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1370 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1354 GLint level, | 1371 GLint level, |
| 1355 GLint internalformat, | 1372 GLint internalformat, |
| 1356 GLenum format, | 1373 GLenum format, |
| 1357 GLenum type, | 1374 GLenum type, |
| 1358 ImageBitmap* image_bit_map, | 1375 ImageBitmap* image_bit_map, |
| 1359 ExceptionState& exception_state) { | 1376 ExceptionState& exception_state) { |
| 1360 if (isContextLost()) | 1377 if (isContextLost()) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1443 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1427 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1444 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1428 return; | 1445 return; |
| 1429 } | 1446 } |
| 1430 TexImageHelperImageData(kTexSubImage2D, target, level, 0, 0, format, type, 1, | 1447 TexImageHelperImageData(kTexSubImage2D, target, level, 0, 0, format, type, 1, |
| 1431 xoffset, yoffset, 0, pixels, | 1448 xoffset, yoffset, 0, pixels, |
| 1432 GetTextureSourceSubRectangle(width, height), 0); | 1449 GetTextureSourceSubRectangle(width, height), 0); |
| 1433 } | 1450 } |
| 1434 | 1451 |
| 1435 void WebGL2RenderingContextBase::texSubImage2D( | 1452 void WebGL2RenderingContextBase::texSubImage2D( |
| 1453 ExecutionContext* execution_context, |
| 1436 GLenum target, | 1454 GLenum target, |
| 1437 GLint level, | 1455 GLint level, |
| 1438 GLint xoffset, | 1456 GLint xoffset, |
| 1439 GLint yoffset, | 1457 GLint yoffset, |
| 1440 GLsizei width, | 1458 GLsizei width, |
| 1441 GLsizei height, | 1459 GLsizei height, |
| 1442 GLenum format, | 1460 GLenum format, |
| 1443 GLenum type, | 1461 GLenum type, |
| 1444 HTMLImageElement* image, | 1462 HTMLImageElement* image, |
| 1445 ExceptionState& exception_state) { | 1463 ExceptionState& exception_state) { |
| 1446 if (isContextLost()) | 1464 if (isContextLost()) |
| 1447 return; | 1465 return; |
| 1448 if (bound_pixel_unpack_buffer_) { | 1466 if (bound_pixel_unpack_buffer_) { |
| 1449 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1467 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1450 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1468 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1451 return; | 1469 return; |
| 1452 } | 1470 } |
| 1453 TexImageHelperHTMLImageElement(kTexSubImage2D, target, level, 0, format, type, | 1471 |
| 1454 xoffset, yoffset, 0, image, | 1472 TexImageHelperHTMLImageElement( |
| 1455 GetTextureSourceSubRectangle(width, height), 1, | 1473 execution_context->GetSecurityOrigin(), kTexSubImage2D, target, level, 0, |
| 1456 0, exception_state); | 1474 format, type, xoffset, yoffset, 0, image, |
| 1475 GetTextureSourceSubRectangle(width, height), 1, 0, exception_state); |
| 1457 } | 1476 } |
| 1458 | 1477 |
| 1459 void WebGL2RenderingContextBase::texSubImage2D( | 1478 void WebGL2RenderingContextBase::texSubImage2D( |
| 1479 ExecutionContext* execution_context, |
| 1460 GLenum target, | 1480 GLenum target, |
| 1461 GLint level, | 1481 GLint level, |
| 1462 GLint xoffset, | 1482 GLint xoffset, |
| 1463 GLint yoffset, | 1483 GLint yoffset, |
| 1464 GLsizei width, | 1484 GLsizei width, |
| 1465 GLsizei height, | 1485 GLsizei height, |
| 1466 GLenum format, | 1486 GLenum format, |
| 1467 GLenum type, | 1487 GLenum type, |
| 1468 HTMLCanvasElement* canvas, | 1488 HTMLCanvasElement* canvas, |
| 1469 ExceptionState& exception_state) { | 1489 ExceptionState& exception_state) { |
| 1470 if (isContextLost()) | 1490 if (isContextLost()) |
| 1471 return; | 1491 return; |
| 1472 if (bound_pixel_unpack_buffer_) { | 1492 if (bound_pixel_unpack_buffer_) { |
| 1473 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1493 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1474 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1494 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1475 return; | 1495 return; |
| 1476 } | 1496 } |
| 1477 TexImageHelperHTMLCanvasElement(kTexSubImage2D, target, level, 0, format, | 1497 |
| 1478 type, xoffset, yoffset, 0, canvas, | 1498 TexImageHelperHTMLCanvasElement( |
| 1479 GetTextureSourceSubRectangle(width, height), | 1499 execution_context->GetSecurityOrigin(), kTexSubImage2D, target, level, 0, |
| 1480 1, 0, exception_state); | 1500 format, type, xoffset, yoffset, 0, canvas, |
| 1501 GetTextureSourceSubRectangle(width, height), 1, 0, exception_state); |
| 1481 } | 1502 } |
| 1482 | 1503 |
| 1483 void WebGL2RenderingContextBase::texSubImage2D( | 1504 void WebGL2RenderingContextBase::texSubImage2D( |
| 1505 ExecutionContext* execution_context, |
| 1484 GLenum target, | 1506 GLenum target, |
| 1485 GLint level, | 1507 GLint level, |
| 1486 GLint xoffset, | 1508 GLint xoffset, |
| 1487 GLint yoffset, | 1509 GLint yoffset, |
| 1488 GLsizei width, | 1510 GLsizei width, |
| 1489 GLsizei height, | 1511 GLsizei height, |
| 1490 GLenum format, | 1512 GLenum format, |
| 1491 GLenum type, | 1513 GLenum type, |
| 1492 HTMLVideoElement* video, | 1514 HTMLVideoElement* video, |
| 1493 ExceptionState& exception_state) { | 1515 ExceptionState& exception_state) { |
| 1494 if (isContextLost()) | 1516 if (isContextLost()) |
| 1495 return; | 1517 return; |
| 1496 if (bound_pixel_unpack_buffer_) { | 1518 if (bound_pixel_unpack_buffer_) { |
| 1497 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1519 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1498 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1520 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1499 return; | 1521 return; |
| 1500 } | 1522 } |
| 1501 TexImageHelperHTMLVideoElement(kTexSubImage2D, target, level, 0, format, type, | 1523 |
| 1502 xoffset, yoffset, 0, video, | 1524 TexImageHelperHTMLVideoElement( |
| 1503 GetTextureSourceSubRectangle(width, height), 1, | 1525 execution_context->GetSecurityOrigin(), kTexSubImage2D, target, level, 0, |
| 1504 0, exception_state); | 1526 format, type, xoffset, yoffset, 0, video, |
| 1527 GetTextureSourceSubRectangle(width, height), 1, 0, exception_state); |
| 1505 } | 1528 } |
| 1506 | 1529 |
| 1507 void WebGL2RenderingContextBase::texSubImage2D( | 1530 void WebGL2RenderingContextBase::texSubImage2D( |
| 1508 GLenum target, | 1531 GLenum target, |
| 1509 GLint level, | 1532 GLint level, |
| 1510 GLint xoffset, | 1533 GLint xoffset, |
| 1511 GLint yoffset, | 1534 GLint yoffset, |
| 1512 GLsizei width, | 1535 GLsizei width, |
| 1513 GLsizei height, | 1536 GLsizei height, |
| 1514 GLenum format, | 1537 GLenum format, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1541 if (bound_pixel_unpack_buffer_) { | 1564 if (bound_pixel_unpack_buffer_) { |
| 1542 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1565 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1543 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1566 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1544 return; | 1567 return; |
| 1545 } | 1568 } |
| 1546 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, | 1569 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, |
| 1547 format, type, pixels); | 1570 format, type, pixels); |
| 1548 } | 1571 } |
| 1549 | 1572 |
| 1550 void WebGL2RenderingContextBase::texSubImage2D( | 1573 void WebGL2RenderingContextBase::texSubImage2D( |
| 1574 ExecutionContext* execution_context, |
| 1551 GLenum target, | 1575 GLenum target, |
| 1552 GLint level, | 1576 GLint level, |
| 1553 GLint xoffset, | 1577 GLint xoffset, |
| 1554 GLint yoffset, | 1578 GLint yoffset, |
| 1555 GLenum format, | 1579 GLenum format, |
| 1556 GLenum type, | 1580 GLenum type, |
| 1557 HTMLImageElement* image, | 1581 HTMLImageElement* image, |
| 1558 ExceptionState& exception_state) { | 1582 ExceptionState& exception_state) { |
| 1559 if (isContextLost()) | 1583 if (isContextLost()) |
| 1560 return; | 1584 return; |
| 1561 if (bound_pixel_unpack_buffer_) { | 1585 if (bound_pixel_unpack_buffer_) { |
| 1562 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1586 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1563 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1587 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1564 return; | 1588 return; |
| 1565 } | 1589 } |
| 1566 WebGLRenderingContextBase::texSubImage2D( | 1590 |
| 1567 target, level, xoffset, yoffset, format, type, image, exception_state); | 1591 WebGLRenderingContextBase::texSubImage2D(execution_context, target, level, |
| 1592 xoffset, yoffset, format, type, |
| 1593 image, exception_state); |
| 1568 } | 1594 } |
| 1569 | 1595 |
| 1570 void WebGL2RenderingContextBase::texSubImage2D( | 1596 void WebGL2RenderingContextBase::texSubImage2D( |
| 1597 ExecutionContext* execution_context, |
| 1571 GLenum target, | 1598 GLenum target, |
| 1572 GLint level, | 1599 GLint level, |
| 1573 GLint xoffset, | 1600 GLint xoffset, |
| 1574 GLint yoffset, | 1601 GLint yoffset, |
| 1575 GLenum format, | 1602 GLenum format, |
| 1576 GLenum type, | 1603 GLenum type, |
| 1577 HTMLCanvasElement* canvas, | 1604 HTMLCanvasElement* canvas, |
| 1578 ExceptionState& exception_state) { | 1605 ExceptionState& exception_state) { |
| 1579 if (isContextLost()) | 1606 if (isContextLost()) |
| 1580 return; | 1607 return; |
| 1581 if (bound_pixel_unpack_buffer_) { | 1608 if (bound_pixel_unpack_buffer_) { |
| 1582 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", | 1609 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1583 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1610 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1584 return; | 1611 return; |
| 1585 } | 1612 } |
| 1586 WebGLRenderingContextBase::texSubImage2D( | 1613 |
| 1587 target, level, xoffset, yoffset, format, type, canvas, exception_state); | 1614 WebGLRenderingContextBase::texSubImage2D(execution_context, target, level, |
| 1615 xoffset, yoffset, format, type, |
| 1616 canvas, exception_state); |
| 1588 } | 1617 } |
| 1589 | 1618 |
| 1590 void WebGL2RenderingContextBase::texSubImage2D( | 1619 void WebGL2RenderingContextBase::texSubImage2D( |
| 1620 ExecutionContext* execution_context, |
| 1591 GLenum target, | 1621 GLenum target, |
| 1592 GLint level, | 1622 GLint level, |
| 1593 GLint xoffset, | 1623 GLint xoffset, |
| 1594 GLint yoffset, | 1624 GLint yoffset, |
| 1595 GLenum format, | 1625 GLenum format, |
| 1596 GLenum type, | 1626 GLenum type, |
| 1597 HTMLVideoElement* video, | 1627 HTMLVideoElement* video, |
| 1598 ExceptionState& exception_state) { | 1628 ExceptionState& exception_state) { |
| 1599 WebGLRenderingContextBase::texSubImage2D( | 1629 WebGLRenderingContextBase::texSubImage2D(execution_context, target, level, |
| 1600 target, level, xoffset, yoffset, format, type, video, exception_state); | 1630 xoffset, yoffset, format, type, |
| 1631 video, exception_state); |
| 1601 } | 1632 } |
| 1602 | 1633 |
| 1603 void WebGL2RenderingContextBase::texSubImage2D( | 1634 void WebGL2RenderingContextBase::texSubImage2D( |
| 1604 GLenum target, | 1635 GLenum target, |
| 1605 GLint level, | 1636 GLint level, |
| 1606 GLint xoffset, | 1637 GLint xoffset, |
| 1607 GLint yoffset, | 1638 GLint yoffset, |
| 1608 GLenum format, | 1639 GLenum format, |
| 1609 GLenum type, | 1640 GLenum type, |
| 1610 ImageBitmap* bitmap, | 1641 ImageBitmap* bitmap, |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1731 DCHECK(pixels); | 1762 DCHECK(pixels); |
| 1732 IntRect source_image_rect; | 1763 IntRect source_image_rect; |
| 1733 source_image_rect.SetLocation( | 1764 source_image_rect.SetLocation( |
| 1734 IntPoint(unpack_skip_pixels_, unpack_skip_rows_)); | 1765 IntPoint(unpack_skip_pixels_, unpack_skip_rows_)); |
| 1735 source_image_rect.SetSize(IntSize(width, height)); | 1766 source_image_rect.SetSize(IntSize(width, height)); |
| 1736 TexImageHelperImageData(kTexImage3D, target, level, internalformat, 0, format, | 1767 TexImageHelperImageData(kTexImage3D, target, level, internalformat, 0, format, |
| 1737 type, depth, 0, 0, 0, pixels, source_image_rect, | 1768 type, depth, 0, 0, 0, pixels, source_image_rect, |
| 1738 unpack_image_height_); | 1769 unpack_image_height_); |
| 1739 } | 1770 } |
| 1740 | 1771 |
| 1741 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1772 void WebGL2RenderingContextBase::texImage3D(ExecutionContext* execution_context, |
| 1773 GLenum target, |
| 1742 GLint level, | 1774 GLint level, |
| 1743 GLint internalformat, | 1775 GLint internalformat, |
| 1744 GLsizei width, | 1776 GLsizei width, |
| 1745 GLsizei height, | 1777 GLsizei height, |
| 1746 GLsizei depth, | 1778 GLsizei depth, |
| 1747 GLint border, | 1779 GLint border, |
| 1748 GLenum format, | 1780 GLenum format, |
| 1749 GLenum type, | 1781 GLenum type, |
| 1750 HTMLImageElement* image, | 1782 HTMLImageElement* image, |
| 1751 ExceptionState& exception_state) { | 1783 ExceptionState& exception_state) { |
| 1752 if (isContextLost()) | 1784 if (isContextLost()) |
| 1753 return; | 1785 return; |
| 1754 if (bound_pixel_unpack_buffer_) { | 1786 if (bound_pixel_unpack_buffer_) { |
| 1755 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", | 1787 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", |
| 1756 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1788 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1757 return; | 1789 return; |
| 1758 } | 1790 } |
| 1759 TexImageHelperHTMLImageElement(kTexImage3D, target, level, internalformat, | 1791 |
| 1792 TexImageHelperHTMLImageElement(execution_context->GetSecurityOrigin(), |
| 1793 kTexImage3D, target, level, internalformat, |
| 1760 format, type, 0, 0, 0, image, | 1794 format, type, 0, 0, 0, image, |
| 1761 GetTextureSourceSubRectangle(width, height), | 1795 GetTextureSourceSubRectangle(width, height), |
| 1762 depth, unpack_image_height_, exception_state); | 1796 depth, unpack_image_height_, exception_state); |
| 1763 } | 1797 } |
| 1764 | 1798 |
| 1765 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1799 void WebGL2RenderingContextBase::texImage3D(ExecutionContext* execution_context, |
| 1800 GLenum target, |
| 1766 GLint level, | 1801 GLint level, |
| 1767 GLint internalformat, | 1802 GLint internalformat, |
| 1768 GLsizei width, | 1803 GLsizei width, |
| 1769 GLsizei height, | 1804 GLsizei height, |
| 1770 GLsizei depth, | 1805 GLsizei depth, |
| 1771 GLint border, | 1806 GLint border, |
| 1772 GLenum format, | 1807 GLenum format, |
| 1773 GLenum type, | 1808 GLenum type, |
| 1774 HTMLCanvasElement* canvas, | 1809 HTMLCanvasElement* canvas, |
| 1775 ExceptionState& exception_state) { | 1810 ExceptionState& exception_state) { |
| 1776 if (isContextLost()) | 1811 if (isContextLost()) |
| 1777 return; | 1812 return; |
| 1778 if (bound_pixel_unpack_buffer_) { | 1813 if (bound_pixel_unpack_buffer_) { |
| 1779 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", | 1814 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", |
| 1780 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1815 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1781 return; | 1816 return; |
| 1782 } | 1817 } |
| 1783 TexImageHelperHTMLCanvasElement(kTexImage3D, target, level, internalformat, | 1818 |
| 1819 TexImageHelperHTMLCanvasElement(execution_context->GetSecurityOrigin(), |
| 1820 kTexImage3D, target, level, internalformat, |
| 1784 format, type, 0, 0, 0, canvas, | 1821 format, type, 0, 0, 0, canvas, |
| 1785 GetTextureSourceSubRectangle(width, height), | 1822 GetTextureSourceSubRectangle(width, height), |
| 1786 depth, unpack_image_height_, exception_state); | 1823 depth, unpack_image_height_, exception_state); |
| 1787 } | 1824 } |
| 1788 | 1825 |
| 1789 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1826 void WebGL2RenderingContextBase::texImage3D(ExecutionContext* execution_context, |
| 1827 GLenum target, |
| 1790 GLint level, | 1828 GLint level, |
| 1791 GLint internalformat, | 1829 GLint internalformat, |
| 1792 GLsizei width, | 1830 GLsizei width, |
| 1793 GLsizei height, | 1831 GLsizei height, |
| 1794 GLsizei depth, | 1832 GLsizei depth, |
| 1795 GLint border, | 1833 GLint border, |
| 1796 GLenum format, | 1834 GLenum format, |
| 1797 GLenum type, | 1835 GLenum type, |
| 1798 HTMLVideoElement* video, | 1836 HTMLVideoElement* video, |
| 1799 ExceptionState& exception_state) { | 1837 ExceptionState& exception_state) { |
| 1800 if (isContextLost()) | 1838 if (isContextLost()) |
| 1801 return; | 1839 return; |
| 1802 if (bound_pixel_unpack_buffer_) { | 1840 if (bound_pixel_unpack_buffer_) { |
| 1803 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", | 1841 SynthesizeGLError(GL_INVALID_OPERATION, "texImage3D", |
| 1804 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1842 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1805 return; | 1843 return; |
| 1806 } | 1844 } |
| 1807 TexImageHelperHTMLVideoElement(kTexImage3D, target, level, internalformat, | 1845 |
| 1846 TexImageHelperHTMLVideoElement(execution_context->GetSecurityOrigin(), |
| 1847 kTexImage3D, target, level, internalformat, |
| 1808 format, type, 0, 0, 0, video, | 1848 format, type, 0, 0, 0, video, |
| 1809 GetTextureSourceSubRectangle(width, height), | 1849 GetTextureSourceSubRectangle(width, height), |
| 1810 depth, unpack_image_height_, exception_state); | 1850 depth, unpack_image_height_, exception_state); |
| 1811 } | 1851 } |
| 1812 | 1852 |
| 1813 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1853 void WebGL2RenderingContextBase::texImage3D(GLenum target, |
| 1814 GLint level, | 1854 GLint level, |
| 1815 GLint internalformat, | 1855 GLint internalformat, |
| 1816 GLsizei width, | 1856 GLsizei width, |
| 1817 GLsizei height, | 1857 GLsizei height, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1909 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1949 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1910 return; | 1950 return; |
| 1911 } | 1951 } |
| 1912 TexImageHelperImageData(kTexSubImage3D, target, level, 0, 0, format, type, | 1952 TexImageHelperImageData(kTexSubImage3D, target, level, 0, 0, format, type, |
| 1913 depth, xoffset, yoffset, zoffset, pixels, | 1953 depth, xoffset, yoffset, zoffset, pixels, |
| 1914 GetTextureSourceSubRectangle(width, height), | 1954 GetTextureSourceSubRectangle(width, height), |
| 1915 unpack_image_height_); | 1955 unpack_image_height_); |
| 1916 } | 1956 } |
| 1917 | 1957 |
| 1918 void WebGL2RenderingContextBase::texSubImage3D( | 1958 void WebGL2RenderingContextBase::texSubImage3D( |
| 1959 ExecutionContext* execution_context, |
| 1919 GLenum target, | 1960 GLenum target, |
| 1920 GLint level, | 1961 GLint level, |
| 1921 GLint xoffset, | 1962 GLint xoffset, |
| 1922 GLint yoffset, | 1963 GLint yoffset, |
| 1923 GLint zoffset, | 1964 GLint zoffset, |
| 1924 GLsizei width, | 1965 GLsizei width, |
| 1925 GLsizei height, | 1966 GLsizei height, |
| 1926 GLsizei depth, | 1967 GLsizei depth, |
| 1927 GLenum format, | 1968 GLenum format, |
| 1928 GLenum type, | 1969 GLenum type, |
| 1929 HTMLImageElement* image, | 1970 HTMLImageElement* image, |
| 1930 ExceptionState& exception_state) { | 1971 ExceptionState& exception_state) { |
| 1931 if (isContextLost()) | 1972 if (isContextLost()) |
| 1932 return; | 1973 return; |
| 1933 if (bound_pixel_unpack_buffer_) { | 1974 if (bound_pixel_unpack_buffer_) { |
| 1934 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", | 1975 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", |
| 1935 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 1976 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1936 return; | 1977 return; |
| 1937 } | 1978 } |
| 1938 TexImageHelperHTMLImageElement(kTexSubImage3D, target, level, 0, format, type, | 1979 |
| 1980 TexImageHelperHTMLImageElement(execution_context->GetSecurityOrigin(), |
| 1981 kTexSubImage3D, target, level, 0, format, type, |
| 1939 xoffset, yoffset, zoffset, image, | 1982 xoffset, yoffset, zoffset, image, |
| 1940 GetTextureSourceSubRectangle(width, height), | 1983 GetTextureSourceSubRectangle(width, height), |
| 1941 depth, unpack_image_height_, exception_state); | 1984 depth, unpack_image_height_, exception_state); |
| 1942 } | 1985 } |
| 1943 | 1986 |
| 1944 void WebGL2RenderingContextBase::texSubImage3D( | 1987 void WebGL2RenderingContextBase::texSubImage3D( |
| 1988 ExecutionContext* execution_context, |
| 1945 GLenum target, | 1989 GLenum target, |
| 1946 GLint level, | 1990 GLint level, |
| 1947 GLint xoffset, | 1991 GLint xoffset, |
| 1948 GLint yoffset, | 1992 GLint yoffset, |
| 1949 GLint zoffset, | 1993 GLint zoffset, |
| 1950 GLsizei width, | 1994 GLsizei width, |
| 1951 GLsizei height, | 1995 GLsizei height, |
| 1952 GLsizei depth, | 1996 GLsizei depth, |
| 1953 GLenum format, | 1997 GLenum format, |
| 1954 GLenum type, | 1998 GLenum type, |
| 1955 HTMLCanvasElement* canvas, | 1999 HTMLCanvasElement* canvas, |
| 1956 ExceptionState& exception_state) { | 2000 ExceptionState& exception_state) { |
| 1957 if (isContextLost()) | 2001 if (isContextLost()) |
| 1958 return; | 2002 return; |
| 1959 if (bound_pixel_unpack_buffer_) { | 2003 if (bound_pixel_unpack_buffer_) { |
| 1960 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", | 2004 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", |
| 1961 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2005 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1962 return; | 2006 return; |
| 1963 } | 2007 } |
| 1964 TexImageHelperHTMLCanvasElement(kTexSubImage3D, target, level, 0, format, | 2008 |
| 2009 TexImageHelperHTMLCanvasElement(execution_context->GetSecurityOrigin(), |
| 2010 kTexSubImage3D, target, level, 0, format, |
| 1965 type, xoffset, yoffset, zoffset, canvas, | 2011 type, xoffset, yoffset, zoffset, canvas, |
| 1966 GetTextureSourceSubRectangle(width, height), | 2012 GetTextureSourceSubRectangle(width, height), |
| 1967 depth, unpack_image_height_, exception_state); | 2013 depth, unpack_image_height_, exception_state); |
| 1968 } | 2014 } |
| 1969 | 2015 |
| 1970 void WebGL2RenderingContextBase::texSubImage3D( | 2016 void WebGL2RenderingContextBase::texSubImage3D( |
| 2017 ExecutionContext* execution_context, |
| 1971 GLenum target, | 2018 GLenum target, |
| 1972 GLint level, | 2019 GLint level, |
| 1973 GLint xoffset, | 2020 GLint xoffset, |
| 1974 GLint yoffset, | 2021 GLint yoffset, |
| 1975 GLint zoffset, | 2022 GLint zoffset, |
| 1976 GLsizei width, | 2023 GLsizei width, |
| 1977 GLsizei height, | 2024 GLsizei height, |
| 1978 GLsizei depth, | 2025 GLsizei depth, |
| 1979 GLenum format, | 2026 GLenum format, |
| 1980 GLenum type, | 2027 GLenum type, |
| 1981 HTMLVideoElement* video, | 2028 HTMLVideoElement* video, |
| 1982 ExceptionState& exception_state) { | 2029 ExceptionState& exception_state) { |
| 1983 if (isContextLost()) | 2030 if (isContextLost()) |
| 1984 return; | 2031 return; |
| 1985 if (bound_pixel_unpack_buffer_) { | 2032 if (bound_pixel_unpack_buffer_) { |
| 1986 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", | 2033 SynthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", |
| 1987 "a buffer is bound to PIXEL_UNPACK_BUFFER"); | 2034 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1988 return; | 2035 return; |
| 1989 } | 2036 } |
| 1990 TexImageHelperHTMLVideoElement(kTexSubImage3D, target, level, 0, format, type, | 2037 |
| 2038 TexImageHelperHTMLVideoElement(execution_context->GetSecurityOrigin(), |
| 2039 kTexSubImage3D, target, level, 0, format, type, |
| 1991 xoffset, yoffset, zoffset, video, | 2040 xoffset, yoffset, zoffset, video, |
| 1992 GetTextureSourceSubRectangle(width, height), | 2041 GetTextureSourceSubRectangle(width, height), |
| 1993 depth, unpack_image_height_, exception_state); | 2042 depth, unpack_image_height_, exception_state); |
| 1994 } | 2043 } |
| 1995 | 2044 |
| 1996 void WebGL2RenderingContextBase::texSubImage3D( | 2045 void WebGL2RenderingContextBase::texSubImage3D( |
| 1997 GLenum target, | 2046 GLenum target, |
| 1998 GLint level, | 2047 GLint level, |
| 1999 GLint xoffset, | 2048 GLint xoffset, |
| 2000 GLint yoffset, | 2049 GLint yoffset, |
| (...skipping 3674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5675 | 5724 |
| 5676 void WebGL2RenderingContextBase:: | 5725 void WebGL2RenderingContextBase:: |
| 5677 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 5726 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
| 5678 if (!ContextGL()) | 5727 if (!ContextGL()) |
| 5679 return; | 5728 return; |
| 5680 ContextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 5729 ContextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
| 5681 ObjectOrZero(bound_pixel_unpack_buffer_.Get())); | 5730 ObjectOrZero(bound_pixel_unpack_buffer_.Get())); |
| 5682 } | 5731 } |
| 5683 | 5732 |
| 5684 } // namespace blink | 5733 } // namespace blink |
| OLD | NEW |