Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SKY_ENGINE_CORE_PAINTING_FLOAT32LIST_H_ | |
| 6 #define SKY_ENGINE_CORE_PAINTING_FLOAT32LIST_H_ | |
| 7 | |
| 8 #include "dart/runtime/include/dart_api.h" | |
| 9 #include "sky/engine/tonic/dart_converter.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 // A simple wrapper around a Dart Float32List. It uses Dart_TypedDataAcquireData | |
| 14 // to obtain a raw pointer to the data, which is released when this object is | |
| 15 // destroyed. | |
| 16 // | |
| 17 // This is designed to be used with DartConverter only. | |
| 18 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.
| |
| 19 public: | |
| 20 float* data; | |
| 21 intptr_t num_elements; | |
| 22 | |
| 23 ~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.
| |
| 24 | |
| 25 void Init(Dart_Handle list); | |
| 26 | |
| 27 private: | |
| 28 Dart_Handle dart_handle_; | |
| 29 }; | |
| 30 | |
| 31 template <> | |
| 32 struct DartConverter<Float32List> { | |
| 33 static Float32List FromArgumentsWithNullCheck(Dart_NativeArguments args, | |
| 34 int index, | |
| 35 Dart_Handle& exception); | |
| 36 }; | |
| 37 | |
| 38 } // namespace blink | |
| 39 | |
| 40 #endif // SKY_ENGINE_CORE_PAINTING_FLOAT32LIST_H_ | |
| OLD | NEW |