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

Unified Diff: sdk/lib/typed_data/typed_data.dart

Issue 51333005: Add Uint32x4List to typed_data (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/typed_data/dart2js/typed_data_dart2js.dart ('k') | tests/lib/typed_data/uint32x4_list_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/typed_data/typed_data.dart
diff --git a/sdk/lib/typed_data/typed_data.dart b/sdk/lib/typed_data/typed_data.dart
index f105a2d5a29e228214ea74416d38d88b31a17066..398a360d7a0d3e7546146e4a54a542e5432288e4 100644
--- a/sdk/lib/typed_data/typed_data.dart
+++ b/sdk/lib/typed_data/typed_data.dart
@@ -827,6 +827,46 @@ abstract class Float32x4List implements List<Float32x4>, TypedData {
/**
+ * A fixed-length list of Uint32x4 numbers that is viewable as a
+ * [TypedData]. For long lists, this implementation will be considerably more
+ * space- and time-efficient than the default [List] implementation.
+ */
+abstract class Uint32x4List implements List<Uint32x4>, TypedData {
+ /**
+ * Creates a [Uint32x4List] of the specified length (in elements),
+ * all of whose elements are initially zero.
+ */
+ external factory Uint32x4List(int length);
+
+ /**
+ * Creates a [Uint32x4List] with the same size as the [elements] list
+ * and copies over the elements.
+ */
+ external factory Uint32x4List.fromList(List<Uint32x4> elements);
+
+ /**
+ * Creates a [Uint32x4List] _view_ of the specified region in the specified
+ * byte buffer. Changes in the [Uint32x4List] will be visible in the byte
+ * buffer and vice versa. If the [offsetInBytes] index of the region is not
+ * specified, it defaults to zero (the first byte in the byte buffer).
+ * If the length is not specified, it defaults to null, which indicates
+ * that the view extends to the end of the byte buffer.
+ *
+ * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
+ * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
+ * the length of [buffer].
+ *
+ * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
+ * BYTES_PER_ELEMENT.
+ */
+ external factory Uint32x4List.view(ByteBuffer buffer,
+ [int offsetInBytes = 0, int length]);
+
+ static const int BYTES_PER_ELEMENT = 16;
+}
+
+
+/**
* Interface of Dart Float32x4 immutable value type and operations.
* Float32x4 stores 4 32-bit floating point values in "lanes".
* The lanes are "x", "y", "z", and "w" respectively.
« no previous file with comments | « sdk/lib/typed_data/dart2js/typed_data_dart2js.dart ('k') | tests/lib/typed_data/uint32x4_list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698