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

Unified Diff: sdk/lib/scalarlist/byte_arrays.dart

Issue 11437028: Added Uint8ClampedList. COmpielr optimziations to follow in next CL. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/symbols.h ('k') | tests/standalone/byte_array_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/scalarlist/byte_arrays.dart
===================================================================
--- sdk/lib/scalarlist/byte_arrays.dart (revision 15794)
+++ sdk/lib/scalarlist/byte_arrays.dart (working copy)
@@ -398,6 +398,32 @@
/**
+ * A fixed-length list of 8-bit unsigned integers that is viewable as a
+ * [ByteArray]. For long lists, this implementation will be considerably
+ * more space- and time-efficient than the default [List] implementation.
+ * Indexed store clamps the value to range 0..0xFF.
+ */
+abstract class Uint8ClampedList implements List<int>, ByteArrayViewable {
+ /**
+ * Creates a [Uint8ClampedList] of the specified length (in elements), all of
+ * whose elements are initially zero.
+ */
+ external factory Uint8ClampedList(int length);
+
+ /**
+ * Creates a [Uint8ClampedList] _view_ of the specified region in the
+ * specified byte [array]. Changes in the [Uint8List] will be visible in the
+ * byte array and vice versa. If the [start] index of the region is not
+ * specified, it defaults to zero (the first byte in the byte array). If the
+ * length is not specified, it defaults to null, which indicates that the view
+ * extends to the end of the byte array.
+ */
+ external factory Uint8ClampedList.view(ByteArray array,
+ [int start, int length]);
+}
+
+
+/**
* A fixed-length list of 16-bit signed integers that is viewable as a
* [ByteArray]. For long lists, this implementation will be considerably
* more space- and time-efficient than the default [List] implementation.
« no previous file with comments | « runtime/vm/symbols.h ('k') | tests/standalone/byte_array_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698