| 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 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 | 1144 |
| 1145 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1145 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1146 GLint level, | 1146 GLint level, |
| 1147 GLint internalformat, | 1147 GLint internalformat, |
| 1148 GLsizei width, | 1148 GLsizei width, |
| 1149 GLsizei height, | 1149 GLsizei height, |
| 1150 GLint border, | 1150 GLint border, |
| 1151 GLenum format, | 1151 GLenum format, |
| 1152 GLenum type, | 1152 GLenum type, |
| 1153 DOMArrayBufferView* data) { | 1153 DOMArrayBufferView* data) { |
| 1154 if (isContextLost()) |
| 1155 return; |
| 1156 if (m_boundPixelUnpackBuffer) { |
| 1157 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1158 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1159 return; |
| 1160 } |
| 1154 WebGLRenderingContextBase::texImage2D(target, level, internalformat, width, | 1161 WebGLRenderingContextBase::texImage2D(target, level, internalformat, width, |
| 1155 height, border, format, type, data); | 1162 height, border, format, type, data); |
| 1156 } | 1163 } |
| 1157 | 1164 |
| 1158 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1165 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1159 GLint level, | 1166 GLint level, |
| 1160 GLint internalformat, | 1167 GLint internalformat, |
| 1161 GLsizei width, | 1168 GLsizei width, |
| 1162 GLsizei height, | 1169 GLsizei height, |
| 1163 GLint border, | 1170 GLint border, |
| 1164 GLenum format, | 1171 GLenum format, |
| 1165 GLenum type, | 1172 GLenum type, |
| 1166 DOMArrayBufferView* data, | 1173 DOMArrayBufferView* data, |
| 1167 GLuint srcOffset) { | 1174 GLuint srcOffset) { |
| 1175 if (isContextLost()) |
| 1176 return; |
| 1177 if (m_boundPixelUnpackBuffer) { |
| 1178 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1179 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1180 return; |
| 1181 } |
| 1168 texImageHelperDOMArrayBufferView(TexImage2D, target, level, internalformat, | 1182 texImageHelperDOMArrayBufferView(TexImage2D, target, level, internalformat, |
| 1169 width, height, 1, border, format, type, 0, 0, | 1183 width, height, 1, border, format, type, 0, 0, |
| 1170 0, data, NullNotReachable, srcOffset); | 1184 0, data, NullNotReachable, srcOffset); |
| 1171 } | 1185 } |
| 1172 | 1186 |
| 1173 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1187 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1174 GLint level, | 1188 GLint level, |
| 1175 GLint internalformat, | 1189 GLint internalformat, |
| 1176 GLsizei width, | 1190 GLsizei width, |
| 1177 GLsizei height, | 1191 GLsizei height, |
| 1178 GLint border, | 1192 GLint border, |
| 1179 GLenum format, | 1193 GLenum format, |
| 1180 GLenum type, | 1194 GLenum type, |
| 1181 ImageData* pixels) { | 1195 ImageData* pixels) { |
| 1182 DCHECK(pixels); | 1196 DCHECK(pixels); |
| 1197 if (isContextLost()) |
| 1198 return; |
| 1199 if (m_boundPixelUnpackBuffer) { |
| 1200 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1201 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1202 return; |
| 1203 } |
| 1183 texImageHelperImageData(TexImage2D, target, level, internalformat, 0, format, | 1204 texImageHelperImageData(TexImage2D, target, level, internalformat, 0, format, |
| 1184 type, 1, 0, 0, 0, pixels, | 1205 type, 1, 0, 0, 0, pixels, |
| 1185 getTextureSourceSubRectangle(width, height), 0); | 1206 getTextureSourceSubRectangle(width, height), 0); |
| 1186 } | 1207 } |
| 1187 | 1208 |
| 1188 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1209 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1189 GLint level, | 1210 GLint level, |
| 1190 GLint internalformat, | 1211 GLint internalformat, |
| 1191 GLsizei width, | 1212 GLsizei width, |
| 1192 GLsizei height, | 1213 GLsizei height, |
| 1193 GLint border, | 1214 GLint border, |
| 1194 GLenum format, | 1215 GLenum format, |
| 1195 GLenum type, | 1216 GLenum type, |
| 1196 HTMLImageElement* image, | 1217 HTMLImageElement* image, |
| 1197 ExceptionState& exceptionState) { | 1218 ExceptionState& exceptionState) { |
| 1219 if (isContextLost()) |
| 1220 return; |
| 1221 if (m_boundPixelUnpackBuffer) { |
| 1222 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1223 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1224 return; |
| 1225 } |
| 1198 texImageHelperHTMLImageElement(TexImage2D, target, level, internalformat, | 1226 texImageHelperHTMLImageElement(TexImage2D, target, level, internalformat, |
| 1199 format, type, 0, 0, 0, image, | 1227 format, type, 0, 0, 0, image, |
| 1200 getTextureSourceSubRectangle(width, height), 1, | 1228 getTextureSourceSubRectangle(width, height), 1, |
| 1201 m_unpackImageHeight, exceptionState); | 1229 m_unpackImageHeight, exceptionState); |
| 1202 } | 1230 } |
| 1203 | 1231 |
| 1204 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1232 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1205 GLint level, | 1233 GLint level, |
| 1206 GLint internalformat, | 1234 GLint internalformat, |
| 1207 GLsizei width, | 1235 GLsizei width, |
| 1208 GLsizei height, | 1236 GLsizei height, |
| 1209 GLint border, | 1237 GLint border, |
| 1210 GLenum format, | 1238 GLenum format, |
| 1211 GLenum type, | 1239 GLenum type, |
| 1212 HTMLCanvasElement* canvas, | 1240 HTMLCanvasElement* canvas, |
| 1213 ExceptionState& exceptionState) { | 1241 ExceptionState& exceptionState) { |
| 1242 if (isContextLost()) |
| 1243 return; |
| 1244 if (m_boundPixelUnpackBuffer) { |
| 1245 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1246 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1247 return; |
| 1248 } |
| 1214 texImageHelperHTMLCanvasElement( | 1249 texImageHelperHTMLCanvasElement( |
| 1215 TexImage2D, target, level, internalformat, format, type, 0, 0, 0, canvas, | 1250 TexImage2D, target, level, internalformat, format, type, 0, 0, 0, canvas, |
| 1216 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); | 1251 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); |
| 1217 } | 1252 } |
| 1218 | 1253 |
| 1219 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1254 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1220 GLint level, | 1255 GLint level, |
| 1221 GLint internalformat, | 1256 GLint internalformat, |
| 1222 GLsizei width, | 1257 GLsizei width, |
| 1223 GLsizei height, | 1258 GLsizei height, |
| 1224 GLint border, | 1259 GLint border, |
| 1225 GLenum format, | 1260 GLenum format, |
| 1226 GLenum type, | 1261 GLenum type, |
| 1227 HTMLVideoElement* video, | 1262 HTMLVideoElement* video, |
| 1228 ExceptionState& exceptionState) { | 1263 ExceptionState& exceptionState) { |
| 1264 if (isContextLost()) |
| 1265 return; |
| 1266 if (m_boundPixelUnpackBuffer) { |
| 1267 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1268 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1269 return; |
| 1270 } |
| 1229 texImageHelperHTMLVideoElement( | 1271 texImageHelperHTMLVideoElement( |
| 1230 TexImage2D, target, level, internalformat, format, type, 0, 0, 0, video, | 1272 TexImage2D, target, level, internalformat, format, type, 0, 0, 0, video, |
| 1231 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); | 1273 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); |
| 1232 } | 1274 } |
| 1233 | 1275 |
| 1234 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1276 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1235 GLint level, | 1277 GLint level, |
| 1236 GLint internalformat, | 1278 GLint internalformat, |
| 1237 GLsizei width, | 1279 GLsizei width, |
| 1238 GLsizei height, | 1280 GLsizei height, |
| 1239 GLint border, | 1281 GLint border, |
| 1240 GLenum format, | 1282 GLenum format, |
| 1241 GLenum type, | 1283 GLenum type, |
| 1242 ImageBitmap* bitmap, | 1284 ImageBitmap* bitmap, |
| 1243 ExceptionState& exceptionState) { | 1285 ExceptionState& exceptionState) { |
| 1244 DCHECK(bitmap); | 1286 DCHECK(bitmap); |
| 1287 if (isContextLost()) |
| 1288 return; |
| 1289 if (m_boundPixelUnpackBuffer) { |
| 1290 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1291 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1292 return; |
| 1293 } |
| 1245 texImageHelperImageBitmap( | 1294 texImageHelperImageBitmap( |
| 1246 TexImage2D, target, level, internalformat, format, type, 0, 0, 0, bitmap, | 1295 TexImage2D, target, level, internalformat, format, type, 0, 0, 0, bitmap, |
| 1247 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); | 1296 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); |
| 1248 } | 1297 } |
| 1249 | 1298 |
| 1250 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1299 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1251 GLint level, | 1300 GLint level, |
| 1252 GLint internalformat, | 1301 GLint internalformat, |
| 1253 GLenum format, | 1302 GLenum format, |
| 1254 GLenum type, | 1303 GLenum type, |
| 1255 ImageData* imageData) { | 1304 ImageData* imageData) { |
| 1305 if (isContextLost()) |
| 1306 return; |
| 1307 if (m_boundPixelUnpackBuffer) { |
| 1308 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1309 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1310 return; |
| 1311 } |
| 1256 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, | 1312 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, |
| 1257 type, imageData); | 1313 type, imageData); |
| 1258 } | 1314 } |
| 1259 | 1315 |
| 1260 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1316 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1261 GLint level, | 1317 GLint level, |
| 1262 GLint internalformat, | 1318 GLint internalformat, |
| 1263 GLenum format, | 1319 GLenum format, |
| 1264 GLenum type, | 1320 GLenum type, |
| 1265 HTMLImageElement* image, | 1321 HTMLImageElement* image, |
| 1266 ExceptionState& exceptionState) { | 1322 ExceptionState& exceptionState) { |
| 1323 if (isContextLost()) |
| 1324 return; |
| 1325 if (m_boundPixelUnpackBuffer) { |
| 1326 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1327 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1328 return; |
| 1329 } |
| 1267 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, | 1330 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, |
| 1268 type, image, exceptionState); | 1331 type, image, exceptionState); |
| 1269 } | 1332 } |
| 1270 | 1333 |
| 1271 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1334 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1272 GLint level, | 1335 GLint level, |
| 1273 GLint internalformat, | 1336 GLint internalformat, |
| 1274 GLenum format, | 1337 GLenum format, |
| 1275 GLenum type, | 1338 GLenum type, |
| 1276 HTMLCanvasElement* canvas, | 1339 HTMLCanvasElement* canvas, |
| 1277 ExceptionState& exceptionState) { | 1340 ExceptionState& exceptionState) { |
| 1341 if (isContextLost()) |
| 1342 return; |
| 1343 if (m_boundPixelUnpackBuffer) { |
| 1344 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1345 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1346 return; |
| 1347 } |
| 1278 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, | 1348 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, |
| 1279 type, canvas, exceptionState); | 1349 type, canvas, exceptionState); |
| 1280 } | 1350 } |
| 1281 | 1351 |
| 1282 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1352 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1283 GLint level, | 1353 GLint level, |
| 1284 GLint internalformat, | 1354 GLint internalformat, |
| 1285 GLenum format, | 1355 GLenum format, |
| 1286 GLenum type, | 1356 GLenum type, |
| 1287 HTMLVideoElement* video, | 1357 HTMLVideoElement* video, |
| 1288 ExceptionState& exceptionState) { | 1358 ExceptionState& exceptionState) { |
| 1359 if (isContextLost()) |
| 1360 return; |
| 1361 if (m_boundPixelUnpackBuffer) { |
| 1362 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1363 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1364 return; |
| 1365 } |
| 1289 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, | 1366 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, |
| 1290 type, video, exceptionState); | 1367 type, video, exceptionState); |
| 1291 } | 1368 } |
| 1292 | 1369 |
| 1293 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1370 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1294 GLint level, | 1371 GLint level, |
| 1295 GLint internalformat, | 1372 GLint internalformat, |
| 1296 GLenum format, | 1373 GLenum format, |
| 1297 GLenum type, | 1374 GLenum type, |
| 1298 ImageBitmap* imageBitMap, | 1375 ImageBitmap* imageBitMap, |
| 1299 ExceptionState& exceptionState) { | 1376 ExceptionState& exceptionState) { |
| 1377 if (isContextLost()) |
| 1378 return; |
| 1379 if (m_boundPixelUnpackBuffer) { |
| 1380 synthesizeGLError(GL_INVALID_OPERATION, "texImage2D", |
| 1381 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1382 return; |
| 1383 } |
| 1300 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, | 1384 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, |
| 1301 type, imageBitMap, exceptionState); | 1385 type, imageBitMap, exceptionState); |
| 1302 } | 1386 } |
| 1303 | 1387 |
| 1304 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1388 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1305 GLint level, | 1389 GLint level, |
| 1306 GLint xoffset, | 1390 GLint xoffset, |
| 1307 GLint yoffset, | 1391 GLint yoffset, |
| 1308 GLsizei width, | 1392 GLsizei width, |
| 1309 GLsizei height, | 1393 GLsizei height, |
| 1310 GLenum format, | 1394 GLenum format, |
| 1311 GLenum type, | 1395 GLenum type, |
| 1312 DOMArrayBufferView* pixels) { | 1396 DOMArrayBufferView* pixels) { |
| 1397 if (isContextLost()) |
| 1398 return; |
| 1399 if (m_boundPixelUnpackBuffer) { |
| 1400 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1401 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1402 return; |
| 1403 } |
| 1313 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, | 1404 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, |
| 1314 width, height, format, type, pixels); | 1405 width, height, format, type, pixels); |
| 1315 } | 1406 } |
| 1316 | 1407 |
| 1317 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1408 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1318 GLint level, | 1409 GLint level, |
| 1319 GLint xoffset, | 1410 GLint xoffset, |
| 1320 GLint yoffset, | 1411 GLint yoffset, |
| 1321 GLsizei width, | 1412 GLsizei width, |
| 1322 GLsizei height, | 1413 GLsizei height, |
| 1323 GLenum format, | 1414 GLenum format, |
| 1324 GLenum type, | 1415 GLenum type, |
| 1325 DOMArrayBufferView* pixels, | 1416 DOMArrayBufferView* pixels, |
| 1326 GLuint srcOffset) { | 1417 GLuint srcOffset) { |
| 1418 if (isContextLost()) |
| 1419 return; |
| 1420 if (m_boundPixelUnpackBuffer) { |
| 1421 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1422 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1423 return; |
| 1424 } |
| 1327 texImageHelperDOMArrayBufferView(TexSubImage2D, target, level, 0, width, | 1425 texImageHelperDOMArrayBufferView(TexSubImage2D, target, level, 0, width, |
| 1328 height, 1, 0, format, type, xoffset, yoffset, | 1426 height, 1, 0, format, type, xoffset, yoffset, |
| 1329 0, pixels, NullNotReachable, srcOffset); | 1427 0, pixels, NullNotReachable, srcOffset); |
| 1330 } | 1428 } |
| 1331 | 1429 |
| 1332 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1430 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1333 GLint level, | 1431 GLint level, |
| 1334 GLint xoffset, | 1432 GLint xoffset, |
| 1335 GLint yoffset, | 1433 GLint yoffset, |
| 1336 GLsizei width, | 1434 GLsizei width, |
| 1337 GLsizei height, | 1435 GLsizei height, |
| 1338 GLenum format, | 1436 GLenum format, |
| 1339 GLenum type, | 1437 GLenum type, |
| 1340 ImageData* pixels) { | 1438 ImageData* pixels) { |
| 1341 DCHECK(pixels); | 1439 DCHECK(pixels); |
| 1440 if (isContextLost()) |
| 1441 return; |
| 1442 if (m_boundPixelUnpackBuffer) { |
| 1443 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1444 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1445 return; |
| 1446 } |
| 1342 texImageHelperImageData(TexSubImage2D, target, level, 0, 0, format, type, 1, | 1447 texImageHelperImageData(TexSubImage2D, target, level, 0, 0, format, type, 1, |
| 1343 xoffset, yoffset, 0, pixels, | 1448 xoffset, yoffset, 0, pixels, |
| 1344 getTextureSourceSubRectangle(width, height), 0); | 1449 getTextureSourceSubRectangle(width, height), 0); |
| 1345 } | 1450 } |
| 1346 | 1451 |
| 1347 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1452 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1348 GLint level, | 1453 GLint level, |
| 1349 GLint xoffset, | 1454 GLint xoffset, |
| 1350 GLint yoffset, | 1455 GLint yoffset, |
| 1351 GLsizei width, | 1456 GLsizei width, |
| 1352 GLsizei height, | 1457 GLsizei height, |
| 1353 GLenum format, | 1458 GLenum format, |
| 1354 GLenum type, | 1459 GLenum type, |
| 1355 HTMLImageElement* image, | 1460 HTMLImageElement* image, |
| 1356 ExceptionState& exceptionState) { | 1461 ExceptionState& exceptionState) { |
| 1462 if (isContextLost()) |
| 1463 return; |
| 1464 if (m_boundPixelUnpackBuffer) { |
| 1465 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1466 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1467 return; |
| 1468 } |
| 1357 texImageHelperHTMLImageElement( | 1469 texImageHelperHTMLImageElement( |
| 1358 TexSubImage2D, target, level, 0, format, type, xoffset, yoffset, 0, image, | 1470 TexSubImage2D, target, level, 0, format, type, xoffset, yoffset, 0, image, |
| 1359 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); | 1471 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); |
| 1360 } | 1472 } |
| 1361 | 1473 |
| 1362 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1474 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1363 GLint level, | 1475 GLint level, |
| 1364 GLint xoffset, | 1476 GLint xoffset, |
| 1365 GLint yoffset, | 1477 GLint yoffset, |
| 1366 GLsizei width, | 1478 GLsizei width, |
| 1367 GLsizei height, | 1479 GLsizei height, |
| 1368 GLenum format, | 1480 GLenum format, |
| 1369 GLenum type, | 1481 GLenum type, |
| 1370 HTMLCanvasElement* canvas, | 1482 HTMLCanvasElement* canvas, |
| 1371 ExceptionState& exceptionState) { | 1483 ExceptionState& exceptionState) { |
| 1484 if (isContextLost()) |
| 1485 return; |
| 1486 if (m_boundPixelUnpackBuffer) { |
| 1487 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1488 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1489 return; |
| 1490 } |
| 1372 texImageHelperHTMLCanvasElement(TexSubImage2D, target, level, 0, format, type, | 1491 texImageHelperHTMLCanvasElement(TexSubImage2D, target, level, 0, format, type, |
| 1373 xoffset, yoffset, 0, canvas, | 1492 xoffset, yoffset, 0, canvas, |
| 1374 getTextureSourceSubRectangle(width, height), | 1493 getTextureSourceSubRectangle(width, height), |
| 1375 1, 0, exceptionState); | 1494 1, 0, exceptionState); |
| 1376 } | 1495 } |
| 1377 | 1496 |
| 1378 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1497 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1379 GLint level, | 1498 GLint level, |
| 1380 GLint xoffset, | 1499 GLint xoffset, |
| 1381 GLint yoffset, | 1500 GLint yoffset, |
| 1382 GLsizei width, | 1501 GLsizei width, |
| 1383 GLsizei height, | 1502 GLsizei height, |
| 1384 GLenum format, | 1503 GLenum format, |
| 1385 GLenum type, | 1504 GLenum type, |
| 1386 HTMLVideoElement* video, | 1505 HTMLVideoElement* video, |
| 1387 ExceptionState& exceptionState) { | 1506 ExceptionState& exceptionState) { |
| 1507 if (isContextLost()) |
| 1508 return; |
| 1509 if (m_boundPixelUnpackBuffer) { |
| 1510 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1511 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1512 return; |
| 1513 } |
| 1388 texImageHelperHTMLVideoElement( | 1514 texImageHelperHTMLVideoElement( |
| 1389 TexSubImage2D, target, level, 0, format, type, xoffset, yoffset, 0, video, | 1515 TexSubImage2D, target, level, 0, format, type, xoffset, yoffset, 0, video, |
| 1390 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); | 1516 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); |
| 1391 } | 1517 } |
| 1392 | 1518 |
| 1393 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1519 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1394 GLint level, | 1520 GLint level, |
| 1395 GLint xoffset, | 1521 GLint xoffset, |
| 1396 GLint yoffset, | 1522 GLint yoffset, |
| 1397 GLsizei width, | 1523 GLsizei width, |
| 1398 GLsizei height, | 1524 GLsizei height, |
| 1399 GLenum format, | 1525 GLenum format, |
| 1400 GLenum type, | 1526 GLenum type, |
| 1401 ImageBitmap* bitmap, | 1527 ImageBitmap* bitmap, |
| 1402 ExceptionState& exceptionState) { | 1528 ExceptionState& exceptionState) { |
| 1403 DCHECK(bitmap); | 1529 DCHECK(bitmap); |
| 1530 if (isContextLost()) |
| 1531 return; |
| 1532 if (m_boundPixelUnpackBuffer) { |
| 1533 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1534 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1535 return; |
| 1536 } |
| 1404 texImageHelperImageBitmap(TexSubImage2D, target, level, 0, format, type, | 1537 texImageHelperImageBitmap(TexSubImage2D, target, level, 0, format, type, |
| 1405 xoffset, yoffset, 0, bitmap, | 1538 xoffset, yoffset, 0, bitmap, |
| 1406 getTextureSourceSubRectangle(width, height), 1, 0, | 1539 getTextureSourceSubRectangle(width, height), 1, 0, |
| 1407 exceptionState); | 1540 exceptionState); |
| 1408 } | 1541 } |
| 1409 | 1542 |
| 1410 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1543 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1411 GLint level, | 1544 GLint level, |
| 1412 GLint xoffset, | 1545 GLint xoffset, |
| 1413 GLint yoffset, | 1546 GLint yoffset, |
| 1414 GLenum format, | 1547 GLenum format, |
| 1415 GLenum type, | 1548 GLenum type, |
| 1416 ImageData* pixels) { | 1549 ImageData* pixels) { |
| 1550 if (isContextLost()) |
| 1551 return; |
| 1552 if (m_boundPixelUnpackBuffer) { |
| 1553 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1554 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1555 return; |
| 1556 } |
| 1417 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, | 1557 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, |
| 1418 format, type, pixels); | 1558 format, type, pixels); |
| 1419 } | 1559 } |
| 1420 | 1560 |
| 1421 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1561 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1422 GLint level, | 1562 GLint level, |
| 1423 GLint xoffset, | 1563 GLint xoffset, |
| 1424 GLint yoffset, | 1564 GLint yoffset, |
| 1425 GLenum format, | 1565 GLenum format, |
| 1426 GLenum type, | 1566 GLenum type, |
| 1427 HTMLImageElement* image, | 1567 HTMLImageElement* image, |
| 1428 ExceptionState& exceptionState) { | 1568 ExceptionState& exceptionState) { |
| 1569 if (isContextLost()) |
| 1570 return; |
| 1571 if (m_boundPixelUnpackBuffer) { |
| 1572 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1573 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1574 return; |
| 1575 } |
| 1429 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, | 1576 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, |
| 1430 format, type, image, exceptionState); | 1577 format, type, image, exceptionState); |
| 1431 } | 1578 } |
| 1432 | 1579 |
| 1433 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1580 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1434 GLint level, | 1581 GLint level, |
| 1435 GLint xoffset, | 1582 GLint xoffset, |
| 1436 GLint yoffset, | 1583 GLint yoffset, |
| 1437 GLenum format, | 1584 GLenum format, |
| 1438 GLenum type, | 1585 GLenum type, |
| 1439 HTMLCanvasElement* canvas, | 1586 HTMLCanvasElement* canvas, |
| 1440 ExceptionState& exceptionState) { | 1587 ExceptionState& exceptionState) { |
| 1588 if (isContextLost()) |
| 1589 return; |
| 1590 if (m_boundPixelUnpackBuffer) { |
| 1591 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1592 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1593 return; |
| 1594 } |
| 1441 WebGLRenderingContextBase::texSubImage2D( | 1595 WebGLRenderingContextBase::texSubImage2D( |
| 1442 target, level, xoffset, yoffset, format, type, canvas, exceptionState); | 1596 target, level, xoffset, yoffset, format, type, canvas, exceptionState); |
| 1443 } | 1597 } |
| 1444 | 1598 |
| 1445 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1599 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1446 GLint level, | 1600 GLint level, |
| 1447 GLint xoffset, | 1601 GLint xoffset, |
| 1448 GLint yoffset, | 1602 GLint yoffset, |
| 1449 GLenum format, | 1603 GLenum format, |
| 1450 GLenum type, | 1604 GLenum type, |
| 1451 HTMLVideoElement* video, | 1605 HTMLVideoElement* video, |
| 1452 ExceptionState& exceptionState) { | 1606 ExceptionState& exceptionState) { |
| 1453 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, | 1607 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, |
| 1454 format, type, video, exceptionState); | 1608 format, type, video, exceptionState); |
| 1455 } | 1609 } |
| 1456 | 1610 |
| 1457 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1611 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1458 GLint level, | 1612 GLint level, |
| 1459 GLint xoffset, | 1613 GLint xoffset, |
| 1460 GLint yoffset, | 1614 GLint yoffset, |
| 1461 GLenum format, | 1615 GLenum format, |
| 1462 GLenum type, | 1616 GLenum type, |
| 1463 ImageBitmap* bitmap, | 1617 ImageBitmap* bitmap, |
| 1464 ExceptionState& exceptionState) { | 1618 ExceptionState& exceptionState) { |
| 1619 if (isContextLost()) |
| 1620 return; |
| 1621 if (m_boundPixelUnpackBuffer) { |
| 1622 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage2D", |
| 1623 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1624 return; |
| 1625 } |
| 1465 WebGLRenderingContextBase::texSubImage2D( | 1626 WebGLRenderingContextBase::texSubImage2D( |
| 1466 target, level, xoffset, yoffset, format, type, bitmap, exceptionState); | 1627 target, level, xoffset, yoffset, format, type, bitmap, exceptionState); |
| 1467 } | 1628 } |
| 1468 | 1629 |
| 1469 void WebGL2RenderingContextBase::texStorage2D(GLenum target, | 1630 void WebGL2RenderingContextBase::texStorage2D(GLenum target, |
| 1470 GLsizei levels, | 1631 GLsizei levels, |
| 1471 GLenum internalformat, | 1632 GLenum internalformat, |
| 1472 GLsizei width, | 1633 GLsizei width, |
| 1473 GLsizei height) { | 1634 GLsizei height) { |
| 1474 if (isContextLost() || | 1635 if (isContextLost() || |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1513 GLint level, | 1674 GLint level, |
| 1514 GLint internalformat, | 1675 GLint internalformat, |
| 1515 GLsizei width, | 1676 GLsizei width, |
| 1516 GLsizei height, | 1677 GLsizei height, |
| 1517 GLsizei depth, | 1678 GLsizei depth, |
| 1518 GLint border, | 1679 GLint border, |
| 1519 GLenum format, | 1680 GLenum format, |
| 1520 GLenum type, | 1681 GLenum type, |
| 1521 DOMArrayBufferView* pixels, | 1682 DOMArrayBufferView* pixels, |
| 1522 GLuint srcOffset) { | 1683 GLuint srcOffset) { |
| 1684 if (isContextLost()) |
| 1685 return; |
| 1686 if (m_boundPixelUnpackBuffer) { |
| 1687 synthesizeGLError(GL_INVALID_OPERATION, "texImage3D", |
| 1688 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1689 return; |
| 1690 } |
| 1523 texImageHelperDOMArrayBufferView( | 1691 texImageHelperDOMArrayBufferView( |
| 1524 TexImage3D, target, level, internalformat, width, height, depth, border, | 1692 TexImage3D, target, level, internalformat, width, height, depth, border, |
| 1525 format, type, 0, 0, 0, pixels, NullNotReachable, srcOffset); | 1693 format, type, 0, 0, 0, pixels, NullNotReachable, srcOffset); |
| 1526 } | 1694 } |
| 1527 | 1695 |
| 1528 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1696 void WebGL2RenderingContextBase::texImage3D(GLenum target, |
| 1529 GLint level, | 1697 GLint level, |
| 1530 GLint internalformat, | 1698 GLint internalformat, |
| 1531 GLsizei width, | 1699 GLsizei width, |
| 1532 GLsizei height, | 1700 GLsizei height, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1580 GLint level, | 1748 GLint level, |
| 1581 GLint internalformat, | 1749 GLint internalformat, |
| 1582 GLsizei width, | 1750 GLsizei width, |
| 1583 GLsizei height, | 1751 GLsizei height, |
| 1584 GLsizei depth, | 1752 GLsizei depth, |
| 1585 GLint border, | 1753 GLint border, |
| 1586 GLenum format, | 1754 GLenum format, |
| 1587 GLenum type, | 1755 GLenum type, |
| 1588 HTMLImageElement* image, | 1756 HTMLImageElement* image, |
| 1589 ExceptionState& exceptionState) { | 1757 ExceptionState& exceptionState) { |
| 1758 if (isContextLost()) |
| 1759 return; |
| 1760 if (m_boundPixelUnpackBuffer) { |
| 1761 synthesizeGLError(GL_INVALID_OPERATION, "texImage3D", |
| 1762 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1763 return; |
| 1764 } |
| 1590 texImageHelperHTMLImageElement(TexImage3D, target, level, internalformat, | 1765 texImageHelperHTMLImageElement(TexImage3D, target, level, internalformat, |
| 1591 format, type, 0, 0, 0, image, | 1766 format, type, 0, 0, 0, image, |
| 1592 getTextureSourceSubRectangle(width, height), | 1767 getTextureSourceSubRectangle(width, height), |
| 1593 depth, m_unpackImageHeight, exceptionState); | 1768 depth, m_unpackImageHeight, exceptionState); |
| 1594 } | 1769 } |
| 1595 | 1770 |
| 1596 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1771 void WebGL2RenderingContextBase::texImage3D(GLenum target, |
| 1597 GLint level, | 1772 GLint level, |
| 1598 GLint internalformat, | 1773 GLint internalformat, |
| 1599 GLsizei width, | 1774 GLsizei width, |
| 1600 GLsizei height, | 1775 GLsizei height, |
| 1601 GLsizei depth, | 1776 GLsizei depth, |
| 1602 GLint border, | 1777 GLint border, |
| 1603 GLenum format, | 1778 GLenum format, |
| 1604 GLenum type, | 1779 GLenum type, |
| 1605 HTMLCanvasElement* canvas, | 1780 HTMLCanvasElement* canvas, |
| 1606 ExceptionState& exceptionState) { | 1781 ExceptionState& exceptionState) { |
| 1782 if (isContextLost()) |
| 1783 return; |
| 1784 if (m_boundPixelUnpackBuffer) { |
| 1785 synthesizeGLError(GL_INVALID_OPERATION, "texImage3D", |
| 1786 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1787 return; |
| 1788 } |
| 1607 texImageHelperHTMLCanvasElement(TexImage3D, target, level, internalformat, | 1789 texImageHelperHTMLCanvasElement(TexImage3D, target, level, internalformat, |
| 1608 format, type, 0, 0, 0, canvas, | 1790 format, type, 0, 0, 0, canvas, |
| 1609 getTextureSourceSubRectangle(width, height), | 1791 getTextureSourceSubRectangle(width, height), |
| 1610 depth, m_unpackImageHeight, exceptionState); | 1792 depth, m_unpackImageHeight, exceptionState); |
| 1611 } | 1793 } |
| 1612 | 1794 |
| 1613 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1795 void WebGL2RenderingContextBase::texImage3D(GLenum target, |
| 1614 GLint level, | 1796 GLint level, |
| 1615 GLint internalformat, | 1797 GLint internalformat, |
| 1616 GLsizei width, | 1798 GLsizei width, |
| 1617 GLsizei height, | 1799 GLsizei height, |
| 1618 GLsizei depth, | 1800 GLsizei depth, |
| 1619 GLint border, | 1801 GLint border, |
| 1620 GLenum format, | 1802 GLenum format, |
| 1621 GLenum type, | 1803 GLenum type, |
| 1622 HTMLVideoElement* video, | 1804 HTMLVideoElement* video, |
| 1623 ExceptionState& exceptionState) { | 1805 ExceptionState& exceptionState) { |
| 1806 if (isContextLost()) |
| 1807 return; |
| 1808 if (m_boundPixelUnpackBuffer) { |
| 1809 synthesizeGLError(GL_INVALID_OPERATION, "texImage3D", |
| 1810 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1811 return; |
| 1812 } |
| 1624 texImageHelperHTMLVideoElement(TexImage3D, target, level, internalformat, | 1813 texImageHelperHTMLVideoElement(TexImage3D, target, level, internalformat, |
| 1625 format, type, 0, 0, 0, video, | 1814 format, type, 0, 0, 0, video, |
| 1626 getTextureSourceSubRectangle(width, height), | 1815 getTextureSourceSubRectangle(width, height), |
| 1627 depth, m_unpackImageHeight, exceptionState); | 1816 depth, m_unpackImageHeight, exceptionState); |
| 1628 } | 1817 } |
| 1629 | 1818 |
| 1630 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1819 void WebGL2RenderingContextBase::texImage3D(GLenum target, |
| 1631 GLint level, | 1820 GLint level, |
| 1632 GLint internalformat, | 1821 GLint internalformat, |
| 1633 GLsizei width, | 1822 GLsizei width, |
| 1634 GLsizei height, | 1823 GLsizei height, |
| 1635 GLsizei depth, | 1824 GLsizei depth, |
| 1636 GLint border, | 1825 GLint border, |
| 1637 GLenum format, | 1826 GLenum format, |
| 1638 GLenum type, | 1827 GLenum type, |
| 1639 ImageBitmap* bitmap, | 1828 ImageBitmap* bitmap, |
| 1640 ExceptionState& exceptionState) { | 1829 ExceptionState& exceptionState) { |
| 1830 if (isContextLost()) |
| 1831 return; |
| 1832 if (m_boundPixelUnpackBuffer) { |
| 1833 synthesizeGLError(GL_INVALID_OPERATION, "texImage3D", |
| 1834 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1835 return; |
| 1836 } |
| 1641 texImageHelperImageBitmap(TexImage3D, target, level, internalformat, format, | 1837 texImageHelperImageBitmap(TexImage3D, target, level, internalformat, format, |
| 1642 type, 0, 0, 0, bitmap, | 1838 type, 0, 0, 0, bitmap, |
| 1643 getTextureSourceSubRectangle(width, height), depth, | 1839 getTextureSourceSubRectangle(width, height), depth, |
| 1644 m_unpackImageHeight, exceptionState); | 1840 m_unpackImageHeight, exceptionState); |
| 1645 } | 1841 } |
| 1646 | 1842 |
| 1647 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1843 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
| 1648 GLint level, | 1844 GLint level, |
| 1649 GLint xoffset, | 1845 GLint xoffset, |
| 1650 GLint yoffset, | 1846 GLint yoffset, |
| 1651 GLint zoffset, | 1847 GLint zoffset, |
| 1652 GLsizei width, | 1848 GLsizei width, |
| 1653 GLsizei height, | 1849 GLsizei height, |
| 1654 GLsizei depth, | 1850 GLsizei depth, |
| 1655 GLenum format, | 1851 GLenum format, |
| 1656 GLenum type, | 1852 GLenum type, |
| 1657 DOMArrayBufferView* pixels, | 1853 DOMArrayBufferView* pixels, |
| 1658 GLuint srcOffset) { | 1854 GLuint srcOffset) { |
| 1855 if (isContextLost()) |
| 1856 return; |
| 1857 if (m_boundPixelUnpackBuffer) { |
| 1858 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", |
| 1859 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1860 return; |
| 1861 } |
| 1659 texImageHelperDOMArrayBufferView( | 1862 texImageHelperDOMArrayBufferView( |
| 1660 TexSubImage3D, target, level, 0, width, height, depth, 0, format, type, | 1863 TexSubImage3D, target, level, 0, width, height, depth, 0, format, type, |
| 1661 xoffset, yoffset, zoffset, pixels, NullNotReachable, srcOffset); | 1864 xoffset, yoffset, zoffset, pixels, NullNotReachable, srcOffset); |
| 1662 } | 1865 } |
| 1663 | 1866 |
| 1664 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1867 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
| 1665 GLint level, | 1868 GLint level, |
| 1666 GLint xoffset, | 1869 GLint xoffset, |
| 1667 GLint yoffset, | 1870 GLint yoffset, |
| 1668 GLint zoffset, | 1871 GLint zoffset, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1698 GLint xoffset, | 1901 GLint xoffset, |
| 1699 GLint yoffset, | 1902 GLint yoffset, |
| 1700 GLint zoffset, | 1903 GLint zoffset, |
| 1701 GLsizei width, | 1904 GLsizei width, |
| 1702 GLsizei height, | 1905 GLsizei height, |
| 1703 GLsizei depth, | 1906 GLsizei depth, |
| 1704 GLenum format, | 1907 GLenum format, |
| 1705 GLenum type, | 1908 GLenum type, |
| 1706 ImageData* pixels) { | 1909 ImageData* pixels) { |
| 1707 DCHECK(pixels); | 1910 DCHECK(pixels); |
| 1911 if (isContextLost()) |
| 1912 return; |
| 1913 if (m_boundPixelUnpackBuffer) { |
| 1914 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", |
| 1915 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1916 return; |
| 1917 } |
| 1708 texImageHelperImageData(TexSubImage3D, target, level, 0, 0, format, type, | 1918 texImageHelperImageData(TexSubImage3D, target, level, 0, 0, format, type, |
| 1709 depth, xoffset, yoffset, zoffset, pixels, | 1919 depth, xoffset, yoffset, zoffset, pixels, |
| 1710 getTextureSourceSubRectangle(width, height), | 1920 getTextureSourceSubRectangle(width, height), |
| 1711 m_unpackImageHeight); | 1921 m_unpackImageHeight); |
| 1712 } | 1922 } |
| 1713 | 1923 |
| 1714 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1924 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
| 1715 GLint level, | 1925 GLint level, |
| 1716 GLint xoffset, | 1926 GLint xoffset, |
| 1717 GLint yoffset, | 1927 GLint yoffset, |
| 1718 GLint zoffset, | 1928 GLint zoffset, |
| 1719 GLsizei width, | 1929 GLsizei width, |
| 1720 GLsizei height, | 1930 GLsizei height, |
| 1721 GLsizei depth, | 1931 GLsizei depth, |
| 1722 GLenum format, | 1932 GLenum format, |
| 1723 GLenum type, | 1933 GLenum type, |
| 1724 HTMLImageElement* image, | 1934 HTMLImageElement* image, |
| 1725 ExceptionState& exceptionState) { | 1935 ExceptionState& exceptionState) { |
| 1936 if (isContextLost()) |
| 1937 return; |
| 1938 if (m_boundPixelUnpackBuffer) { |
| 1939 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", |
| 1940 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1941 return; |
| 1942 } |
| 1726 texImageHelperHTMLImageElement(TexSubImage3D, target, level, 0, format, type, | 1943 texImageHelperHTMLImageElement(TexSubImage3D, target, level, 0, format, type, |
| 1727 xoffset, yoffset, zoffset, image, | 1944 xoffset, yoffset, zoffset, image, |
| 1728 getTextureSourceSubRectangle(width, height), | 1945 getTextureSourceSubRectangle(width, height), |
| 1729 depth, m_unpackImageHeight, exceptionState); | 1946 depth, m_unpackImageHeight, exceptionState); |
| 1730 } | 1947 } |
| 1731 | 1948 |
| 1732 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1949 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
| 1733 GLint level, | 1950 GLint level, |
| 1734 GLint xoffset, | 1951 GLint xoffset, |
| 1735 GLint yoffset, | 1952 GLint yoffset, |
| 1736 GLint zoffset, | 1953 GLint zoffset, |
| 1737 GLsizei width, | 1954 GLsizei width, |
| 1738 GLsizei height, | 1955 GLsizei height, |
| 1739 GLsizei depth, | 1956 GLsizei depth, |
| 1740 GLenum format, | 1957 GLenum format, |
| 1741 GLenum type, | 1958 GLenum type, |
| 1742 HTMLCanvasElement* canvas, | 1959 HTMLCanvasElement* canvas, |
| 1743 ExceptionState& exceptionState) { | 1960 ExceptionState& exceptionState) { |
| 1961 if (isContextLost()) |
| 1962 return; |
| 1963 if (m_boundPixelUnpackBuffer) { |
| 1964 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", |
| 1965 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1966 return; |
| 1967 } |
| 1744 texImageHelperHTMLCanvasElement(TexSubImage3D, target, level, 0, format, type, | 1968 texImageHelperHTMLCanvasElement(TexSubImage3D, target, level, 0, format, type, |
| 1745 xoffset, yoffset, zoffset, canvas, | 1969 xoffset, yoffset, zoffset, canvas, |
| 1746 getTextureSourceSubRectangle(width, height), | 1970 getTextureSourceSubRectangle(width, height), |
| 1747 depth, m_unpackImageHeight, exceptionState); | 1971 depth, m_unpackImageHeight, exceptionState); |
| 1748 } | 1972 } |
| 1749 | 1973 |
| 1750 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1974 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
| 1751 GLint level, | 1975 GLint level, |
| 1752 GLint xoffset, | 1976 GLint xoffset, |
| 1753 GLint yoffset, | 1977 GLint yoffset, |
| 1754 GLint zoffset, | 1978 GLint zoffset, |
| 1755 GLsizei width, | 1979 GLsizei width, |
| 1756 GLsizei height, | 1980 GLsizei height, |
| 1757 GLsizei depth, | 1981 GLsizei depth, |
| 1758 GLenum format, | 1982 GLenum format, |
| 1759 GLenum type, | 1983 GLenum type, |
| 1760 HTMLVideoElement* video, | 1984 HTMLVideoElement* video, |
| 1761 ExceptionState& exceptionState) { | 1985 ExceptionState& exceptionState) { |
| 1986 if (isContextLost()) |
| 1987 return; |
| 1988 if (m_boundPixelUnpackBuffer) { |
| 1989 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", |
| 1990 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 1991 return; |
| 1992 } |
| 1762 texImageHelperHTMLVideoElement(TexSubImage3D, target, level, 0, format, type, | 1993 texImageHelperHTMLVideoElement(TexSubImage3D, target, level, 0, format, type, |
| 1763 xoffset, yoffset, zoffset, video, | 1994 xoffset, yoffset, zoffset, video, |
| 1764 getTextureSourceSubRectangle(width, height), | 1995 getTextureSourceSubRectangle(width, height), |
| 1765 depth, m_unpackImageHeight, exceptionState); | 1996 depth, m_unpackImageHeight, exceptionState); |
| 1766 } | 1997 } |
| 1767 | 1998 |
| 1768 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1999 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
| 1769 GLint level, | 2000 GLint level, |
| 1770 GLint xoffset, | 2001 GLint xoffset, |
| 1771 GLint yoffset, | 2002 GLint yoffset, |
| 1772 GLint zoffset, | 2003 GLint zoffset, |
| 1773 GLsizei width, | 2004 GLsizei width, |
| 1774 GLsizei height, | 2005 GLsizei height, |
| 1775 GLsizei depth, | 2006 GLsizei depth, |
| 1776 GLenum format, | 2007 GLenum format, |
| 1777 GLenum type, | 2008 GLenum type, |
| 1778 ImageBitmap* bitmap, | 2009 ImageBitmap* bitmap, |
| 1779 ExceptionState& exceptionState) { | 2010 ExceptionState& exceptionState) { |
| 2011 if (isContextLost()) |
| 2012 return; |
| 2013 if (m_boundPixelUnpackBuffer) { |
| 2014 synthesizeGLError(GL_INVALID_OPERATION, "texSubImage3D", |
| 2015 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2016 return; |
| 2017 } |
| 1780 texImageHelperImageBitmap(TexSubImage3D, target, level, 0, format, type, | 2018 texImageHelperImageBitmap(TexSubImage3D, target, level, 0, format, type, |
| 1781 xoffset, yoffset, zoffset, bitmap, | 2019 xoffset, yoffset, zoffset, bitmap, |
| 1782 getTextureSourceSubRectangle(width, height), depth, | 2020 getTextureSourceSubRectangle(width, height), depth, |
| 1783 m_unpackImageHeight, exceptionState); | 2021 m_unpackImageHeight, exceptionState); |
| 1784 } | 2022 } |
| 1785 | 2023 |
| 1786 void WebGL2RenderingContextBase::copyTexSubImage3D(GLenum target, | 2024 void WebGL2RenderingContextBase::copyTexSubImage3D(GLenum target, |
| 1787 GLint level, | 2025 GLint level, |
| 1788 GLint xoffset, | 2026 GLint xoffset, |
| 1789 GLint yoffset, | 2027 GLint yoffset, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1807 } | 2045 } |
| 1808 | 2046 |
| 1809 void WebGL2RenderingContextBase::compressedTexImage2D( | 2047 void WebGL2RenderingContextBase::compressedTexImage2D( |
| 1810 GLenum target, | 2048 GLenum target, |
| 1811 GLint level, | 2049 GLint level, |
| 1812 GLenum internalformat, | 2050 GLenum internalformat, |
| 1813 GLsizei width, | 2051 GLsizei width, |
| 1814 GLsizei height, | 2052 GLsizei height, |
| 1815 GLint border, | 2053 GLint border, |
| 1816 DOMArrayBufferView* data) { | 2054 DOMArrayBufferView* data) { |
| 2055 if (isContextLost()) |
| 2056 return; |
| 2057 if (m_boundPixelUnpackBuffer) { |
| 2058 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", |
| 2059 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2060 return; |
| 2061 } |
| 1817 WebGLRenderingContextBase::compressedTexImage2D(target, level, internalformat, | 2062 WebGLRenderingContextBase::compressedTexImage2D(target, level, internalformat, |
| 1818 width, height, border, data); | 2063 width, height, border, data); |
| 1819 } | 2064 } |
| 1820 | 2065 |
| 1821 void WebGL2RenderingContextBase::compressedTexImage2D( | 2066 void WebGL2RenderingContextBase::compressedTexImage2D( |
| 1822 GLenum target, | 2067 GLenum target, |
| 1823 GLint level, | 2068 GLint level, |
| 1824 GLenum internalformat, | 2069 GLenum internalformat, |
| 1825 GLsizei width, | 2070 GLsizei width, |
| 1826 GLsizei height, | 2071 GLsizei height, |
| 1827 GLint border, | 2072 GLint border, |
| 1828 DOMArrayBufferView* data, | 2073 DOMArrayBufferView* data, |
| 1829 GLuint srcOffset, | 2074 GLuint srcOffset, |
| 1830 GLuint srcLengthOverride) { | 2075 GLuint srcLengthOverride) { |
| 1831 if (isContextLost()) | 2076 if (isContextLost()) |
| 1832 return; | 2077 return; |
| 2078 if (m_boundPixelUnpackBuffer) { |
| 2079 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", |
| 2080 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2081 return; |
| 2082 } |
| 1833 if (!validateTexture2DBinding("compressedTexImage2D", target)) | 2083 if (!validateTexture2DBinding("compressedTexImage2D", target)) |
| 1834 return; | 2084 return; |
| 1835 if (!validateCompressedTexFormat("compressedTexImage2D", internalformat)) | 2085 if (!validateCompressedTexFormat("compressedTexImage2D", internalformat)) |
| 1836 return; | 2086 return; |
| 1837 if (srcOffset > data->byteLength()) { | 2087 if (srcOffset > data->byteLength()) { |
| 1838 synthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", | 2088 synthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", |
| 1839 "srcOffset is out of range"); | 2089 "srcOffset is out of range"); |
| 1840 return; | 2090 return; |
| 1841 } | 2091 } |
| 1842 if (srcLengthOverride == 0) { | 2092 if (srcLengthOverride == 0) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1854 void WebGL2RenderingContextBase::compressedTexImage2D(GLenum target, | 2104 void WebGL2RenderingContextBase::compressedTexImage2D(GLenum target, |
| 1855 GLint level, | 2105 GLint level, |
| 1856 GLenum internalformat, | 2106 GLenum internalformat, |
| 1857 GLsizei width, | 2107 GLsizei width, |
| 1858 GLsizei height, | 2108 GLsizei height, |
| 1859 GLint border, | 2109 GLint border, |
| 1860 GLsizei imageSize, | 2110 GLsizei imageSize, |
| 1861 GLintptr offset) { | 2111 GLintptr offset) { |
| 1862 if (isContextLost()) | 2112 if (isContextLost()) |
| 1863 return; | 2113 return; |
| 2114 if (!m_boundPixelUnpackBuffer) { |
| 2115 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage2D", |
| 2116 "no bound PIXEL_UNPACK_BUFFER"); |
| 2117 return; |
| 2118 } |
| 1864 contextGL()->CompressedTexImage2D(target, level, internalformat, width, | 2119 contextGL()->CompressedTexImage2D(target, level, internalformat, width, |
| 1865 height, border, imageSize, | 2120 height, border, imageSize, |
| 1866 reinterpret_cast<uint8_t*>(offset)); | 2121 reinterpret_cast<uint8_t*>(offset)); |
| 1867 } | 2122 } |
| 1868 | 2123 |
| 1869 void WebGL2RenderingContextBase::compressedTexSubImage2D( | 2124 void WebGL2RenderingContextBase::compressedTexSubImage2D( |
| 1870 GLenum target, | 2125 GLenum target, |
| 1871 GLint level, | 2126 GLint level, |
| 1872 GLint xoffset, | 2127 GLint xoffset, |
| 1873 GLint yoffset, | 2128 GLint yoffset, |
| 1874 GLsizei width, | 2129 GLsizei width, |
| 1875 GLsizei height, | 2130 GLsizei height, |
| 1876 GLenum format, | 2131 GLenum format, |
| 1877 DOMArrayBufferView* data) { | 2132 DOMArrayBufferView* data) { |
| 2133 if (isContextLost()) |
| 2134 return; |
| 2135 if (m_boundPixelUnpackBuffer) { |
| 2136 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", |
| 2137 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2138 return; |
| 2139 } |
| 1878 WebGLRenderingContextBase::compressedTexSubImage2D( | 2140 WebGLRenderingContextBase::compressedTexSubImage2D( |
| 1879 target, level, xoffset, yoffset, width, height, format, data); | 2141 target, level, xoffset, yoffset, width, height, format, data); |
| 1880 } | 2142 } |
| 1881 | 2143 |
| 1882 void WebGL2RenderingContextBase::compressedTexSubImage2D( | 2144 void WebGL2RenderingContextBase::compressedTexSubImage2D( |
| 1883 GLenum target, | 2145 GLenum target, |
| 1884 GLint level, | 2146 GLint level, |
| 1885 GLint xoffset, | 2147 GLint xoffset, |
| 1886 GLint yoffset, | 2148 GLint yoffset, |
| 1887 GLsizei width, | 2149 GLsizei width, |
| 1888 GLsizei height, | 2150 GLsizei height, |
| 1889 GLenum format, | 2151 GLenum format, |
| 1890 DOMArrayBufferView* data, | 2152 DOMArrayBufferView* data, |
| 1891 GLuint srcOffset, | 2153 GLuint srcOffset, |
| 1892 GLuint srcLengthOverride) { | 2154 GLuint srcLengthOverride) { |
| 1893 if (isContextLost()) | 2155 if (isContextLost()) |
| 1894 return; | 2156 return; |
| 2157 if (m_boundPixelUnpackBuffer) { |
| 2158 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", |
| 2159 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2160 return; |
| 2161 } |
| 1895 if (!validateTexture2DBinding("compressedTexSubImage2D", target)) | 2162 if (!validateTexture2DBinding("compressedTexSubImage2D", target)) |
| 1896 return; | 2163 return; |
| 1897 if (!validateCompressedTexFormat("compressedTexSubImage2D", format)) | 2164 if (!validateCompressedTexFormat("compressedTexSubImage2D", format)) |
| 1898 return; | 2165 return; |
| 1899 if (srcOffset > data->byteLength()) { | 2166 if (srcOffset > data->byteLength()) { |
| 1900 synthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D", | 2167 synthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D", |
| 1901 "srcOffset is out of range"); | 2168 "srcOffset is out of range"); |
| 1902 return; | 2169 return; |
| 1903 } | 2170 } |
| 1904 if (srcLengthOverride == 0) { | 2171 if (srcLengthOverride == 0) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1917 GLint level, | 2184 GLint level, |
| 1918 GLint xoffset, | 2185 GLint xoffset, |
| 1919 GLint yoffset, | 2186 GLint yoffset, |
| 1920 GLsizei width, | 2187 GLsizei width, |
| 1921 GLsizei height, | 2188 GLsizei height, |
| 1922 GLenum format, | 2189 GLenum format, |
| 1923 GLsizei imageSize, | 2190 GLsizei imageSize, |
| 1924 GLintptr offset) { | 2191 GLintptr offset) { |
| 1925 if (isContextLost()) | 2192 if (isContextLost()) |
| 1926 return; | 2193 return; |
| 2194 if (!m_boundPixelUnpackBuffer) { |
| 2195 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage2D", |
| 2196 "no bound PIXEL_UNPACK_BUFFER"); |
| 2197 return; |
| 2198 } |
| 1927 contextGL()->CompressedTexSubImage2D(target, level, xoffset, yoffset, width, | 2199 contextGL()->CompressedTexSubImage2D(target, level, xoffset, yoffset, width, |
| 1928 height, format, imageSize, | 2200 height, format, imageSize, |
| 1929 reinterpret_cast<uint8_t*>(offset)); | 2201 reinterpret_cast<uint8_t*>(offset)); |
| 1930 } | 2202 } |
| 1931 | 2203 |
| 1932 void WebGL2RenderingContextBase::compressedTexImage3D( | 2204 void WebGL2RenderingContextBase::compressedTexImage3D( |
| 1933 GLenum target, | 2205 GLenum target, |
| 1934 GLint level, | 2206 GLint level, |
| 1935 GLenum internalformat, | 2207 GLenum internalformat, |
| 1936 GLsizei width, | 2208 GLsizei width, |
| 1937 GLsizei height, | 2209 GLsizei height, |
| 1938 GLsizei depth, | 2210 GLsizei depth, |
| 1939 GLint border, | 2211 GLint border, |
| 1940 DOMArrayBufferView* data, | 2212 DOMArrayBufferView* data, |
| 1941 GLuint srcOffset, | 2213 GLuint srcOffset, |
| 1942 GLuint srcLengthOverride) { | 2214 GLuint srcLengthOverride) { |
| 1943 if (isContextLost()) | 2215 if (isContextLost()) |
| 1944 return; | 2216 return; |
| 2217 if (m_boundPixelUnpackBuffer) { |
| 2218 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage3D", |
| 2219 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2220 return; |
| 2221 } |
| 1945 if (!validateTexture3DBinding("compressedTexImage3D", target)) | 2222 if (!validateTexture3DBinding("compressedTexImage3D", target)) |
| 1946 return; | 2223 return; |
| 1947 if (!validateCompressedTexFormat("compressedTexImage3D", internalformat)) | 2224 if (!validateCompressedTexFormat("compressedTexImage3D", internalformat)) |
| 1948 return; | 2225 return; |
| 1949 if (srcOffset > data->byteLength()) { | 2226 if (srcOffset > data->byteLength()) { |
| 1950 synthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", | 2227 synthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", |
| 1951 "srcOffset is out of range"); | 2228 "srcOffset is out of range"); |
| 1952 return; | 2229 return; |
| 1953 } | 2230 } |
| 1954 if (srcLengthOverride == 0) { | 2231 if (srcLengthOverride == 0) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1968 GLint level, | 2245 GLint level, |
| 1969 GLenum internalformat, | 2246 GLenum internalformat, |
| 1970 GLsizei width, | 2247 GLsizei width, |
| 1971 GLsizei height, | 2248 GLsizei height, |
| 1972 GLsizei depth, | 2249 GLsizei depth, |
| 1973 GLint border, | 2250 GLint border, |
| 1974 GLsizei imageSize, | 2251 GLsizei imageSize, |
| 1975 GLintptr offset) { | 2252 GLintptr offset) { |
| 1976 if (isContextLost()) | 2253 if (isContextLost()) |
| 1977 return; | 2254 return; |
| 2255 if (!m_boundPixelUnpackBuffer) { |
| 2256 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexImage3D", |
| 2257 "no bound PIXEL_UNPACK_BUFFER"); |
| 2258 return; |
| 2259 } |
| 1978 contextGL()->CompressedTexImage3D(target, level, internalformat, width, | 2260 contextGL()->CompressedTexImage3D(target, level, internalformat, width, |
| 1979 height, depth, border, imageSize, | 2261 height, depth, border, imageSize, |
| 1980 reinterpret_cast<uint8_t*>(offset)); | 2262 reinterpret_cast<uint8_t*>(offset)); |
| 1981 } | 2263 } |
| 1982 | 2264 |
| 1983 void WebGL2RenderingContextBase::compressedTexSubImage3D( | 2265 void WebGL2RenderingContextBase::compressedTexSubImage3D( |
| 1984 GLenum target, | 2266 GLenum target, |
| 1985 GLint level, | 2267 GLint level, |
| 1986 GLint xoffset, | 2268 GLint xoffset, |
| 1987 GLint yoffset, | 2269 GLint yoffset, |
| 1988 GLint zoffset, | 2270 GLint zoffset, |
| 1989 GLsizei width, | 2271 GLsizei width, |
| 1990 GLsizei height, | 2272 GLsizei height, |
| 1991 GLsizei depth, | 2273 GLsizei depth, |
| 1992 GLenum format, | 2274 GLenum format, |
| 1993 DOMArrayBufferView* data, | 2275 DOMArrayBufferView* data, |
| 1994 GLuint srcOffset, | 2276 GLuint srcOffset, |
| 1995 GLuint srcLengthOverride) { | 2277 GLuint srcLengthOverride) { |
| 1996 if (isContextLost()) | 2278 if (isContextLost()) |
| 1997 return; | 2279 return; |
| 2280 if (m_boundPixelUnpackBuffer) { |
| 2281 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage3D", |
| 2282 "a buffer is bound to PIXEL_UNPACK_BUFFER"); |
| 2283 return; |
| 2284 } |
| 1998 if (!validateTexture3DBinding("compressedTexSubImage3D", target)) | 2285 if (!validateTexture3DBinding("compressedTexSubImage3D", target)) |
| 1999 return; | 2286 return; |
| 2000 if (!validateCompressedTexFormat("compressedTexSubImage3D", format)) | 2287 if (!validateCompressedTexFormat("compressedTexSubImage3D", format)) |
| 2001 return; | 2288 return; |
| 2002 if (srcOffset > data->byteLength()) { | 2289 if (srcOffset > data->byteLength()) { |
| 2003 synthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", | 2290 synthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", |
| 2004 "srcOffset is out of range"); | 2291 "srcOffset is out of range"); |
| 2005 return; | 2292 return; |
| 2006 } | 2293 } |
| 2007 if (srcLengthOverride == 0) { | 2294 if (srcLengthOverride == 0) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2023 GLint yoffset, | 2310 GLint yoffset, |
| 2024 GLint zoffset, | 2311 GLint zoffset, |
| 2025 GLsizei width, | 2312 GLsizei width, |
| 2026 GLsizei height, | 2313 GLsizei height, |
| 2027 GLsizei depth, | 2314 GLsizei depth, |
| 2028 GLenum format, | 2315 GLenum format, |
| 2029 GLsizei imageSize, | 2316 GLsizei imageSize, |
| 2030 GLintptr offset) { | 2317 GLintptr offset) { |
| 2031 if (isContextLost()) | 2318 if (isContextLost()) |
| 2032 return; | 2319 return; |
| 2320 if (!m_boundPixelUnpackBuffer) { |
| 2321 synthesizeGLError(GL_INVALID_OPERATION, "compressedTexSubImage3D", |
| 2322 "no bound PIXEL_UNPACK_BUFFER"); |
| 2323 return; |
| 2324 } |
| 2033 contextGL()->CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, | 2325 contextGL()->CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, |
| 2034 width, height, depth, format, imageSize, | 2326 width, height, depth, format, imageSize, |
| 2035 reinterpret_cast<uint8_t*>(offset)); | 2327 reinterpret_cast<uint8_t*>(offset)); |
| 2036 } | 2328 } |
| 2037 | 2329 |
| 2038 GLint WebGL2RenderingContextBase::getFragDataLocation(WebGLProgram* program, | 2330 GLint WebGL2RenderingContextBase::getFragDataLocation(WebGLProgram* program, |
| 2039 const String& name) { | 2331 const String& name) { |
| 2040 if (isContextLost() || !validateWebGLObject("getFragDataLocation", program)) | 2332 if (isContextLost() || !validateWebGLObject("getFragDataLocation", program)) |
| 2041 return -1; | 2333 return -1; |
| 2042 | 2334 |
| (...skipping 2764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4807 | 5099 |
| 4808 void WebGL2RenderingContextBase:: | 5100 void WebGL2RenderingContextBase:: |
| 4809 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 5101 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
| 4810 if (!contextGL()) | 5102 if (!contextGL()) |
| 4811 return; | 5103 return; |
| 4812 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 5104 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
| 4813 objectOrZero(m_boundPixelUnpackBuffer.get())); | 5105 objectOrZero(m_boundPixelUnpackBuffer.get())); |
| 4814 } | 5106 } |
| 4815 | 5107 |
| 4816 } // namespace blink | 5108 } // namespace blink |
| OLD | NEW |