OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
6 | 6 |
7 $(ANNOTATIONS)$(NATIVESPEC)class $CLASSNAME$EXTENDS implements CanvasRenderingCo
ntext { | 7 $(ANNOTATIONS)$(NATIVESPEC)class $CLASSNAME$EXTENDS implements CanvasRenderingCo
ntext { |
8 $!MEMBERS | 8 $!MEMBERS |
9 | 9 |
| 10 @DomName('WebGLRenderingContext.readPixels') |
| 11 @DocsEditable() |
| 12 void readPixels(int x, int y, int width, int height, int format, int type, |
| 13 TypedData pixels) { |
| 14 $if DART2JS |
| 15 _readPixels(x, y, width, height, format, type, pixels); |
| 16 $else |
| 17 var data = js.toArrayBufferView(pixels); |
| 18 _readPixels(x, y, width, height, format, type, data); |
| 19 for (var i = 0; i < data.length; i++) { |
| 20 pixels[i] = data[i]; |
| 21 } |
| 22 $endif |
| 23 } |
| 24 |
10 /** | 25 /** |
11 * Sets the currently bound texture to [data]. | 26 * Sets the currently bound texture to [data]. |
12 * | 27 * |
13 * [data] can be either an [ImageElement], a | 28 * [data] can be either an [ImageElement], a |
14 * [CanvasElement], a [VideoElement], [TypedData] or an [ImageData] object. | 29 * [CanvasElement], a [VideoElement], [TypedData] or an [ImageData] object. |
15 * | 30 * |
16 * This is deprecated in favor of [texImage2D]. | 31 * This is deprecated in favor of [texImage2D]. |
17 */ | 32 */ |
18 @Deprecated("Use texImage2D") | 33 @Deprecated("Use texImage2D") |
19 void texImage2DUntyped(int targetTexture, int levelOfDetail, | 34 void texImage2DUntyped(int targetTexture, int levelOfDetail, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } | 82 } |
68 | 83 |
69 /** | 84 /** |
70 * Set the bufferSubData to [data]. | 85 * Set the bufferSubData to [data]. |
71 */ | 86 */ |
72 @Deprecated("Use bufferSubData") | 87 @Deprecated("Use bufferSubData") |
73 void bufferSubDataTyped(int target, int offset, TypedData data) { | 88 void bufferSubDataTyped(int target, int offset, TypedData data) { |
74 bufferSubData(target, offset, data); | 89 bufferSubData(target, offset, data); |
75 } | 90 } |
76 } | 91 } |
OLD | NEW |