| 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') | 10 @DomName('WebGLRenderingContext.readPixels') |
| 11 @DocsEditable() | 11 @DocsEditable() |
| 12 void readPixels(int x, int y, int width, int height, int format, int type, | 12 void readPixels(int x, int y, int width, int height, int format, int type, |
| 13 TypedData pixels) { | 13 TypedData pixels) { |
| 14 $if DART2JS | |
| 15 _readPixels(x, y, width, height, format, type, pixels); | 14 _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 } | 15 } |
| 24 | 16 |
| 25 /** | 17 /** |
| 26 * Sets the currently bound texture to [data]. | 18 * Sets the currently bound texture to [data]. |
| 27 * | 19 * |
| 28 * [data] can be either an [ImageElement], a | 20 * [data] can be either an [ImageElement], a |
| 29 * [CanvasElement], a [VideoElement], [TypedData] or an [ImageData] object. | 21 * [CanvasElement], a [VideoElement], [TypedData] or an [ImageData] object. |
| 30 * | 22 * |
| 31 * This is deprecated in favor of [texImage2D]. | 23 * This is deprecated in favor of [texImage2D]. |
| 32 */ | 24 */ |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } | 74 } |
| 83 | 75 |
| 84 /** | 76 /** |
| 85 * Set the bufferSubData to [data]. | 77 * Set the bufferSubData to [data]. |
| 86 */ | 78 */ |
| 87 @Deprecated("Use bufferSubData") | 79 @Deprecated("Use bufferSubData") |
| 88 void bufferSubDataTyped(int target, int offset, TypedData data) { | 80 void bufferSubDataTyped(int target, int offset, TypedData data) { |
| 89 bufferSubData(target, offset, data); | 81 bufferSubData(target, offset, data); |
| 90 } | 82 } |
| 91 } | 83 } |
| OLD | NEW |