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

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: Correctly check for position. 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 2384 matching lines...) Expand 10 before | Expand all | Expand 10 after
2395 @DocsEditable 2395 @DocsEditable
2396 void stencilOp(int fail, int zfail, int zpass) native; 2396 void stencilOp(int fail, int zfail, int zpass) native;
2397 2397
2398 @DomName('WebGLRenderingContext.stencilOpSeparate') 2398 @DomName('WebGLRenderingContext.stencilOpSeparate')
2399 @DocsEditable 2399 @DocsEditable
2400 void stencilOpSeparate(int face, int fail, int zfail, int zpass) native; 2400 void stencilOpSeparate(int face, int fail, int zfail, int zpass) native;
2401 2401
2402 @DomName('WebGLRenderingContext.texImage2D') 2402 @DomName('WebGLRenderingContext.texImage2D')
2403 @DocsEditable 2403 @DocsEditable
2404 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]) { 2404 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]) {
2405 if ((border_OR_canvas_OR_image_OR_pixels_OR_video is int || border_OR_canvas _OR_image_OR_pixels_OR_video == null)) { 2405 if (format_OR_width != null && height_OR_type != null && (border_OR_canvas_O R_image_OR_pixels_OR_video is int || border_OR_canvas_OR_image_OR_pixels_OR_vide o == null) && format != null && type != null) {
blois 2013/05/21 23:53:07 why do format_OR_width, height_OR_type need to be
Andrei Mouravski 2013/05/22 09:04:50 They don't. I just couldn't figure out why they we
2406 _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels); 2406 _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels);
2407 return; 2407 return;
2408 } 2408 }
2409 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) { 2409 if (format_OR_width != null && height_OR_type != null && (border_OR_canvas_O R_image_OR_pixels_OR_video is ImageData || border_OR_canvas_OR_image_OR_pixels_O R_video == null) && !?format && !?type && !?pixels) {
2410 var pixels_1 = _convertDartToNative_ImageData(border_OR_canvas_OR_image_OR _pixels_OR_video); 2410 var pixels_1 = _convertDartToNative_ImageData(border_OR_canvas_OR_image_OR _pixels_OR_video);
2411 _texImage2D_2(target, level, internalformat, format_OR_width, height_OR_ty pe, pixels_1); 2411 _texImage2D_2(target, level, internalformat, format_OR_width, height_OR_ty pe, pixels_1);
2412 return; 2412 return;
2413 } 2413 }
2414 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 ) { 2414 if (format_OR_width != null && height_OR_type != null && (border_OR_canvas_O R_image_OR_pixels_OR_video is ImageElement || border_OR_canvas_OR_image_OR_pixel s_OR_video == null) && !?format && !?type && !?pixels) {
2415 _texImage2D_3(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video); 2415 _texImage2D_3(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video);
2416 return; 2416 return;
2417 } 2417 }
2418 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) { 2418 if (format_OR_width != null && height_OR_type != null && (border_OR_canvas_O R_image_OR_pixels_OR_video is CanvasElement || border_OR_canvas_OR_image_OR_pixe ls_OR_video == null) && !?format && !?type && !?pixels) {
2419 _texImage2D_4(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video); 2419 _texImage2D_4(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 VideoElement || border_ OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels ) { 2422 if (format_OR_width != null && height_OR_type != null && (border_OR_canvas_O R_image_OR_pixels_OR_video is VideoElement || border_OR_canvas_OR_image_OR_pixel s_OR_video == null) && !?format && !?type && !?pixels) {
2423 _texImage2D_5(target, level, internalformat, format_OR_width, height_OR_ty pe, border_OR_canvas_OR_image_OR_pixels_OR_video); 2423 _texImage2D_5(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 throw new ArgumentError("Incorrect number or type of arguments"); 2426 throw new ArgumentError("Incorrect number or type of arguments");
2427 } 2427 }
2428 @JSName('texImage2D') 2428 @JSName('texImage2D')
2429 @DomName('WebGLRenderingContext.texImage2D') 2429 @DomName('WebGLRenderingContext.texImage2D')
2430 @DocsEditable 2430 @DocsEditable
2431 void _texImage2D_1(target, level, internalformat, width, height, int border, f ormat, type, TypedData pixels) native; 2431 void _texImage2D_1(target, level, internalformat, width, height, int border, f ormat, type, TypedData pixels) native;
2432 @JSName('texImage2D') 2432 @JSName('texImage2D')
(...skipping 17 matching lines...) Expand all
2450 @DocsEditable 2450 @DocsEditable
2451 void texParameterf(int target, int pname, num param) native; 2451 void texParameterf(int target, int pname, num param) native;
2452 2452
2453 @DomName('WebGLRenderingContext.texParameteri') 2453 @DomName('WebGLRenderingContext.texParameteri')
2454 @DocsEditable 2454 @DocsEditable
2455 void texParameteri(int target, int pname, int param) native; 2455 void texParameteri(int target, int pname, int param) native;
2456 2456
2457 @DomName('WebGLRenderingContext.texSubImage2D') 2457 @DomName('WebGLRenderingContext.texSubImage2D')
2458 @DocsEditable 2458 @DocsEditable
2459 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]) { 2459 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]) {
2460 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is int || canvas_OR_format _OR_image_OR_pixels_OR_video == null)) { 2460 if (format_OR_width != null && height_OR_type != null && (canvas_OR_format_O R_image_OR_pixels_OR_video is int || canvas_OR_format_OR_image_OR_pixels_OR_vide o == null) && type != null) {
2461 _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels); 2461 _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels);
2462 return; 2462 return;
2463 } 2463 }
2464 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is ImageData || canvas_OR_ format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) { 2464 if (format_OR_width != null && height_OR_type != null && (canvas_OR_format_O R_image_OR_pixels_OR_video is ImageData || canvas_OR_format_OR_image_OR_pixels_O R_video == null) && !?type && !?pixels) {
2465 var pixels_1 = _convertDartToNative_ImageData(canvas_OR_format_OR_image_OR _pixels_OR_video); 2465 var pixels_1 = _convertDartToNative_ImageData(canvas_OR_format_OR_image_OR _pixels_OR_video);
2466 _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, pixels_1); 2466 _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, pixels_1);
2467 return; 2467 return;
2468 } 2468 }
2469 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is ImageElement || canvas_ OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) { 2469 if (format_OR_width != null && height_OR_type != null && (canvas_OR_format_O R_image_OR_pixels_OR_video is ImageElement || canvas_OR_format_OR_image_OR_pixel s_OR_video == null) && !?type && !?pixels) {
2470 _texSubImage2D_3(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video); 2470 _texSubImage2D_3(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
2471 return; 2471 return;
2472 } 2472 }
2473 if ((canvas_OR_format_OR_image_OR_pixels_OR_video is CanvasElement || canvas _OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) { 2473 if (format_OR_width != null && height_OR_type != null && (canvas_OR_format_O R_image_OR_pixels_OR_video is CanvasElement || canvas_OR_format_OR_image_OR_pixe ls_OR_video == null) && !?type && !?pixels) {
2474 _texSubImage2D_4(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video); 2474 _texSubImage2D_4(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 VideoElement || canvas_ OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) { 2477 if (format_OR_width != null && height_OR_type != null && (canvas_OR_format_O R_image_OR_pixels_OR_video is VideoElement || canvas_OR_format_OR_image_OR_pixel s_OR_video == null) && !?type && !?pixels) {
2478 _texSubImage2D_5(target, level, xoffset, yoffset, format_OR_width, height_ OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video); 2478 _texSubImage2D_5(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 throw new ArgumentError("Incorrect number or type of arguments"); 2481 throw new ArgumentError("Incorrect number or type of arguments");
2482 } 2482 }
2483 @JSName('texSubImage2D') 2483 @JSName('texSubImage2D')
2484 @DomName('WebGLRenderingContext.texSubImage2D') 2484 @DomName('WebGLRenderingContext.texSubImage2D')
2485 @DocsEditable 2485 @DocsEditable
2486 void _texSubImage2D_1(target, level, xoffset, yoffset, width, height, int form at, type, TypedData pixels) native; 2486 void _texSubImage2D_1(target, level, xoffset, yoffset, width, height, int form at, type, TypedData pixels) native;
2487 @JSName('texSubImage2D') 2487 @JSName('texSubImage2D')
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
2675 } 2675 }
2676 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2676 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2677 // for details. All rights reserved. Use of this source code is governed by a 2677 // for details. All rights reserved. Use of this source code is governed by a
2678 // BSD-style license that can be found in the LICENSE file. 2678 // BSD-style license that can be found in the LICENSE file.
2679 2679
2680 2680
2681 @DocsEditable 2681 @DocsEditable
2682 @DomName('WebGLVertexArrayObjectOES') 2682 @DomName('WebGLVertexArrayObjectOES')
2683 class VertexArrayObject native "WebGLVertexArrayObjectOES" { 2683 class VertexArrayObject native "WebGLVertexArrayObjectOES" {
2684 } 2684 }
OLDNEW
« no previous file with comments | « sdk/lib/indexed_db/dartium/indexed_db_dartium.dart ('k') | tests/html/canvasrenderingcontext2d_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698