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

Side by Side Diff: sdk/lib/web_gl/dart2js/web_gl_dart2js.dart

Issue 15138002: Added tests to previously broken functionality and added null checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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; 10 import 'dart:_interceptors' show Interceptor;
(...skipping 2387 matching lines...) Expand 10 before | Expand all | Expand 10 after
2398 @DomName('WebGLRenderingContext.stencilOp') 2398 @DomName('WebGLRenderingContext.stencilOp')
2399 @DocsEditable 2399 @DocsEditable
2400 void stencilOp(int fail, int zfail, int zpass) native; 2400 void stencilOp(int fail, int zfail, int zpass) native;
2401 2401
2402 @DomName('WebGLRenderingContext.stencilOpSeparate') 2402 @DomName('WebGLRenderingContext.stencilOpSeparate')
2403 @DocsEditable 2403 @DocsEditable
2404 void stencilOpSeparate(int face, int fail, int zfail, int zpass) native; 2404 void stencilOpSeparate(int face, int fail, int zfail, int zpass) native;
2405 2405
2406 @DomName('WebGLRenderingContext.texImage2D') 2406 @DomName('WebGLRenderingContext.texImage2D')
2407 @DocsEditable 2407 @DocsEditable
2408 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]) { 2408 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]) {
blois 2013/05/13 21:09:16 Which reminds me, would be great to fix https://co
2409 if ((border_OR_canvas_OR_image_OR_pixels_OR_video is int || border_OR_canvas _OR_image_OR_pixels_OR_video == null)) { 2409 if (pixels != null && border_OR_canvas_OR_image_OR_pixels_OR_video is int && border_OR_canvas_OR_image_OR_pixels_OR_video != null && height_OR_type != null && format_OR_width != null) {
2410 _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels); 2410 _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels);
2411 return; 2411 return;
2412 } 2412 }
2413 if ((border_OR_canvas_OR_image_OR_pixels_OR_video is ImageData || border_OR_ canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) { 2413 if (border_OR_canvas_OR_image_OR_pixels_OR_video is ImageData && border_OR_c anvas_OR_image_OR_pixels_OR_video != null && !?format && !?type && !?pixels) {
2414 var pixels_1 = _convertDartToNative_ImageData(border_OR_canvas_OR_image_OR _pixels_OR_video); 2414 var pixels_1 = _convertDartToNative_ImageData(border_OR_canvas_OR_image_OR _pixels_OR_video);
2415 _texImage2D_2(target, level, internalformat, format_OR_width, height_OR_ty pe, pixels_1); 2415 _texImage2D_2(target, level, internalformat, format_OR_width, height_OR_ty pe, pixels_1);
2416 return; 2416 return;
2417 } 2417 }
2418 if ((border_OR_canvas_OR_image_OR_pixels_OR_video is ImageElement || border_ OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels ) { 2418 if (border_OR_canvas_OR_image_OR_pixels_OR_video is ImageElement && border_O R_canvas_OR_image_OR_pixels_OR_video != null && !?format && !?type && !?pixels) {
2419 _texImage2D_3(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video); 2419 _texImage2D_3(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video);
2420 return; 2420 return;
2421 } 2421 }
2422 if ((border_OR_canvas_OR_image_OR_pixels_OR_video is CanvasElement || border _OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixel s) { 2422 if (border_OR_canvas_OR_image_OR_pixels_OR_video is CanvasElement && border_ OR_canvas_OR_image_OR_pixels_OR_video != null && !?format && !?type && !?pixels) {
2423 _texImage2D_4(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video); 2423 _texImage2D_4(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video);
2424 return; 2424 return;
2425 } 2425 }
2426 if ((border_OR_canvas_OR_image_OR_pixels_OR_video is VideoElement || border_ OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels ) { 2426 if (border_OR_canvas_OR_image_OR_pixels_OR_video is VideoElement && border_O R_canvas_OR_image_OR_pixels_OR_video != null && !?format && !?type && !?pixels) {
2427 _texImage2D_5(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video); 2427 _texImage2D_5(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video);
2428 return; 2428 return;
2429 } 2429 }
2430 throw new ArgumentError("Incorrect number or type of arguments"); 2430 throw new ArgumentError("Incorrect number or type of arguments");
2431 } 2431 }
2432 @JSName('texImage2D') 2432 @JSName('texImage2D')
2433 @DomName('WebGLRenderingContext.texImage2D') 2433 @DomName('WebGLRenderingContext.texImage2D')
2434 @DocsEditable 2434 @DocsEditable
2435 void _texImage2D_1(target, level, internalformat, width, height, int border, f ormat, type, TypedData pixels) native; 2435 void _texImage2D_1(target, level, internalformat, width, height, int border, f ormat, type, TypedData pixels) native;
2436 @JSName('texImage2D') 2436 @JSName('texImage2D')
(...skipping 17 matching lines...) Expand all
2454 @DocsEditable 2454 @DocsEditable
2455 void texParameterf(int target, int pname, num param) native; 2455 void texParameterf(int target, int pname, num param) native;
2456 2456
2457 @DomName('WebGLRenderingContext.texParameteri') 2457 @DomName('WebGLRenderingContext.texParameteri')
2458 @DocsEditable 2458 @DocsEditable
2459 void texParameteri(int target, int pname, int param) native; 2459 void texParameteri(int target, int pname, int param) native;
2460 2460
2461 @DomName('WebGLRenderingContext.texSubImage2D') 2461 @DomName('WebGLRenderingContext.texSubImage2D')
2462 @DocsEditable 2462 @DocsEditable
2463 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]) { 2463 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]) {
2464 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is int || canvas_OR_format _OR_image_OR_pixels_OR_video == null)) { 2464 if (pixels != null && canvas_OR_format_OR_image_OR_pixels_OR_video is int && height_OR_type != null && format_OR_width != null) {
2465 _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels); 2465 _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels);
2466 return; 2466 return;
2467 } 2467 }
2468 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is ImageData || canvas_OR_ format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) { 2468 if (canvas_OR_format_OR_image_OR_pixels_OR_video is ImageData && canvas_OR_f ormat_OR_image_OR_pixels_OR_video != null && !?type && !?pixels) {
2469 var pixels_1 = _convertDartToNative_ImageData(canvas_OR_format_OR_image_OR _pixels_OR_video); 2469 var pixels_1 = _convertDartToNative_ImageData(canvas_OR_format_OR_image_OR _pixels_OR_video);
2470 _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, pixels_1); 2470 _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, pixels_1);
2471 return; 2471 return;
2472 } 2472 }
2473 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is ImageElement || canvas_ OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) { 2473 if (canvas_OR_format_OR_image_OR_pixels_OR_video is ImageElement && canvas_O R_format_OR_image_OR_pixels_OR_video != null && !?type && !?pixels) {
2474 _texSubImage2D_3(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video); 2474 _texSubImage2D_3(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
2475 return; 2475 return;
2476 } 2476 }
2477 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is CanvasElement || canvas _OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) { 2477 if (canvas_OR_format_OR_image_OR_pixels_OR_video is CanvasElement && canvas_ OR_format_OR_image_OR_pixels_OR_video != null && !?type && !?pixels) {
2478 _texSubImage2D_4(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video); 2478 _texSubImage2D_4(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
2479 return; 2479 return;
2480 } 2480 }
2481 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is VideoElement || canvas_ OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) { 2481 if (canvas_OR_format_OR_image_OR_pixels_OR_video is VideoElement && canvas_O R_format_OR_image_OR_pixels_OR_video != null && !?type && !?pixels) {
2482 _texSubImage2D_5(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video); 2482 _texSubImage2D_5(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
2483 return; 2483 return;
2484 } 2484 }
2485 throw new ArgumentError("Incorrect number or type of arguments"); 2485 throw new ArgumentError("Incorrect number or type of arguments");
2486 } 2486 }
2487 @JSName('texSubImage2D') 2487 @JSName('texSubImage2D')
2488 @DomName('WebGLRenderingContext.texSubImage2D') 2488 @DomName('WebGLRenderingContext.texSubImage2D')
2489 @DocsEditable 2489 @DocsEditable
2490 void _texSubImage2D_1(target, level, xoffset, yoffset, width, height, int form at, type, TypedData pixels) native; 2490 void _texSubImage2D_1(target, level, xoffset, yoffset, width, height, int form at, type, TypedData pixels) native;
2491 @JSName('texSubImage2D') 2491 @JSName('texSubImage2D')
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
2679 } 2679 }
2680 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2680 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2681 // for details. All rights reserved. Use of this source code is governed by a 2681 // for details. All rights reserved. Use of this source code is governed by a
2682 // BSD-style license that can be found in the LICENSE file. 2682 // BSD-style license that can be found in the LICENSE file.
2683 2683
2684 2684
2685 @DocsEditable 2685 @DocsEditable
2686 @DomName('WebGLVertexArrayObjectOES') 2686 @DomName('WebGLVertexArrayObjectOES')
2687 class VertexArrayObject native "WebGLVertexArrayObjectOES" { 2687 class VertexArrayObject native "WebGLVertexArrayObjectOES" {
2688 } 2688 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698