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

Side by Side Diff: runtime/lib/typed_data.dart

Issue 21145004: Add Float32x4List.fromList to runtime implementation and some tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/typed_data/typed_data.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // patch classes for Int8List ..... Float64List and ByteData implementations. 5 // patch classes for Int8List ..... Float64List and ByteData implementations.
6 6
7 patch class Int8List { 7 patch class Int8List {
8 /* patch */ factory Int8List(int length) { 8 /* patch */ factory Int8List(int length) {
9 return new _Int8Array(length); 9 return new _Int8Array(length);
10 } 10 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 [int offsetInBytes = 0, int length]) { 222 [int offsetInBytes = 0, int length]) {
223 return new _Float64ArrayView(buffer, offsetInBytes, length); 223 return new _Float64ArrayView(buffer, offsetInBytes, length);
224 } 224 }
225 } 225 }
226 226
227 patch class Float32x4List { 227 patch class Float32x4List {
228 /* patch */ factory Float32x4List(int length) { 228 /* patch */ factory Float32x4List(int length) {
229 return new _Float32x4Array(length); 229 return new _Float32x4Array(length);
230 } 230 }
231 231
232 /* patch */ factory Float32x4List.fromList(List<Float32x4> elements) {
233 var result = new _Float32x4Array(elements.length);
234 for (int i = 0; i < elements.length; i++) {
235 result[i] = elements[i];
236 }
237 return result;
238 }
239
232 /* patch */ factory Float32x4List.view(ByteBuffer buffer, 240 /* patch */ factory Float32x4List.view(ByteBuffer buffer,
233 [int offsetInBytes = 0, int length]) { 241 [int offsetInBytes = 0, int length]) {
234 return new _Float32x4ArrayView(buffer, offsetInBytes, length); 242 return new _Float32x4ArrayView(buffer, offsetInBytes, length);
235 } 243 }
236 } 244 }
237 245
238 246
239 patch class Float32x4 { 247 patch class Float32x4 {
240 /* patch */ factory Float32x4(double x, double y, double z, double w) { 248 /* patch */ factory Float32x4(double x, double y, double z, double w) {
241 return new _Float32x4(x, y, z, w); 249 return new _Float32x4(x, y, z, w);
(...skipping 3135 matching lines...) Expand 10 before | Expand all | Expand 10 after
3377 return value; 3385 return value;
3378 } 3386 }
3379 return object; 3387 return object;
3380 } 3388 }
3381 3389
3382 3390
3383 void _throwRangeError(int index, int length) { 3391 void _throwRangeError(int index, int length) {
3384 String message = "$index must be in the range [0..$length)"; 3392 String message = "$index must be in the range [0..$length)";
3385 throw new RangeError(message); 3393 throw new RangeError(message);
3386 } 3394 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/typed_data/typed_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698