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

Unified Diff: sky/engine/core/painting/Float32List.h

Issue 1155193004: Canvas.concat takes a 16-element Float32List instead of an array. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: . Created 5 years, 6 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
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_

Powered by Google App Engine
This is Rietveld 408576698