| OLD | NEW |
| 1 library dart.dom.web_gl; | 1 library dart.dom.web_gl; |
| 2 | 2 |
| 3 import 'dart:collection'; | 3 import 'dart:collection'; |
| 4 import 'dart:_collection-dev'; | 4 import 'dart:_collection-dev'; |
| 5 import 'dart:html'; | 5 import 'dart:html'; |
| 6 import 'dart:html_common'; | 6 import 'dart:html_common'; |
| 7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
| 8 import 'dart:_js_helper' show Creates, JSName, Null, Returns, convertDartClosure
ToJS; | 8 import 'dart:_js_helper' show Creates, JSName, Null, Returns, convertDartClosure
ToJS; |
| 9 import 'dart:_foreign_helper' show JS; | 9 import 'dart:_foreign_helper' show JS; |
| 10 import 'dart:_interceptors' show Interceptor, JSExtendableArray; | 10 import 'dart:_interceptors' show Interceptor, JSExtendableArray; |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 858 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 859 // for details. All rights reserved. Use of this source code is governed by a | 859 // for details. All rights reserved. Use of this source code is governed by a |
| 860 // BSD-style license that can be found in the LICENSE file. | 860 // BSD-style license that can be found in the LICENSE file. |
| 861 | 861 |
| 862 | 862 |
| 863 @DocsEditable() | 863 @DocsEditable() |
| 864 @DomName('WebGLRenderbuffer') | 864 @DomName('WebGLRenderbuffer') |
| 865 @Unstable() | 865 @Unstable() |
| 866 class Renderbuffer extends Interceptor native "WebGLRenderbuffer" { | 866 class Renderbuffer extends Interceptor native "WebGLRenderbuffer" { |
| 867 } | 867 } |
| 868 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 868 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 869 // for details. All rights reserved. Use of this source code is governed by a | 869 // for details. All rights reserved. Use of this source code is governed by a |
| 870 // BSD-style license that can be found in the LICENSE file. | 870 // BSD-style license that can be found in the LICENSE file. |
| 871 | 871 |
| 872 | 872 |
| 873 @DocsEditable() | |
| 874 @DomName('WebGLRenderingContext') | 873 @DomName('WebGLRenderingContext') |
| 875 @SupportedBrowser(SupportedBrowser.CHROME) | 874 @SupportedBrowser(SupportedBrowser.CHROME) |
| 876 @SupportedBrowser(SupportedBrowser.FIREFOX) | 875 @SupportedBrowser(SupportedBrowser.FIREFOX) |
| 877 @Experimental() | 876 @Experimental() |
| 878 @Unstable() | 877 @Unstable() |
| 879 class RenderingContext extends CanvasRenderingContext native "WebGLRenderingCont
ext" { | 878 class RenderingContext extends CanvasRenderingContext native "WebGLRenderingCont
ext" { |
| 880 // To suppress missing implicit constructor warnings. | 879 // To suppress missing implicit constructor warnings. |
| 881 factory RenderingContext._() { throw new UnsupportedError("Not supported"); } | 880 factory RenderingContext._() { throw new UnsupportedError("Not supported"); } |
| 882 | 881 |
| 883 /// Checks if this type is supported on the current platform. | 882 /// Checks if this type is supported on the current platform. |
| (...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2486 void stencilMaskSeparate(int face, int mask) native; | 2485 void stencilMaskSeparate(int face, int mask) native; |
| 2487 | 2486 |
| 2488 @DomName('WebGLRenderingContext.stencilOp') | 2487 @DomName('WebGLRenderingContext.stencilOp') |
| 2489 @DocsEditable() | 2488 @DocsEditable() |
| 2490 void stencilOp(int fail, int zfail, int zpass) native; | 2489 void stencilOp(int fail, int zfail, int zpass) native; |
| 2491 | 2490 |
| 2492 @DomName('WebGLRenderingContext.stencilOpSeparate') | 2491 @DomName('WebGLRenderingContext.stencilOpSeparate') |
| 2493 @DocsEditable() | 2492 @DocsEditable() |
| 2494 void stencilOpSeparate(int face, int fail, int zfail, int zpass) native; | 2493 void stencilOpSeparate(int face, int fail, int zfail, int zpass) native; |
| 2495 | 2494 |
| 2496 @DomName('WebGLRenderingContext.texImage2D') | |
| 2497 @DocsEditable() | |
| 2498 void texImage2D(int target, int level, int internalformat, int format_OR_width
, int height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, [int format,
int type, TypedData pixels]) { | |
| 2499 if (pixels != null && type != null && format != null && (border_OR_canvas_OR
_image_OR_pixels_OR_video is int || border_OR_canvas_OR_image_OR_pixels_OR_video
== null)) { | |
| 2500 _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_ty
pe, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels); | |
| 2501 return; | |
| 2502 } | |
| 2503 if ((border_OR_canvas_OR_image_OR_pixels_OR_video is ImageData || border_OR_
canvas_OR_image_OR_pixels_OR_video == null) && format == null && type == null &&
pixels == null) { | |
| 2504 var pixels_1 = convertDartToNative_ImageData(border_OR_canvas_OR_image_OR_
pixels_OR_video); | |
| 2505 _texImage2D_2(target, level, internalformat, format_OR_width, height_OR_ty
pe, pixels_1); | |
| 2506 return; | |
| 2507 } | |
| 2508 if ((border_OR_canvas_OR_image_OR_pixels_OR_video is ImageElement || border_
OR_canvas_OR_image_OR_pixels_OR_video == null) && format == null && type == null
&& pixels == null) { | |
| 2509 _texImage2D_3(target, level, internalformat, format_OR_width, height_OR_ty
pe, border_OR_canvas_OR_image_OR_pixels_OR_video); | |
| 2510 return; | |
| 2511 } | |
| 2512 if ((border_OR_canvas_OR_image_OR_pixels_OR_video is CanvasElement || border
_OR_canvas_OR_image_OR_pixels_OR_video == null) && format == null && type == nul
l && pixels == null) { | |
| 2513 _texImage2D_4(target, level, internalformat, format_OR_width, height_OR_ty
pe, border_OR_canvas_OR_image_OR_pixels_OR_video); | |
| 2514 return; | |
| 2515 } | |
| 2516 if ((border_OR_canvas_OR_image_OR_pixels_OR_video is VideoElement || border_
OR_canvas_OR_image_OR_pixels_OR_video == null) && format == null && type == null
&& pixels == null) { | |
| 2517 _texImage2D_5(target, level, internalformat, format_OR_width, height_OR_ty
pe, border_OR_canvas_OR_image_OR_pixels_OR_video); | |
| 2518 return; | |
| 2519 } | |
| 2520 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 2521 } | |
| 2522 @JSName('texImage2D') | |
| 2523 @DomName('WebGLRenderingContext.texImage2D') | |
| 2524 @DocsEditable() | |
| 2525 void _texImage2D_1(target, level, internalformat, width, height, int border, f
ormat, type, TypedData pixels) native; | |
| 2526 @JSName('texImage2D') | |
| 2527 @DomName('WebGLRenderingContext.texImage2D') | |
| 2528 @DocsEditable() | |
| 2529 void _texImage2D_2(target, level, internalformat, format, type, pixels) native
; | |
| 2530 @JSName('texImage2D') | |
| 2531 @DomName('WebGLRenderingContext.texImage2D') | |
| 2532 @DocsEditable() | |
| 2533 void _texImage2D_3(target, level, internalformat, format, type, ImageElement i
mage) native; | |
| 2534 @JSName('texImage2D') | |
| 2535 @DomName('WebGLRenderingContext.texImage2D') | |
| 2536 @DocsEditable() | |
| 2537 void _texImage2D_4(target, level, internalformat, format, type, CanvasElement
canvas) native; | |
| 2538 @JSName('texImage2D') | |
| 2539 @DomName('WebGLRenderingContext.texImage2D') | |
| 2540 @DocsEditable() | |
| 2541 void _texImage2D_5(target, level, internalformat, format, type, VideoElement v
ideo) native; | |
| 2542 | |
| 2543 @DomName('WebGLRenderingContext.texParameterf') | 2495 @DomName('WebGLRenderingContext.texParameterf') |
| 2544 @DocsEditable() | 2496 @DocsEditable() |
| 2545 void texParameterf(int target, int pname, num param) native; | 2497 void texParameterf(int target, int pname, num param) native; |
| 2546 | 2498 |
| 2547 @DomName('WebGLRenderingContext.texParameteri') | 2499 @DomName('WebGLRenderingContext.texParameteri') |
| 2548 @DocsEditable() | 2500 @DocsEditable() |
| 2549 void texParameteri(int target, int pname, int param) native; | 2501 void texParameteri(int target, int pname, int param) native; |
| 2550 | 2502 |
| 2551 @DomName('WebGLRenderingContext.texSubImage2D') | |
| 2552 @DocsEditable() | |
| 2553 void texSubImage2D(int target, int level, int xoffset, int yoffset, int format
_OR_width, int height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, [in
t type, TypedData pixels]) { | |
| 2554 if (pixels != null && type != null && (canvas_OR_format_OR_image_OR_pixels_O
R_video is int || canvas_OR_format_OR_image_OR_pixels_OR_video == null)) { | |
| 2555 _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_
OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels); | |
| 2556 return; | |
| 2557 } | |
| 2558 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is ImageData || canvas_OR_
format_OR_image_OR_pixels_OR_video == null) && type == null && pixels == null) { | |
| 2559 var pixels_1 = convertDartToNative_ImageData(canvas_OR_format_OR_image_OR_
pixels_OR_video); | |
| 2560 _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width, height_
OR_type, pixels_1); | |
| 2561 return; | |
| 2562 } | |
| 2563 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is ImageElement || canvas_
OR_format_OR_image_OR_pixels_OR_video == null) && type == null && pixels == null
) { | |
| 2564 _texSubImage2D_3(target, level, xoffset, yoffset, format_OR_width, height_
OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video); | |
| 2565 return; | |
| 2566 } | |
| 2567 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is CanvasElement || canvas
_OR_format_OR_image_OR_pixels_OR_video == null) && type == null && pixels == nul
l) { | |
| 2568 _texSubImage2D_4(target, level, xoffset, yoffset, format_OR_width, height_
OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video); | |
| 2569 return; | |
| 2570 } | |
| 2571 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is VideoElement || canvas_
OR_format_OR_image_OR_pixels_OR_video == null) && type == null && pixels == null
) { | |
| 2572 _texSubImage2D_5(target, level, xoffset, yoffset, format_OR_width, height_
OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video); | |
| 2573 return; | |
| 2574 } | |
| 2575 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 2576 } | |
| 2577 @JSName('texSubImage2D') | |
| 2578 @DomName('WebGLRenderingContext.texSubImage2D') | |
| 2579 @DocsEditable() | |
| 2580 void _texSubImage2D_1(target, level, xoffset, yoffset, width, height, int form
at, type, TypedData pixels) native; | |
| 2581 @JSName('texSubImage2D') | |
| 2582 @DomName('WebGLRenderingContext.texSubImage2D') | |
| 2583 @DocsEditable() | |
| 2584 void _texSubImage2D_2(target, level, xoffset, yoffset, format, type, pixels) n
ative; | |
| 2585 @JSName('texSubImage2D') | |
| 2586 @DomName('WebGLRenderingContext.texSubImage2D') | |
| 2587 @DocsEditable() | |
| 2588 void _texSubImage2D_3(target, level, xoffset, yoffset, format, type, ImageElem
ent image) native; | |
| 2589 @JSName('texSubImage2D') | |
| 2590 @DomName('WebGLRenderingContext.texSubImage2D') | |
| 2591 @DocsEditable() | |
| 2592 void _texSubImage2D_4(target, level, xoffset, yoffset, format, type, CanvasEle
ment canvas) native; | |
| 2593 @JSName('texSubImage2D') | |
| 2594 @DomName('WebGLRenderingContext.texSubImage2D') | |
| 2595 @DocsEditable() | |
| 2596 void _texSubImage2D_5(target, level, xoffset, yoffset, format, type, VideoElem
ent video) native; | |
| 2597 | |
| 2598 @DomName('WebGLRenderingContext.uniform1f') | 2503 @DomName('WebGLRenderingContext.uniform1f') |
| 2599 @DocsEditable() | 2504 @DocsEditable() |
| 2600 void uniform1f(UniformLocation location, num x) native; | 2505 void uniform1f(UniformLocation location, num x) native; |
| 2601 | 2506 |
| 2602 @DomName('WebGLRenderingContext.uniform1fv') | 2507 @DomName('WebGLRenderingContext.uniform1fv') |
| 2603 @DocsEditable() | 2508 @DocsEditable() |
| 2604 void uniform1fv(UniformLocation location, Float32List v) native; | 2509 void uniform1fv(UniformLocation location, Float32List v) native; |
| 2605 | 2510 |
| 2606 @DomName('WebGLRenderingContext.uniform1i') | 2511 @DomName('WebGLRenderingContext.uniform1i') |
| 2607 @DocsEditable() | 2512 @DocsEditable() |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2711 @DocsEditable() | 2616 @DocsEditable() |
| 2712 void vertexAttrib4fv(int indx, Float32List values) native; | 2617 void vertexAttrib4fv(int indx, Float32List values) native; |
| 2713 | 2618 |
| 2714 @DomName('WebGLRenderingContext.vertexAttribPointer') | 2619 @DomName('WebGLRenderingContext.vertexAttribPointer') |
| 2715 @DocsEditable() | 2620 @DocsEditable() |
| 2716 void vertexAttribPointer(int indx, int size, int type, bool normalized, int st
ride, int offset) native; | 2621 void vertexAttribPointer(int indx, int size, int type, bool normalized, int st
ride, int offset) native; |
| 2717 | 2622 |
| 2718 @DomName('WebGLRenderingContext.viewport') | 2623 @DomName('WebGLRenderingContext.viewport') |
| 2719 @DocsEditable() | 2624 @DocsEditable() |
| 2720 void viewport(int x, int y, int width, int height) native; | 2625 void viewport(int x, int y, int width, int height) native; |
| 2626 |
| 2627 |
| 2628 /** |
| 2629 * Sets the currently bound texture to [data]. |
| 2630 * |
| 2631 * [data] can be either an [ImageElement], a |
| 2632 * [CanvasElement], a [VideoElement], or an [ImageData] object. |
| 2633 * |
| 2634 * To use [texImage2d] with a TypedData object, use [texImage2dTyped]. |
| 2635 * |
| 2636 */ |
| 2637 @DomName('WebGLRenderingContext.texImage2D') |
| 2638 @JSName('texImage2D') |
| 2639 void texImage2D(int targetTexture, int levelOfDetail, int internalFormat, |
| 2640 int format, int type, data) native; |
| 2641 |
| 2642 /** |
| 2643 * Sets the currently bound texture to [data]. |
| 2644 */ |
| 2645 @JSName('texImage2D') |
| 2646 void texImage2DTyped(int targetTexture, int levelOfDetail, |
| 2647 int internalFormat, int width, int height, int border, int format, |
| 2648 int type, TypedData data) native; |
| 2649 |
| 2650 /** |
| 2651 * Updates a sub-rectangle of the currently bound texture to [data]. |
| 2652 * |
| 2653 * [data] can be either an [ImageElement], a |
| 2654 * [CanvasElement], a [VideoElement], or an [ImageData] object. |
| 2655 * |
| 2656 * To use [texSubImage2d] with a TypedData object, use [texSubImage2dTyped]. |
| 2657 * |
| 2658 */ |
| 2659 @DomName('WebGLRenderingContext.texSubImage2D') |
| 2660 @JSName('texSubImage2D') |
| 2661 void texSubImage2D(int targetTexture, int levelOfDetail, int internalFormat, |
| 2662 int format, int type, data) native; |
| 2663 |
| 2664 /** |
| 2665 * Updates a sub-rectangle of the currently bound texture to [data]. |
| 2666 */ |
| 2667 @JSName('texSubImage2D') |
| 2668 void texSubImage2DTyped(int targetTexture, int levelOfDetail, |
| 2669 int internalFormat, int width, int height, int border, int format, |
| 2670 int type, TypedData data) native; |
| 2721 } | 2671 } |
| 2722 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2672 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2723 // for details. All rights reserved. Use of this source code is governed by a | 2673 // for details. All rights reserved. Use of this source code is governed by a |
| 2724 // BSD-style license that can be found in the LICENSE file. | 2674 // BSD-style license that can be found in the LICENSE file. |
| 2725 | 2675 |
| 2726 | 2676 |
| 2727 @DocsEditable() | 2677 @DocsEditable() |
| 2728 @DomName('WebGLShader') | 2678 @DomName('WebGLShader') |
| 2729 class Shader extends Interceptor native "WebGLShader" { | 2679 class Shader extends Interceptor native "WebGLShader" { |
| 2730 } | 2680 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2771 // for details. All rights reserved. Use of this source code is governed by a | 2721 // for details. All rights reserved. Use of this source code is governed by a |
| 2772 // BSD-style license that can be found in the LICENSE file. | 2722 // BSD-style license that can be found in the LICENSE file. |
| 2773 | 2723 |
| 2774 | 2724 |
| 2775 @DocsEditable() | 2725 @DocsEditable() |
| 2776 @DomName('WebGLVertexArrayObjectOES') | 2726 @DomName('WebGLVertexArrayObjectOES') |
| 2777 // http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/ | 2727 // http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/ |
| 2778 @Experimental() // experimental | 2728 @Experimental() // experimental |
| 2779 class VertexArrayObject extends Interceptor native "WebGLVertexArrayObjectOES" { | 2729 class VertexArrayObject extends Interceptor native "WebGLVertexArrayObjectOES" { |
| 2780 } | 2730 } |
| OLD | NEW |