| 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 2394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2405 void WebGL2RenderingContextBase::uniform1fv( | 2405 void WebGL2RenderingContextBase::uniform1fv( |
| 2406 const WebGLUniformLocation* location, | 2406 const WebGLUniformLocation* location, |
| 2407 const FlexibleFloat32ArrayView& v, | 2407 const FlexibleFloat32ArrayView& v, |
| 2408 GLuint srcOffset, | 2408 GLuint srcOffset, |
| 2409 GLuint srcLength) { | 2409 GLuint srcLength) { |
| 2410 if (isContextLost() || | 2410 if (isContextLost() || |
| 2411 !validateUniformParameters<WTF::Float32Array>("uniform1fv", location, v, | 2411 !validateUniformParameters<WTF::Float32Array>("uniform1fv", location, v, |
| 2412 1, srcOffset, srcLength)) | 2412 1, srcOffset, srcLength)) |
| 2413 return; | 2413 return; |
| 2414 | 2414 |
| 2415 contextGL()->Uniform1fv(location->location(), v.length(), | 2415 contextGL()->Uniform1fv(location->location(), |
| 2416 srcLength ? srcLength : (v.length() - srcOffset), |
| 2416 v.dataMaybeOnStack() + srcOffset); | 2417 v.dataMaybeOnStack() + srcOffset); |
| 2417 } | 2418 } |
| 2418 | 2419 |
| 2419 void WebGL2RenderingContextBase::uniform1fv( | 2420 void WebGL2RenderingContextBase::uniform1fv( |
| 2420 const WebGLUniformLocation* location, | 2421 const WebGLUniformLocation* location, |
| 2421 Vector<GLfloat>& v, | 2422 Vector<GLfloat>& v, |
| 2422 GLuint srcOffset, | 2423 GLuint srcOffset, |
| 2423 GLuint srcLength) { | 2424 GLuint srcLength) { |
| 2424 if (isContextLost() || | 2425 if (isContextLost() || |
| 2425 !validateUniformParameters("uniform1fv", location, v.data(), v.size(), 1, | 2426 !validateUniformParameters("uniform1fv", location, v.data(), v.size(), 1, |
| 2426 srcOffset, srcLength)) | 2427 srcOffset, srcLength)) |
| 2427 return; | 2428 return; |
| 2428 | 2429 |
| 2429 contextGL()->Uniform1fv(location->location(), v.size(), v.data() + srcOffset); | 2430 contextGL()->Uniform1fv(location->location(), |
| 2431 srcLength ? srcLength : (v.size() - srcOffset), |
| 2432 v.data() + srcOffset); |
| 2430 } | 2433 } |
| 2431 | 2434 |
| 2432 void WebGL2RenderingContextBase::uniform2fv( | 2435 void WebGL2RenderingContextBase::uniform2fv( |
| 2433 const WebGLUniformLocation* location, | 2436 const WebGLUniformLocation* location, |
| 2434 const FlexibleFloat32ArrayView& v, | 2437 const FlexibleFloat32ArrayView& v, |
| 2435 GLuint srcOffset, | 2438 GLuint srcOffset, |
| 2436 GLuint srcLength) { | 2439 GLuint srcLength) { |
| 2437 if (isContextLost() || | 2440 if (isContextLost() || |
| 2438 !validateUniformParameters<WTF::Float32Array>("uniform2fv", location, v, | 2441 !validateUniformParameters<WTF::Float32Array>("uniform2fv", location, v, |
| 2439 2, srcOffset, srcLength)) | 2442 2, srcOffset, srcLength)) |
| 2440 return; | 2443 return; |
| 2441 | 2444 |
| 2442 contextGL()->Uniform2fv(location->location(), v.length() >> 1, | 2445 contextGL()->Uniform2fv( |
| 2443 v.dataMaybeOnStack() + srcOffset); | 2446 location->location(), |
| 2447 (srcLength ? srcLength : (v.length() - srcOffset)) >> 1, |
| 2448 v.dataMaybeOnStack() + srcOffset); |
| 2444 } | 2449 } |
| 2445 | 2450 |
| 2446 void WebGL2RenderingContextBase::uniform2fv( | 2451 void WebGL2RenderingContextBase::uniform2fv( |
| 2447 const WebGLUniformLocation* location, | 2452 const WebGLUniformLocation* location, |
| 2448 Vector<GLfloat>& v, | 2453 Vector<GLfloat>& v, |
| 2449 GLuint srcOffset, | 2454 GLuint srcOffset, |
| 2450 GLuint srcLength) { | 2455 GLuint srcLength) { |
| 2451 if (isContextLost() || | 2456 if (isContextLost() || |
| 2452 !validateUniformParameters("uniform2fv", location, v.data(), v.size(), 2, | 2457 !validateUniformParameters("uniform2fv", location, v.data(), v.size(), 2, |
| 2453 srcOffset, srcLength)) | 2458 srcOffset, srcLength)) |
| 2454 return; | 2459 return; |
| 2455 | 2460 |
| 2456 contextGL()->Uniform2fv(location->location(), v.size() >> 1, | 2461 contextGL()->Uniform2fv(location->location(), |
| 2462 (srcLength ? srcLength : (v.size() - srcOffset)) >> 1, |
| 2457 v.data() + srcOffset); | 2463 v.data() + srcOffset); |
| 2458 } | 2464 } |
| 2459 | 2465 |
| 2460 void WebGL2RenderingContextBase::uniform3fv( | 2466 void WebGL2RenderingContextBase::uniform3fv( |
| 2461 const WebGLUniformLocation* location, | 2467 const WebGLUniformLocation* location, |
| 2462 const FlexibleFloat32ArrayView& v, | 2468 const FlexibleFloat32ArrayView& v, |
| 2463 GLuint srcOffset, | 2469 GLuint srcOffset, |
| 2464 GLuint srcLength) { | 2470 GLuint srcLength) { |
| 2465 if (isContextLost() || | 2471 if (isContextLost() || |
| 2466 !validateUniformParameters<WTF::Float32Array>("uniform3fv", location, v, | 2472 !validateUniformParameters<WTF::Float32Array>("uniform3fv", location, v, |
| 2467 3, srcOffset, srcLength)) | 2473 3, srcOffset, srcLength)) |
| 2468 return; | 2474 return; |
| 2469 | 2475 |
| 2470 contextGL()->Uniform3fv(location->location(), v.length() / 3, | 2476 contextGL()->Uniform3fv( |
| 2471 v.dataMaybeOnStack() + srcOffset); | 2477 location->location(), |
| 2478 (srcLength ? srcLength : (v.length() - srcOffset)) / 3, |
| 2479 v.dataMaybeOnStack() + srcOffset); |
| 2472 } | 2480 } |
| 2473 | 2481 |
| 2474 void WebGL2RenderingContextBase::uniform3fv( | 2482 void WebGL2RenderingContextBase::uniform3fv( |
| 2475 const WebGLUniformLocation* location, | 2483 const WebGLUniformLocation* location, |
| 2476 Vector<GLfloat>& v, | 2484 Vector<GLfloat>& v, |
| 2477 GLuint srcOffset, | 2485 GLuint srcOffset, |
| 2478 GLuint srcLength) { | 2486 GLuint srcLength) { |
| 2479 if (isContextLost() || | 2487 if (isContextLost() || |
| 2480 !validateUniformParameters("uniform3fv", location, v.data(), v.size(), 3, | 2488 !validateUniformParameters("uniform3fv", location, v.data(), v.size(), 3, |
| 2481 srcOffset, srcLength)) | 2489 srcOffset, srcLength)) |
| 2482 return; | 2490 return; |
| 2483 | 2491 |
| 2484 contextGL()->Uniform3fv(location->location(), v.size() / 3, | 2492 contextGL()->Uniform3fv(location->location(), |
| 2493 (srcLength ? srcLength : (v.size() - srcOffset)) / 3, |
| 2485 v.data() + srcOffset); | 2494 v.data() + srcOffset); |
| 2486 } | 2495 } |
| 2487 | 2496 |
| 2488 void WebGL2RenderingContextBase::uniform4fv( | 2497 void WebGL2RenderingContextBase::uniform4fv( |
| 2489 const WebGLUniformLocation* location, | 2498 const WebGLUniformLocation* location, |
| 2490 const FlexibleFloat32ArrayView& v, | 2499 const FlexibleFloat32ArrayView& v, |
| 2491 GLuint srcOffset, | 2500 GLuint srcOffset, |
| 2492 GLuint srcLength) { | 2501 GLuint srcLength) { |
| 2493 if (isContextLost() || | 2502 if (isContextLost() || |
| 2494 !validateUniformParameters<WTF::Float32Array>("uniform4fv", location, v, | 2503 !validateUniformParameters<WTF::Float32Array>("uniform4fv", location, v, |
| 2495 4, srcOffset, srcLength)) | 2504 4, srcOffset, srcLength)) |
| 2496 return; | 2505 return; |
| 2497 | 2506 |
| 2498 contextGL()->Uniform4fv(location->location(), v.length() >> 2, | 2507 contextGL()->Uniform4fv( |
| 2499 v.dataMaybeOnStack() + srcOffset); | 2508 location->location(), |
| 2509 (srcLength ? srcLength : (v.length() - srcOffset)) >> 2, |
| 2510 v.dataMaybeOnStack() + srcOffset); |
| 2500 } | 2511 } |
| 2501 | 2512 |
| 2502 void WebGL2RenderingContextBase::uniform4fv( | 2513 void WebGL2RenderingContextBase::uniform4fv( |
| 2503 const WebGLUniformLocation* location, | 2514 const WebGLUniformLocation* location, |
| 2504 Vector<GLfloat>& v, | 2515 Vector<GLfloat>& v, |
| 2505 GLuint srcOffset, | 2516 GLuint srcOffset, |
| 2506 GLuint srcLength) { | 2517 GLuint srcLength) { |
| 2507 if (isContextLost() || | 2518 if (isContextLost() || |
| 2508 !validateUniformParameters("uniform4fv", location, v.data(), v.size(), 4, | 2519 !validateUniformParameters("uniform4fv", location, v.data(), v.size(), 4, |
| 2509 srcOffset, srcLength)) | 2520 srcOffset, srcLength)) |
| 2510 return; | 2521 return; |
| 2511 | 2522 |
| 2512 contextGL()->Uniform4fv(location->location(), v.size() >> 2, | 2523 contextGL()->Uniform4fv(location->location(), |
| 2524 (srcLength ? srcLength : (v.size() - srcOffset)) >> 2, |
| 2513 v.data() + srcOffset); | 2525 v.data() + srcOffset); |
| 2514 } | 2526 } |
| 2515 | 2527 |
| 2516 void WebGL2RenderingContextBase::uniform1iv( | 2528 void WebGL2RenderingContextBase::uniform1iv( |
| 2517 const WebGLUniformLocation* location, | 2529 const WebGLUniformLocation* location, |
| 2518 const FlexibleInt32ArrayView& v, | 2530 const FlexibleInt32ArrayView& v, |
| 2519 GLuint srcOffset, | 2531 GLuint srcOffset, |
| 2520 GLuint srcLength) { | 2532 GLuint srcLength) { |
| 2521 if (isContextLost() || | 2533 if (isContextLost() || |
| 2522 !validateUniformParameters<WTF::Int32Array>("uniform1iv", location, v, 1, | 2534 !validateUniformParameters<WTF::Int32Array>("uniform1iv", location, v, 1, |
| 2523 srcOffset, srcLength)) | 2535 srcOffset, srcLength)) |
| 2524 return; | 2536 return; |
| 2525 | 2537 |
| 2526 contextGL()->Uniform1iv(location->location(), v.length(), | 2538 contextGL()->Uniform1iv(location->location(), |
| 2539 srcLength ? srcLength : (v.length() - srcOffset), |
| 2527 v.dataMaybeOnStack() + srcOffset); | 2540 v.dataMaybeOnStack() + srcOffset); |
| 2528 } | 2541 } |
| 2529 | 2542 |
| 2530 void WebGL2RenderingContextBase::uniform1iv( | 2543 void WebGL2RenderingContextBase::uniform1iv( |
| 2531 const WebGLUniformLocation* location, | 2544 const WebGLUniformLocation* location, |
| 2532 Vector<GLint>& v, | 2545 Vector<GLint>& v, |
| 2533 GLuint srcOffset, | 2546 GLuint srcOffset, |
| 2534 GLuint srcLength) { | 2547 GLuint srcLength) { |
| 2535 if (isContextLost() || | 2548 if (isContextLost() || |
| 2536 !validateUniformParameters("uniform1iv", location, v.data(), v.size(), 1, | 2549 !validateUniformParameters("uniform1iv", location, v.data(), v.size(), 1, |
| 2537 srcOffset, srcLength)) | 2550 srcOffset, srcLength)) |
| 2538 return; | 2551 return; |
| 2539 | 2552 |
| 2540 contextGL()->Uniform1iv(location->location(), v.size(), v.data() + srcOffset); | 2553 contextGL()->Uniform1iv(location->location(), |
| 2554 srcLength ? srcLength : (v.size() - srcOffset), |
| 2555 v.data() + srcOffset); |
| 2541 } | 2556 } |
| 2542 | 2557 |
| 2543 void WebGL2RenderingContextBase::uniform2iv( | 2558 void WebGL2RenderingContextBase::uniform2iv( |
| 2544 const WebGLUniformLocation* location, | 2559 const WebGLUniformLocation* location, |
| 2545 const FlexibleInt32ArrayView& v, | 2560 const FlexibleInt32ArrayView& v, |
| 2546 GLuint srcOffset, | 2561 GLuint srcOffset, |
| 2547 GLuint srcLength) { | 2562 GLuint srcLength) { |
| 2548 if (isContextLost() || | 2563 if (isContextLost() || |
| 2549 !validateUniformParameters<WTF::Int32Array>("uniform2iv", location, v, 2, | 2564 !validateUniformParameters<WTF::Int32Array>("uniform2iv", location, v, 2, |
| 2550 srcOffset, srcLength)) | 2565 srcOffset, srcLength)) |
| 2551 return; | 2566 return; |
| 2552 | 2567 |
| 2553 contextGL()->Uniform2iv(location->location(), v.length() >> 1, | 2568 contextGL()->Uniform2iv( |
| 2554 v.dataMaybeOnStack() + srcOffset); | 2569 location->location(), |
| 2570 (srcLength ? srcLength : (v.length() - srcOffset)) >> 1, |
| 2571 v.dataMaybeOnStack() + srcOffset); |
| 2555 } | 2572 } |
| 2556 | 2573 |
| 2557 void WebGL2RenderingContextBase::uniform2iv( | 2574 void WebGL2RenderingContextBase::uniform2iv( |
| 2558 const WebGLUniformLocation* location, | 2575 const WebGLUniformLocation* location, |
| 2559 Vector<GLint>& v, | 2576 Vector<GLint>& v, |
| 2560 GLuint srcOffset, | 2577 GLuint srcOffset, |
| 2561 GLuint srcLength) { | 2578 GLuint srcLength) { |
| 2562 if (isContextLost() || | 2579 if (isContextLost() || |
| 2563 !validateUniformParameters("uniform2iv", location, v.data(), v.size(), 2, | 2580 !validateUniformParameters("uniform2iv", location, v.data(), v.size(), 2, |
| 2564 srcOffset, srcLength)) | 2581 srcOffset, srcLength)) |
| 2565 return; | 2582 return; |
| 2566 | 2583 |
| 2567 contextGL()->Uniform2iv(location->location(), v.size() >> 1, | 2584 contextGL()->Uniform2iv(location->location(), |
| 2585 (srcLength ? srcLength : (v.size() - srcOffset)) >> 1, |
| 2568 v.data() + srcOffset); | 2586 v.data() + srcOffset); |
| 2569 } | 2587 } |
| 2570 | 2588 |
| 2571 void WebGL2RenderingContextBase::uniform3iv( | 2589 void WebGL2RenderingContextBase::uniform3iv( |
| 2572 const WebGLUniformLocation* location, | 2590 const WebGLUniformLocation* location, |
| 2573 const FlexibleInt32ArrayView& v, | 2591 const FlexibleInt32ArrayView& v, |
| 2574 GLuint srcOffset, | 2592 GLuint srcOffset, |
| 2575 GLuint srcLength) { | 2593 GLuint srcLength) { |
| 2576 if (isContextLost() || | 2594 if (isContextLost() || |
| 2577 !validateUniformParameters<WTF::Int32Array>("uniform3iv", location, v, 3, | 2595 !validateUniformParameters<WTF::Int32Array>("uniform3iv", location, v, 3, |
| 2578 srcOffset, srcLength)) | 2596 srcOffset, srcLength)) |
| 2579 return; | 2597 return; |
| 2580 | 2598 |
| 2581 contextGL()->Uniform3iv(location->location(), v.length() / 3, | 2599 contextGL()->Uniform3iv( |
| 2582 v.dataMaybeOnStack() + srcOffset); | 2600 location->location(), |
| 2601 (srcLength ? srcLength : (v.length() - srcOffset)) / 3, |
| 2602 v.dataMaybeOnStack() + srcOffset); |
| 2583 } | 2603 } |
| 2584 | 2604 |
| 2585 void WebGL2RenderingContextBase::uniform3iv( | 2605 void WebGL2RenderingContextBase::uniform3iv( |
| 2586 const WebGLUniformLocation* location, | 2606 const WebGLUniformLocation* location, |
| 2587 Vector<GLint>& v, | 2607 Vector<GLint>& v, |
| 2588 GLuint srcOffset, | 2608 GLuint srcOffset, |
| 2589 GLuint srcLength) { | 2609 GLuint srcLength) { |
| 2590 if (isContextLost() || | 2610 if (isContextLost() || |
| 2591 !validateUniformParameters("uniform3iv", location, v.data(), v.size(), 3, | 2611 !validateUniformParameters("uniform3iv", location, v.data(), v.size(), 3, |
| 2592 srcOffset, srcLength)) | 2612 srcOffset, srcLength)) |
| 2593 return; | 2613 return; |
| 2594 | 2614 |
| 2595 contextGL()->Uniform3iv(location->location(), v.size() / 3, | 2615 contextGL()->Uniform3iv(location->location(), |
| 2616 (srcLength ? srcLength : (v.size() - srcOffset)) / 3, |
| 2596 v.data() + srcOffset); | 2617 v.data() + srcOffset); |
| 2597 } | 2618 } |
| 2598 | 2619 |
| 2599 void WebGL2RenderingContextBase::uniform4iv( | 2620 void WebGL2RenderingContextBase::uniform4iv( |
| 2600 const WebGLUniformLocation* location, | 2621 const WebGLUniformLocation* location, |
| 2601 const FlexibleInt32ArrayView& v, | 2622 const FlexibleInt32ArrayView& v, |
| 2602 GLuint srcOffset, | 2623 GLuint srcOffset, |
| 2603 GLuint srcLength) { | 2624 GLuint srcLength) { |
| 2604 if (isContextLost() || | 2625 if (isContextLost() || |
| 2605 !validateUniformParameters<WTF::Int32Array>("uniform4iv", location, v, 4, | 2626 !validateUniformParameters<WTF::Int32Array>("uniform4iv", location, v, 4, |
| 2606 srcOffset, srcLength)) | 2627 srcOffset, srcLength)) |
| 2607 return; | 2628 return; |
| 2608 | 2629 |
| 2609 contextGL()->Uniform4iv(location->location(), v.length() >> 2, | 2630 contextGL()->Uniform4iv( |
| 2610 v.dataMaybeOnStack() + srcOffset); | 2631 location->location(), |
| 2632 (srcLength ? srcLength : (v.length() - srcOffset)) >> 2, |
| 2633 v.dataMaybeOnStack() + srcOffset); |
| 2611 } | 2634 } |
| 2612 | 2635 |
| 2613 void WebGL2RenderingContextBase::uniform4iv( | 2636 void WebGL2RenderingContextBase::uniform4iv( |
| 2614 const WebGLUniformLocation* location, | 2637 const WebGLUniformLocation* location, |
| 2615 Vector<GLint>& v, | 2638 Vector<GLint>& v, |
| 2616 GLuint srcOffset, | 2639 GLuint srcOffset, |
| 2617 GLuint srcLength) { | 2640 GLuint srcLength) { |
| 2618 if (isContextLost() || | 2641 if (isContextLost() || |
| 2619 !validateUniformParameters("uniform4iv", location, v.data(), v.size(), 4, | 2642 !validateUniformParameters("uniform4iv", location, v.data(), v.size(), 4, |
| 2620 srcOffset, srcLength)) | 2643 srcOffset, srcLength)) |
| 2621 return; | 2644 return; |
| 2622 | 2645 |
| 2623 contextGL()->Uniform4iv(location->location(), v.size() >> 2, | 2646 contextGL()->Uniform4iv(location->location(), |
| 2647 (srcLength ? srcLength : (v.size() - srcOffset)) >> 2, |
| 2624 v.data() + srcOffset); | 2648 v.data() + srcOffset); |
| 2625 } | 2649 } |
| 2626 | 2650 |
| 2627 void WebGL2RenderingContextBase::uniform1uiv( | 2651 void WebGL2RenderingContextBase::uniform1uiv( |
| 2628 const WebGLUniformLocation* location, | 2652 const WebGLUniformLocation* location, |
| 2629 const FlexibleUint32ArrayView& v, | 2653 const FlexibleUint32ArrayView& v, |
| 2630 GLuint srcOffset, | 2654 GLuint srcOffset, |
| 2631 GLuint srcLength) { | 2655 GLuint srcLength) { |
| 2632 if (isContextLost() || | 2656 if (isContextLost() || |
| 2633 !validateUniformParameters<WTF::Uint32Array>("uniform1uiv", location, v, | 2657 !validateUniformParameters<WTF::Uint32Array>("uniform1uiv", location, v, |
| 2634 1, srcOffset, srcLength)) | 2658 1, srcOffset, srcLength)) |
| 2635 return; | 2659 return; |
| 2636 | 2660 |
| 2637 contextGL()->Uniform1uiv(location->location(), v.length(), | 2661 contextGL()->Uniform1uiv(location->location(), |
| 2662 srcLength ? srcLength : (v.length() - srcOffset), |
| 2638 v.dataMaybeOnStack() + srcOffset); | 2663 v.dataMaybeOnStack() + srcOffset); |
| 2639 } | 2664 } |
| 2640 | 2665 |
| 2641 void WebGL2RenderingContextBase::uniform1uiv( | 2666 void WebGL2RenderingContextBase::uniform1uiv( |
| 2642 const WebGLUniformLocation* location, | 2667 const WebGLUniformLocation* location, |
| 2643 Vector<GLuint>& value, | 2668 Vector<GLuint>& value, |
| 2644 GLuint srcOffset, | 2669 GLuint srcOffset, |
| 2645 GLuint srcLength) { | 2670 GLuint srcLength) { |
| 2646 if (isContextLost() || | 2671 if (isContextLost() || |
| 2647 !validateUniformParameters("uniform1uiv", location, value.data(), | 2672 !validateUniformParameters("uniform1uiv", location, value.data(), |
| 2648 value.size(), 1, srcOffset, srcLength)) | 2673 value.size(), 1, srcOffset, srcLength)) |
| 2649 return; | 2674 return; |
| 2650 | 2675 |
| 2651 contextGL()->Uniform1uiv(location->location(), value.size(), | 2676 contextGL()->Uniform1uiv(location->location(), |
| 2677 srcLength ? srcLength : (value.size() - srcOffset), |
| 2652 value.data() + srcOffset); | 2678 value.data() + srcOffset); |
| 2653 } | 2679 } |
| 2654 | 2680 |
| 2655 void WebGL2RenderingContextBase::uniform2uiv( | 2681 void WebGL2RenderingContextBase::uniform2uiv( |
| 2656 const WebGLUniformLocation* location, | 2682 const WebGLUniformLocation* location, |
| 2657 const FlexibleUint32ArrayView& v, | 2683 const FlexibleUint32ArrayView& v, |
| 2658 GLuint srcOffset, | 2684 GLuint srcOffset, |
| 2659 GLuint srcLength) { | 2685 GLuint srcLength) { |
| 2660 if (isContextLost() || | 2686 if (isContextLost() || |
| 2661 !validateUniformParameters<WTF::Uint32Array>("uniform2uiv", location, v, | 2687 !validateUniformParameters<WTF::Uint32Array>("uniform2uiv", location, v, |
| 2662 2, srcOffset, srcLength)) | 2688 2, srcOffset, srcLength)) |
| 2663 return; | 2689 return; |
| 2664 | 2690 |
| 2665 contextGL()->Uniform2uiv(location->location(), v.length() >> 1, | 2691 contextGL()->Uniform2uiv( |
| 2666 v.dataMaybeOnStack() + srcOffset); | 2692 location->location(), |
| 2693 (srcLength ? srcLength : (v.length() - srcOffset)) >> 1, |
| 2694 v.dataMaybeOnStack() + srcOffset); |
| 2667 } | 2695 } |
| 2668 | 2696 |
| 2669 void WebGL2RenderingContextBase::uniform2uiv( | 2697 void WebGL2RenderingContextBase::uniform2uiv( |
| 2670 const WebGLUniformLocation* location, | 2698 const WebGLUniformLocation* location, |
| 2671 Vector<GLuint>& value, | 2699 Vector<GLuint>& value, |
| 2672 GLuint srcOffset, | 2700 GLuint srcOffset, |
| 2673 GLuint srcLength) { | 2701 GLuint srcLength) { |
| 2674 if (isContextLost() || | 2702 if (isContextLost() || |
| 2675 !validateUniformParameters("uniform2uiv", location, value.data(), | 2703 !validateUniformParameters("uniform2uiv", location, value.data(), |
| 2676 value.size(), 2, srcOffset, srcLength)) | 2704 value.size(), 2, srcOffset, srcLength)) |
| 2677 return; | 2705 return; |
| 2678 | 2706 |
| 2679 contextGL()->Uniform2uiv(location->location(), value.size() / 2, | 2707 contextGL()->Uniform2uiv( |
| 2680 value.data() + srcOffset); | 2708 location->location(), |
| 2709 (srcLength ? srcLength : (value.size() - srcOffset)) >> 1, |
| 2710 value.data() + srcOffset); |
| 2681 } | 2711 } |
| 2682 | 2712 |
| 2683 void WebGL2RenderingContextBase::uniform3uiv( | 2713 void WebGL2RenderingContextBase::uniform3uiv( |
| 2684 const WebGLUniformLocation* location, | 2714 const WebGLUniformLocation* location, |
| 2685 const FlexibleUint32ArrayView& v, | 2715 const FlexibleUint32ArrayView& v, |
| 2686 GLuint srcOffset, | 2716 GLuint srcOffset, |
| 2687 GLuint srcLength) { | 2717 GLuint srcLength) { |
| 2688 if (isContextLost() || | 2718 if (isContextLost() || |
| 2689 !validateUniformParameters<WTF::Uint32Array>("uniform3uiv", location, v, | 2719 !validateUniformParameters<WTF::Uint32Array>("uniform3uiv", location, v, |
| 2690 3, srcOffset, srcLength)) | 2720 3, srcOffset, srcLength)) |
| 2691 return; | 2721 return; |
| 2692 | 2722 |
| 2693 contextGL()->Uniform3uiv(location->location(), v.length() / 3, | 2723 contextGL()->Uniform3uiv( |
| 2694 v.dataMaybeOnStack() + srcOffset); | 2724 location->location(), |
| 2725 (srcLength ? srcLength : (v.length() - srcOffset)) / 3, |
| 2726 v.dataMaybeOnStack() + srcOffset); |
| 2695 } | 2727 } |
| 2696 | 2728 |
| 2697 void WebGL2RenderingContextBase::uniform3uiv( | 2729 void WebGL2RenderingContextBase::uniform3uiv( |
| 2698 const WebGLUniformLocation* location, | 2730 const WebGLUniformLocation* location, |
| 2699 Vector<GLuint>& value, | 2731 Vector<GLuint>& value, |
| 2700 GLuint srcOffset, | 2732 GLuint srcOffset, |
| 2701 GLuint srcLength) { | 2733 GLuint srcLength) { |
| 2702 if (isContextLost() || | 2734 if (isContextLost() || |
| 2703 !validateUniformParameters("uniform3uiv", location, value.data(), | 2735 !validateUniformParameters("uniform3uiv", location, value.data(), |
| 2704 value.size(), 3, srcOffset, srcLength)) | 2736 value.size(), 3, srcOffset, srcLength)) |
| 2705 return; | 2737 return; |
| 2706 | 2738 |
| 2707 contextGL()->Uniform3uiv(location->location(), value.size() / 3, | 2739 contextGL()->Uniform3uiv( |
| 2708 value.data() + srcOffset); | 2740 location->location(), |
| 2741 (srcLength ? srcLength : (value.size() - srcOffset)) / 3, |
| 2742 value.data() + srcOffset); |
| 2709 } | 2743 } |
| 2710 | 2744 |
| 2711 void WebGL2RenderingContextBase::uniform4uiv( | 2745 void WebGL2RenderingContextBase::uniform4uiv( |
| 2712 const WebGLUniformLocation* location, | 2746 const WebGLUniformLocation* location, |
| 2713 const FlexibleUint32ArrayView& v, | 2747 const FlexibleUint32ArrayView& v, |
| 2714 GLuint srcOffset, | 2748 GLuint srcOffset, |
| 2715 GLuint srcLength) { | 2749 GLuint srcLength) { |
| 2716 if (isContextLost() || | 2750 if (isContextLost() || |
| 2717 !validateUniformParameters<WTF::Uint32Array>("uniform4uiv", location, v, | 2751 !validateUniformParameters<WTF::Uint32Array>("uniform4uiv", location, v, |
| 2718 4, srcOffset, srcLength)) | 2752 4, srcOffset, srcLength)) |
| 2719 return; | 2753 return; |
| 2720 | 2754 |
| 2721 contextGL()->Uniform4uiv(location->location(), v.length() >> 2, | 2755 contextGL()->Uniform4uiv( |
| 2722 v.dataMaybeOnStack() + srcOffset); | 2756 location->location(), |
| 2757 (srcLength ? srcLength : (v.length() - srcOffset)) >> 2, |
| 2758 v.dataMaybeOnStack() + srcOffset); |
| 2723 } | 2759 } |
| 2724 | 2760 |
| 2725 void WebGL2RenderingContextBase::uniform4uiv( | 2761 void WebGL2RenderingContextBase::uniform4uiv( |
| 2726 const WebGLUniformLocation* location, | 2762 const WebGLUniformLocation* location, |
| 2727 Vector<GLuint>& value, | 2763 Vector<GLuint>& value, |
| 2728 GLuint srcOffset, | 2764 GLuint srcOffset, |
| 2729 GLuint srcLength) { | 2765 GLuint srcLength) { |
| 2730 if (isContextLost() || | 2766 if (isContextLost() || |
| 2731 !validateUniformParameters("uniform4uiv", location, value.data(), | 2767 !validateUniformParameters("uniform4uiv", location, value.data(), |
| 2732 value.size(), 4, srcOffset, srcLength)) | 2768 value.size(), 4, srcOffset, srcLength)) |
| 2733 return; | 2769 return; |
| 2734 | 2770 |
| 2735 contextGL()->Uniform4uiv(location->location(), value.size() / 4, | 2771 contextGL()->Uniform4uiv( |
| 2736 value.data() + srcOffset); | 2772 location->location(), |
| 2773 (srcLength ? srcLength : (value.size() - srcOffset)) >> 2, |
| 2774 value.data() + srcOffset); |
| 2737 } | 2775 } |
| 2738 | 2776 |
| 2739 void WebGL2RenderingContextBase::uniformMatrix2fv( | 2777 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 2740 const WebGLUniformLocation* location, | 2778 const WebGLUniformLocation* location, |
| 2741 GLboolean transpose, | 2779 GLboolean transpose, |
| 2742 DOMFloat32Array* v, | 2780 DOMFloat32Array* v, |
| 2743 GLuint srcOffset, | 2781 GLuint srcOffset, |
| 2744 GLuint srcLength) { | 2782 GLuint srcLength) { |
| 2745 if (isContextLost() || | 2783 if (isContextLost() || |
| 2746 !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, | 2784 !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, |
| 2747 v, 4, srcOffset, srcLength)) | 2785 v, 4, srcOffset, srcLength)) |
| 2748 return; | 2786 return; |
| 2749 contextGL()->UniformMatrix2fv(location->location(), v->length() >> 2, | 2787 contextGL()->UniformMatrix2fv( |
| 2750 transpose, v->data() + srcOffset); | 2788 location->location(), |
| 2789 (srcLength ? srcLength : (v->length() - srcOffset)) >> 2, transpose, |
| 2790 v->data() + srcOffset); |
| 2751 } | 2791 } |
| 2752 | 2792 |
| 2753 void WebGL2RenderingContextBase::uniformMatrix2fv( | 2793 void WebGL2RenderingContextBase::uniformMatrix2fv( |
| 2754 const WebGLUniformLocation* location, | 2794 const WebGLUniformLocation* location, |
| 2755 GLboolean transpose, | 2795 GLboolean transpose, |
| 2756 Vector<GLfloat>& v, | 2796 Vector<GLfloat>& v, |
| 2757 GLuint srcOffset, | 2797 GLuint srcOffset, |
| 2758 GLuint srcLength) { | 2798 GLuint srcLength) { |
| 2759 if (isContextLost() || | 2799 if (isContextLost() || |
| 2760 !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, | 2800 !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, |
| 2761 v.data(), v.size(), 4, srcOffset, | 2801 v.data(), v.size(), 4, srcOffset, |
| 2762 srcLength)) | 2802 srcLength)) |
| 2763 return; | 2803 return; |
| 2764 contextGL()->UniformMatrix2fv(location->location(), v.size() >> 2, transpose, | 2804 contextGL()->UniformMatrix2fv( |
| 2765 v.data() + srcOffset); | 2805 location->location(), |
| 2806 (srcLength ? srcLength : (v.size() - srcOffset)) >> 2, transpose, |
| 2807 v.data() + srcOffset); |
| 2766 } | 2808 } |
| 2767 | 2809 |
| 2768 void WebGL2RenderingContextBase::uniformMatrix3fv( | 2810 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 2769 const WebGLUniformLocation* location, | 2811 const WebGLUniformLocation* location, |
| 2770 GLboolean transpose, | 2812 GLboolean transpose, |
| 2771 DOMFloat32Array* v, | 2813 DOMFloat32Array* v, |
| 2772 GLuint srcOffset, | 2814 GLuint srcOffset, |
| 2773 GLuint srcLength) { | 2815 GLuint srcLength) { |
| 2774 if (isContextLost() || | 2816 if (isContextLost() || |
| 2775 !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, | 2817 !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, |
| 2776 v, 9, srcOffset, srcLength)) | 2818 v, 9, srcOffset, srcLength)) |
| 2777 return; | 2819 return; |
| 2778 contextGL()->UniformMatrix3fv(location->location(), v->length() / 9, | 2820 contextGL()->UniformMatrix3fv( |
| 2779 transpose, v->data() + srcOffset); | 2821 location->location(), |
| 2822 (srcLength ? srcLength : (v->length() - srcOffset)) / 9, transpose, |
| 2823 v->data() + srcOffset); |
| 2780 } | 2824 } |
| 2781 | 2825 |
| 2782 void WebGL2RenderingContextBase::uniformMatrix3fv( | 2826 void WebGL2RenderingContextBase::uniformMatrix3fv( |
| 2783 const WebGLUniformLocation* location, | 2827 const WebGLUniformLocation* location, |
| 2784 GLboolean transpose, | 2828 GLboolean transpose, |
| 2785 Vector<GLfloat>& v, | 2829 Vector<GLfloat>& v, |
| 2786 GLuint srcOffset, | 2830 GLuint srcOffset, |
| 2787 GLuint srcLength) { | 2831 GLuint srcLength) { |
| 2788 if (isContextLost() || | 2832 if (isContextLost() || |
| 2789 !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, | 2833 !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, |
| 2790 v.data(), v.size(), 9, srcOffset, | 2834 v.data(), v.size(), 9, srcOffset, |
| 2791 srcLength)) | 2835 srcLength)) |
| 2792 return; | 2836 return; |
| 2793 contextGL()->UniformMatrix3fv(location->location(), v.size() / 9, transpose, | 2837 contextGL()->UniformMatrix3fv( |
| 2794 v.data() + srcOffset); | 2838 location->location(), |
| 2839 (srcLength ? srcLength : (v.size() - srcOffset)) / 9, transpose, |
| 2840 v.data() + srcOffset); |
| 2795 } | 2841 } |
| 2796 | 2842 |
| 2797 void WebGL2RenderingContextBase::uniformMatrix4fv( | 2843 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 2798 const WebGLUniformLocation* location, | 2844 const WebGLUniformLocation* location, |
| 2799 GLboolean transpose, | 2845 GLboolean transpose, |
| 2800 DOMFloat32Array* v, | 2846 DOMFloat32Array* v, |
| 2801 GLuint srcOffset, | 2847 GLuint srcOffset, |
| 2802 GLuint srcLength) { | 2848 GLuint srcLength) { |
| 2803 if (isContextLost() || | 2849 if (isContextLost() || |
| 2804 !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, | 2850 !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, |
| 2805 v, 16, srcOffset, srcLength)) | 2851 v, 16, srcOffset, srcLength)) |
| 2806 return; | 2852 return; |
| 2807 contextGL()->UniformMatrix4fv(location->location(), v->length() >> 4, | 2853 contextGL()->UniformMatrix4fv( |
| 2808 transpose, v->data() + srcOffset); | 2854 location->location(), |
| 2855 (srcLength ? srcLength : (v->length() - srcOffset)) >> 4, transpose, |
| 2856 v->data() + srcOffset); |
| 2809 } | 2857 } |
| 2810 | 2858 |
| 2811 void WebGL2RenderingContextBase::uniformMatrix4fv( | 2859 void WebGL2RenderingContextBase::uniformMatrix4fv( |
| 2812 const WebGLUniformLocation* location, | 2860 const WebGLUniformLocation* location, |
| 2813 GLboolean transpose, | 2861 GLboolean transpose, |
| 2814 Vector<GLfloat>& v, | 2862 Vector<GLfloat>& v, |
| 2815 GLuint srcOffset, | 2863 GLuint srcOffset, |
| 2816 GLuint srcLength) { | 2864 GLuint srcLength) { |
| 2817 if (isContextLost() || | 2865 if (isContextLost() || |
| 2818 !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, | 2866 !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, |
| 2819 v.data(), v.size(), 16, srcOffset, | 2867 v.data(), v.size(), 16, srcOffset, |
| 2820 srcLength)) | 2868 srcLength)) |
| 2821 return; | 2869 return; |
| 2822 contextGL()->UniformMatrix4fv(location->location(), v.size() >> 4, transpose, | 2870 contextGL()->UniformMatrix4fv( |
| 2823 v.data() + srcOffset); | 2871 location->location(), |
| 2872 (srcLength ? srcLength : (v.size() - srcOffset)) >> 4, transpose, |
| 2873 v.data() + srcOffset); |
| 2824 } | 2874 } |
| 2825 | 2875 |
| 2826 void WebGL2RenderingContextBase::uniformMatrix2x3fv( | 2876 void WebGL2RenderingContextBase::uniformMatrix2x3fv( |
| 2827 const WebGLUniformLocation* location, | 2877 const WebGLUniformLocation* location, |
| 2828 GLboolean transpose, | 2878 GLboolean transpose, |
| 2829 DOMFloat32Array* value, | 2879 DOMFloat32Array* value, |
| 2830 GLuint srcOffset, | 2880 GLuint srcOffset, |
| 2831 GLuint srcLength) { | 2881 GLuint srcLength) { |
| 2832 if (isContextLost() || | 2882 if (isContextLost() || |
| 2833 !validateUniformMatrixParameters("uniformMatrix2x3fv", location, | 2883 !validateUniformMatrixParameters("uniformMatrix2x3fv", location, |
| 2834 transpose, value, 6, srcOffset, | 2884 transpose, value, 6, srcOffset, |
| 2835 srcLength)) | 2885 srcLength)) |
| 2836 return; | 2886 return; |
| 2837 contextGL()->UniformMatrix2x3fv(location->location(), value->length() / 6, | 2887 contextGL()->UniformMatrix2x3fv( |
| 2838 transpose, value->data() + srcOffset); | 2888 location->location(), |
| 2889 (srcLength ? srcLength : (value->length() - srcOffset)) / 6, transpose, |
| 2890 value->data() + srcOffset); |
| 2839 } | 2891 } |
| 2840 | 2892 |
| 2841 void WebGL2RenderingContextBase::uniformMatrix2x3fv( | 2893 void WebGL2RenderingContextBase::uniformMatrix2x3fv( |
| 2842 const WebGLUniformLocation* location, | 2894 const WebGLUniformLocation* location, |
| 2843 GLboolean transpose, | 2895 GLboolean transpose, |
| 2844 Vector<GLfloat>& value, | 2896 Vector<GLfloat>& value, |
| 2845 GLuint srcOffset, | 2897 GLuint srcOffset, |
| 2846 GLuint srcLength) { | 2898 GLuint srcLength) { |
| 2847 if (isContextLost() || | 2899 if (isContextLost() || |
| 2848 !validateUniformMatrixParameters("uniformMatrix2x3fv", location, | 2900 !validateUniformMatrixParameters("uniformMatrix2x3fv", location, |
| 2849 transpose, value.data(), value.size(), 6, | 2901 transpose, value.data(), value.size(), 6, |
| 2850 srcOffset, srcLength)) | 2902 srcOffset, srcLength)) |
| 2851 return; | 2903 return; |
| 2852 contextGL()->UniformMatrix2x3fv(location->location(), value.size() / 6, | 2904 contextGL()->UniformMatrix2x3fv( |
| 2853 transpose, value.data() + srcOffset); | 2905 location->location(), |
| 2906 (srcLength ? srcLength : (value.size() - srcOffset)) / 6, transpose, |
| 2907 value.data() + srcOffset); |
| 2854 } | 2908 } |
| 2855 | 2909 |
| 2856 void WebGL2RenderingContextBase::uniformMatrix3x2fv( | 2910 void WebGL2RenderingContextBase::uniformMatrix3x2fv( |
| 2857 const WebGLUniformLocation* location, | 2911 const WebGLUniformLocation* location, |
| 2858 GLboolean transpose, | 2912 GLboolean transpose, |
| 2859 DOMFloat32Array* value, | 2913 DOMFloat32Array* value, |
| 2860 GLuint srcOffset, | 2914 GLuint srcOffset, |
| 2861 GLuint srcLength) { | 2915 GLuint srcLength) { |
| 2862 if (isContextLost() || | 2916 if (isContextLost() || |
| 2863 !validateUniformMatrixParameters("uniformMatrix3x2fv", location, | 2917 !validateUniformMatrixParameters("uniformMatrix3x2fv", location, |
| 2864 transpose, value, 6, srcOffset, | 2918 transpose, value, 6, srcOffset, |
| 2865 srcLength)) | 2919 srcLength)) |
| 2866 return; | 2920 return; |
| 2867 contextGL()->UniformMatrix3x2fv(location->location(), value->length() / 6, | 2921 contextGL()->UniformMatrix3x2fv( |
| 2868 transpose, value->data() + srcOffset); | 2922 location->location(), |
| 2923 (srcLength ? srcLength : (value->length() - srcOffset)) / 6, transpose, |
| 2924 value->data() + srcOffset); |
| 2869 } | 2925 } |
| 2870 | 2926 |
| 2871 void WebGL2RenderingContextBase::uniformMatrix3x2fv( | 2927 void WebGL2RenderingContextBase::uniformMatrix3x2fv( |
| 2872 const WebGLUniformLocation* location, | 2928 const WebGLUniformLocation* location, |
| 2873 GLboolean transpose, | 2929 GLboolean transpose, |
| 2874 Vector<GLfloat>& value, | 2930 Vector<GLfloat>& value, |
| 2875 GLuint srcOffset, | 2931 GLuint srcOffset, |
| 2876 GLuint srcLength) { | 2932 GLuint srcLength) { |
| 2877 if (isContextLost() || | 2933 if (isContextLost() || |
| 2878 !validateUniformMatrixParameters("uniformMatrix3x2fv", location, | 2934 !validateUniformMatrixParameters("uniformMatrix3x2fv", location, |
| 2879 transpose, value.data(), value.size(), 6, | 2935 transpose, value.data(), value.size(), 6, |
| 2880 srcOffset, srcLength)) | 2936 srcOffset, srcLength)) |
| 2881 return; | 2937 return; |
| 2882 contextGL()->UniformMatrix3x2fv(location->location(), value.size() / 6, | 2938 contextGL()->UniformMatrix3x2fv( |
| 2883 transpose, value.data() + srcOffset); | 2939 location->location(), |
| 2940 (srcLength ? srcLength : (value.size() - srcOffset)) / 6, transpose, |
| 2941 value.data() + srcOffset); |
| 2884 } | 2942 } |
| 2885 | 2943 |
| 2886 void WebGL2RenderingContextBase::uniformMatrix2x4fv( | 2944 void WebGL2RenderingContextBase::uniformMatrix2x4fv( |
| 2887 const WebGLUniformLocation* location, | 2945 const WebGLUniformLocation* location, |
| 2888 GLboolean transpose, | 2946 GLboolean transpose, |
| 2889 DOMFloat32Array* value, | 2947 DOMFloat32Array* value, |
| 2890 GLuint srcOffset, | 2948 GLuint srcOffset, |
| 2891 GLuint srcLength) { | 2949 GLuint srcLength) { |
| 2892 if (isContextLost() || | 2950 if (isContextLost() || |
| 2893 !validateUniformMatrixParameters("uniformMatrix2x4fv", location, | 2951 !validateUniformMatrixParameters("uniformMatrix2x4fv", location, |
| 2894 transpose, value, 8, srcOffset, | 2952 transpose, value, 8, srcOffset, |
| 2895 srcLength)) | 2953 srcLength)) |
| 2896 return; | 2954 return; |
| 2897 contextGL()->UniformMatrix2x4fv(location->location(), value->length() / 8, | 2955 contextGL()->UniformMatrix2x4fv( |
| 2898 transpose, value->data() + srcOffset); | 2956 location->location(), |
| 2957 (srcLength ? srcLength : (value->length() - srcOffset)) >> 3, transpose, |
| 2958 value->data() + srcOffset); |
| 2899 } | 2959 } |
| 2900 | 2960 |
| 2901 void WebGL2RenderingContextBase::uniformMatrix2x4fv( | 2961 void WebGL2RenderingContextBase::uniformMatrix2x4fv( |
| 2902 const WebGLUniformLocation* location, | 2962 const WebGLUniformLocation* location, |
| 2903 GLboolean transpose, | 2963 GLboolean transpose, |
| 2904 Vector<GLfloat>& value, | 2964 Vector<GLfloat>& value, |
| 2905 GLuint srcOffset, | 2965 GLuint srcOffset, |
| 2906 GLuint srcLength) { | 2966 GLuint srcLength) { |
| 2907 if (isContextLost() || | 2967 if (isContextLost() || |
| 2908 !validateUniformMatrixParameters("uniformMatrix2x4fv", location, | 2968 !validateUniformMatrixParameters("uniformMatrix2x4fv", location, |
| 2909 transpose, value.data(), value.size(), 8, | 2969 transpose, value.data(), value.size(), 8, |
| 2910 srcOffset, srcLength)) | 2970 srcOffset, srcLength)) |
| 2911 return; | 2971 return; |
| 2912 contextGL()->UniformMatrix2x4fv(location->location(), value.size() / 8, | 2972 contextGL()->UniformMatrix2x4fv( |
| 2913 transpose, value.data() + srcOffset); | 2973 location->location(), |
| 2974 (srcLength ? srcLength : (value.size() - srcOffset)) >> 3, transpose, |
| 2975 value.data() + srcOffset); |
| 2914 } | 2976 } |
| 2915 | 2977 |
| 2916 void WebGL2RenderingContextBase::uniformMatrix4x2fv( | 2978 void WebGL2RenderingContextBase::uniformMatrix4x2fv( |
| 2917 const WebGLUniformLocation* location, | 2979 const WebGLUniformLocation* location, |
| 2918 GLboolean transpose, | 2980 GLboolean transpose, |
| 2919 DOMFloat32Array* value, | 2981 DOMFloat32Array* value, |
| 2920 GLuint srcOffset, | 2982 GLuint srcOffset, |
| 2921 GLuint srcLength) { | 2983 GLuint srcLength) { |
| 2922 if (isContextLost() || | 2984 if (isContextLost() || |
| 2923 !validateUniformMatrixParameters("uniformMatrix4x2fv", location, | 2985 !validateUniformMatrixParameters("uniformMatrix4x2fv", location, |
| 2924 transpose, value, 8, srcOffset, | 2986 transpose, value, 8, srcOffset, |
| 2925 srcLength)) | 2987 srcLength)) |
| 2926 return; | 2988 return; |
| 2927 contextGL()->UniformMatrix4x2fv(location->location(), value->length() / 8, | 2989 contextGL()->UniformMatrix4x2fv( |
| 2928 transpose, value->data() + srcOffset); | 2990 location->location(), |
| 2991 (srcLength ? srcLength : (value->length() - srcOffset)) >> 3, transpose, |
| 2992 value->data() + srcOffset); |
| 2929 } | 2993 } |
| 2930 | 2994 |
| 2931 void WebGL2RenderingContextBase::uniformMatrix4x2fv( | 2995 void WebGL2RenderingContextBase::uniformMatrix4x2fv( |
| 2932 const WebGLUniformLocation* location, | 2996 const WebGLUniformLocation* location, |
| 2933 GLboolean transpose, | 2997 GLboolean transpose, |
| 2934 Vector<GLfloat>& value, | 2998 Vector<GLfloat>& value, |
| 2935 GLuint srcOffset, | 2999 GLuint srcOffset, |
| 2936 GLuint srcLength) { | 3000 GLuint srcLength) { |
| 2937 if (isContextLost() || | 3001 if (isContextLost() || |
| 2938 !validateUniformMatrixParameters("uniformMatrix4x2fv", location, | 3002 !validateUniformMatrixParameters("uniformMatrix4x2fv", location, |
| 2939 transpose, value.data(), value.size(), 8, | 3003 transpose, value.data(), value.size(), 8, |
| 2940 srcOffset, srcLength)) | 3004 srcOffset, srcLength)) |
| 2941 return; | 3005 return; |
| 2942 contextGL()->UniformMatrix4x2fv(location->location(), value.size() / 8, | 3006 contextGL()->UniformMatrix4x2fv( |
| 2943 transpose, value.data() + srcOffset); | 3007 location->location(), |
| 3008 (srcLength ? srcLength : (value.size() - srcOffset)) >> 3, transpose, |
| 3009 value.data() + srcOffset); |
| 2944 } | 3010 } |
| 2945 | 3011 |
| 2946 void WebGL2RenderingContextBase::uniformMatrix3x4fv( | 3012 void WebGL2RenderingContextBase::uniformMatrix3x4fv( |
| 2947 const WebGLUniformLocation* location, | 3013 const WebGLUniformLocation* location, |
| 2948 GLboolean transpose, | 3014 GLboolean transpose, |
| 2949 DOMFloat32Array* value, | 3015 DOMFloat32Array* value, |
| 2950 GLuint srcOffset, | 3016 GLuint srcOffset, |
| 2951 GLuint srcLength) { | 3017 GLuint srcLength) { |
| 2952 if (isContextLost() || | 3018 if (isContextLost() || |
| 2953 !validateUniformMatrixParameters("uniformMatrix3x4fv", location, | 3019 !validateUniformMatrixParameters("uniformMatrix3x4fv", location, |
| 2954 transpose, value, 12, srcOffset, | 3020 transpose, value, 12, srcOffset, |
| 2955 srcLength)) | 3021 srcLength)) |
| 2956 return; | 3022 return; |
| 2957 contextGL()->UniformMatrix3x4fv(location->location(), value->length() / 12, | 3023 contextGL()->UniformMatrix3x4fv( |
| 2958 transpose, value->data() + srcOffset); | 3024 location->location(), |
| 3025 (srcLength ? srcLength : (value->length() - srcOffset)) / 12, transpose, |
| 3026 value->data() + srcOffset); |
| 2959 } | 3027 } |
| 2960 | 3028 |
| 2961 void WebGL2RenderingContextBase::uniformMatrix3x4fv( | 3029 void WebGL2RenderingContextBase::uniformMatrix3x4fv( |
| 2962 const WebGLUniformLocation* location, | 3030 const WebGLUniformLocation* location, |
| 2963 GLboolean transpose, | 3031 GLboolean transpose, |
| 2964 Vector<GLfloat>& value, | 3032 Vector<GLfloat>& value, |
| 2965 GLuint srcOffset, | 3033 GLuint srcOffset, |
| 2966 GLuint srcLength) { | 3034 GLuint srcLength) { |
| 2967 if (isContextLost() || | 3035 if (isContextLost() || |
| 2968 !validateUniformMatrixParameters("uniformMatrix3x4fv", location, | 3036 !validateUniformMatrixParameters("uniformMatrix3x4fv", location, |
| 2969 transpose, value.data(), value.size(), | 3037 transpose, value.data(), value.size(), |
| 2970 12, srcOffset, srcLength)) | 3038 12, srcOffset, srcLength)) |
| 2971 return; | 3039 return; |
| 2972 contextGL()->UniformMatrix3x4fv(location->location(), value.size() / 12, | 3040 contextGL()->UniformMatrix3x4fv( |
| 2973 transpose, value.data() + srcOffset); | 3041 location->location(), |
| 3042 (srcLength ? srcLength : (value.size() - srcOffset)) / 12, transpose, |
| 3043 value.data() + srcOffset); |
| 2974 } | 3044 } |
| 2975 | 3045 |
| 2976 void WebGL2RenderingContextBase::uniformMatrix4x3fv( | 3046 void WebGL2RenderingContextBase::uniformMatrix4x3fv( |
| 2977 const WebGLUniformLocation* location, | 3047 const WebGLUniformLocation* location, |
| 2978 GLboolean transpose, | 3048 GLboolean transpose, |
| 2979 DOMFloat32Array* value, | 3049 DOMFloat32Array* value, |
| 2980 GLuint srcOffset, | 3050 GLuint srcOffset, |
| 2981 GLuint srcLength) { | 3051 GLuint srcLength) { |
| 2982 if (isContextLost() || | 3052 if (isContextLost() || |
| 2983 !validateUniformMatrixParameters("uniformMatrix4x3fv", location, | 3053 !validateUniformMatrixParameters("uniformMatrix4x3fv", location, |
| 2984 transpose, value, 12, srcOffset, | 3054 transpose, value, 12, srcOffset, |
| 2985 srcLength)) | 3055 srcLength)) |
| 2986 return; | 3056 return; |
| 2987 contextGL()->UniformMatrix4x3fv(location->location(), value->length() / 12, | 3057 contextGL()->UniformMatrix4x3fv( |
| 2988 transpose, value->data() + srcOffset); | 3058 location->location(), |
| 3059 (srcLength ? srcLength : (value->length() - srcOffset)) / 12, transpose, |
| 3060 value->data() + srcOffset); |
| 2989 } | 3061 } |
| 2990 | 3062 |
| 2991 void WebGL2RenderingContextBase::uniformMatrix4x3fv( | 3063 void WebGL2RenderingContextBase::uniformMatrix4x3fv( |
| 2992 const WebGLUniformLocation* location, | 3064 const WebGLUniformLocation* location, |
| 2993 GLboolean transpose, | 3065 GLboolean transpose, |
| 2994 Vector<GLfloat>& value, | 3066 Vector<GLfloat>& value, |
| 2995 GLuint srcOffset, | 3067 GLuint srcOffset, |
| 2996 GLuint srcLength) { | 3068 GLuint srcLength) { |
| 2997 if (isContextLost() || | 3069 if (isContextLost() || |
| 2998 !validateUniformMatrixParameters("uniformMatrix4x3fv", location, | 3070 !validateUniformMatrixParameters("uniformMatrix4x3fv", location, |
| 2999 transpose, value.data(), value.size(), | 3071 transpose, value.data(), value.size(), |
| 3000 12, srcOffset, srcLength)) | 3072 12, srcOffset, srcLength)) |
| 3001 return; | 3073 return; |
| 3002 contextGL()->UniformMatrix4x3fv(location->location(), value.size() / 12, | 3074 contextGL()->UniformMatrix4x3fv( |
| 3003 transpose, value.data() + srcOffset); | 3075 location->location(), |
| 3076 (srcLength ? srcLength : (value.size() - srcOffset)) / 12, transpose, |
| 3077 value.data() + srcOffset); |
| 3004 } | 3078 } |
| 3005 | 3079 |
| 3006 void WebGL2RenderingContextBase::uniform1fv( | 3080 void WebGL2RenderingContextBase::uniform1fv( |
| 3007 const WebGLUniformLocation* location, | 3081 const WebGLUniformLocation* location, |
| 3008 const FlexibleFloat32ArrayView& v) { | 3082 const FlexibleFloat32ArrayView& v) { |
| 3009 WebGLRenderingContextBase::uniform1fv(location, v); | 3083 WebGLRenderingContextBase::uniform1fv(location, v); |
| 3010 } | 3084 } |
| 3011 | 3085 |
| 3012 void WebGL2RenderingContextBase::uniform1fv( | 3086 void WebGL2RenderingContextBase::uniform1fv( |
| 3013 const WebGLUniformLocation* location, | 3087 const WebGLUniformLocation* location, |
| (...skipping 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5593 | 5667 |
| 5594 void WebGL2RenderingContextBase:: | 5668 void WebGL2RenderingContextBase:: |
| 5595 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 5669 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
| 5596 if (!contextGL()) | 5670 if (!contextGL()) |
| 5597 return; | 5671 return; |
| 5598 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 5672 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
| 5599 objectOrZero(m_boundPixelUnpackBuffer.get())); | 5673 objectOrZero(m_boundPixelUnpackBuffer.get())); |
| 5600 } | 5674 } |
| 5601 | 5675 |
| 5602 } // namespace blink | 5676 } // namespace blink |
| OLD | NEW |