mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 09:43:57 +00:00
80621fed03
Change-Id: I44047a9d7907d166a6360397d0047ce9b835e5c7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166854 Auto-Submit: Jonas Termansen <sortie@google.com> Reviewed-by: Leaf Petersen <leafp@google.com> Commit-Queue: Leaf Petersen <leafp@google.com>
36 lines
1,000 B
Dart
36 lines
1,000 B
Dart
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
/// A Dart implementation of two computation kernels used for skeletal
|
|
/// animation.
|
|
|
|
// @dart=2.9
|
|
|
|
import 'dart:typed_data';
|
|
|
|
import 'package:benchmark_harness/benchmark_harness.dart';
|
|
import 'package:vector_math/vector_math_operations.dart';
|
|
|
|
void main() {
|
|
SkeletalAnimation().report();
|
|
}
|
|
|
|
class SkeletalAnimation extends BenchmarkBase {
|
|
SkeletalAnimation() : super('SkeletalAnimation');
|
|
|
|
final Float32List A = Float32List(16);
|
|
final Float32List B = Float32List(16);
|
|
final Float32List C = Float32List(16);
|
|
final Float32List D = Float32List(4);
|
|
final Float32List E = Float32List(4);
|
|
|
|
@override
|
|
void run() {
|
|
for (int i = 0; i < 100; i++) {
|
|
Matrix44Operations.multiply(C, 0, A, 0, B, 0);
|
|
Matrix44Operations.transform4(E, 0, A, 0, D, 0);
|
|
}
|
|
}
|
|
}
|