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

Unified Diff: runtime/lib/typeddata.dart

Issue 12730013: - Use dart:typedata types in the Dart API calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « runtime/bin/io.dart ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/typeddata.dart
===================================================================
--- runtime/lib/typeddata.dart (revision 19847)
+++ runtime/lib/typeddata.dart (working copy)
@@ -436,7 +436,7 @@
List getRange(int start, int length) {
_rangeCheck(this.length, start, length);
- List result = _new(length);
+ List result = _createList(length);
result.setRange(0, length, this, start);
return result;
}
@@ -559,6 +559,10 @@
// Internal utility methods.
+ _Int8Array _createList(int length) {
+ return _new(length);
+ }
+
static _Int8Array _new(int length) native "TypedData_Int8Array_new";
}
@@ -610,8 +614,13 @@
return Uint8List.BYTES_PER_ELEMENT;
}
+
// Internal utility methods.
+ _Uint8Array _createList(int length) {
+ return _new(length);
+ }
+
static _Uint8Array _new(int length) native "TypedData_Uint8Array_new";
}
@@ -667,6 +676,10 @@
// Internal utility methods.
+ _Uint8ClampedArray _createList(int length) {
+ return _new(length);
+ }
+
static _Uint8ClampedArray _new(int length)
native "TypedData_Uint8ClampedArray_new";
}
@@ -725,6 +738,10 @@
// Internal utility methods.
+ _Int16Array _createList(int length) {
+ return _new(length);
+ }
+
static _Int16Array _new(int length) native "TypedData_Int16Array_new";
}
@@ -782,6 +799,10 @@
// Internal utility methods.
+ _Uint16Array _createList(int length) {
+ return _new(length);
+ }
+
static _Uint16Array _new(int length) native "TypedData_Uint16Array_new";
}
@@ -839,6 +860,10 @@
// Internal utility methods.
+ _Int32Array _createList(int length) {
+ return _new(length);
+ }
+
static _Int32Array _new(int length) native "TypedData_Int32Array_new";
}
@@ -896,6 +921,10 @@
// Internal utility methods.
+ _Uint32Array _createList(int length) {
+ return _new(length);
+ }
+
static _Uint32Array _new(int length) native "TypedData_Uint32Array_new";
}
@@ -953,6 +982,10 @@
// Internal utility methods.
+ _Int64Array _createList(int length) {
+ return _new(length);
+ }
+
static _Int64Array _new(int length) native "TypedData_Int64Array_new";
}
@@ -1010,6 +1043,10 @@
// Internal utility methods.
+ _Uint64Array _createList(int length) {
+ return _new(length);
+ }
+
static _Uint64Array _new(int length) native "TypedData_Uint64Array_new";
}
@@ -1067,6 +1104,10 @@
// Internal utility methods.
+ _Float32Array _createList(int length) {
+ return _new(length);
+ }
+
static _Float32Array _new(int length) native "TypedData_Float32Array_new";
}
@@ -1124,6 +1165,10 @@
// Internal utility methods.
+ _Float64Array _createList(int length) {
+ return _new(length);
+ }
+
static _Float64Array _new(int length) native "TypedData_Float64Array_new";
}
@@ -1171,6 +1216,10 @@
// Internal utility methods.
+ Int8List _createList(int length) {
+ return new Int8List(length);
+ }
+
static _ExternalInt8Array _new(int length) native
"ExternalTypedData_Int8Array_new";
}
@@ -1220,6 +1269,10 @@
// Internal utility methods.
+ Uint8List _createList(int length) {
+ return new Uint8List(length);
+ }
+
static _ExternalUint8Array _new(int length) native
"ExternalTypedData_Uint8Array_new";
}
@@ -1269,6 +1322,10 @@
// Internal utility methods.
+ Uint8ClampedList _createList(int length) {
+ return new Uint8ClampedList(length);
+ }
+
static _ExternalUint8ClampedArray _new(int length) native
"ExternalTypedData_Uint8ClampedArray_new";
}
@@ -1318,6 +1375,10 @@
// Internal utility methods.
+ Int16List _createList(int length) {
+ return new Int16List(length);
+ }
+
static _ExternalInt16Array _new(int length) native
"ExternalTypedData_Int16Array_new";
}
@@ -1367,6 +1428,10 @@
// Internal utility methods.
+ Uint16List _createList(int length) {
+ return new Uint16List(length);
+ }
+
static _ExternalUint16Array _new(int length) native
"ExternalTypedData_Uint16Array_new";
}
@@ -1416,6 +1481,10 @@
// Internal utility methods.
+ Int32List _createList(int length) {
+ return new Int32List(length);
+ }
+
static _ExternalInt32Array _new(int length) native
"ExternalTypedData_Int32Array_new";
}
@@ -1465,6 +1534,10 @@
// Internal utility methods.
+ Uint32List _createList(int length) {
+ return new Uint32List(length);
+ }
+
static _ExternalUint32Array _new(int length) native
"ExternalTypedData_Uint32Array_new";
}
@@ -1514,6 +1587,10 @@
// Internal utility methods.
+ Int64List _createList(int length) {
+ return new Int64List(length);
+ }
+
static _ExternalInt64Array _new(int length) native
"ExternalTypedData_Int64Array_new";
}
@@ -1556,6 +1633,10 @@
// Method(s) implementing the TypedData interface.
+ Uint64List _createList(int length) {
+ return new Uint64List(length);
+ }
+
int get elementSizeInBytes {
return Uint64List.BYTES_PER_ELEMENT;
}
@@ -1612,6 +1693,10 @@
// Internal utility methods.
+ Float32List _createList(int length) {
+ return new Float32List(length);
+ }
+
static _ExternalFloat32Array _new(int length) native
"ExternalTypedData_Float32Array_new";
}
@@ -1661,6 +1746,10 @@
// Internal utility methods.
+ Float64List _createList(int length) {
+ return new Float64List(length);
+ }
+
static _ExternalFloat64Array _new(int length) native
"ExternalTypedData_Float64Array_new";
}
@@ -1725,8 +1814,8 @@
((buffer.lengthInBytes - _offsetInBytes) ~/
Int8List.BYTES_PER_ELEMENT))) {
_rangeCheck(buffer.lengthInBytes,
- offsetInBytes,
- length * Int8List.BYTES_PER_ELEMENT);
+ _offsetInBytes,
+ _length * Int8List.BYTES_PER_ELEMENT);
}
@@ -1771,8 +1860,8 @@
((buffer.lengthInBytes - _offsetInBytes) ~/
Uint8List.BYTES_PER_ELEMENT))) {
_rangeCheck(buffer.lengthInBytes,
- offsetInBytes,
- length * Uint8List.BYTES_PER_ELEMENT);
+ _offsetInBytes,
+ _length * Uint8List.BYTES_PER_ELEMENT);
}
@@ -2397,4 +2486,5 @@
if (object == null) {
return value;
}
+ return object;
}
« no previous file with comments | « runtime/bin/io.dart ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698