Index: sky/engine/core/painting/Float32List.h |
diff --git a/sky/engine/core/painting/Float32List.h b/sky/engine/core/painting/Float32List.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..340df26b7e9473ccd6f401279af786729352603e |
--- /dev/null |
+++ b/sky/engine/core/painting/Float32List.h |
@@ -0,0 +1,40 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef SKY_ENGINE_CORE_PAINTING_FLOAT32LIST_H_ |
+#define SKY_ENGINE_CORE_PAINTING_FLOAT32LIST_H_ |
+ |
+#include "dart/runtime/include/dart_api.h" |
+#include "sky/engine/tonic/dart_converter.h" |
+ |
+namespace blink { |
+ |
+// A simple wrapper around a Dart Float32List. It uses Dart_TypedDataAcquireData |
+// to obtain a raw pointer to the data, which is released when this object is |
+// destroyed. |
+// |
+// This is designed to be used with DartConverter only. |
+class Float32List { |
abarth-chromium
2015/06/04 16:58:16
This class should be in //sky/engine/tonic. It's
Matt Perry
2015/06/04 17:22:44
Done.
|
+ public: |
+ float* data; |
+ intptr_t num_elements; |
+ |
+ ~Float32List(); |
abarth-chromium
2015/06/04 16:58:16
We should have a Float32List constructor that init
Matt Perry
2015/06/04 17:22:44
Done.
|
+ |
+ void Init(Dart_Handle list); |
+ |
+ private: |
+ Dart_Handle dart_handle_; |
+}; |
+ |
+template <> |
+struct DartConverter<Float32List> { |
+ static Float32List FromArgumentsWithNullCheck(Dart_NativeArguments args, |
+ int index, |
+ Dart_Handle& exception); |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // SKY_ENGINE_CORE_PAINTING_FLOAT32LIST_H_ |