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

Side by Side Diff: sky/engine/tonic/float32_list.cc

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: more fixes 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 unified diff | Download patch
« no previous file with comments | « sky/engine/tonic/float32_list.h ('k') | sky/examples/raw/painting.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #include "sky/engine/config.h"
6 #include "sky/engine/tonic/dart_error.h"
7 #include "sky/engine/tonic/float32_list.h"
8
9 namespace blink {
10
11 Float32List::Float32List(Dart_Handle list)
12 : data_(nullptr), num_elements_(0), dart_handle_(list) {
13 if (Dart_IsNull(list))
14 return;
15
16 Dart_TypedData_Type type;
17 Dart_TypedDataAcquireData(
18 list, &type, reinterpret_cast<void**>(&data_), &num_elements_);
19 DCHECK(!LogIfError(list));
20 ASSERT(type == Dart_TypedData_kFloat32);
21 }
22
23 Float32List::Float32List(Float32List&& other)
24 : data_(other.data_),
25 num_elements_(other.num_elements_),
26 dart_handle_(other.dart_handle_) {
27 other.data_ = nullptr;
28 other.dart_handle_ = nullptr;
29 }
30
31 Float32List::~Float32List() {
32 if (data_)
33 Dart_TypedDataReleaseData(dart_handle_);
34 }
35
36 Float32List DartConverter<Float32List>::FromArgumentsWithNullCheck(
37 Dart_NativeArguments args,
38 int index,
39 Dart_Handle& exception) {
40 Dart_Handle list = Dart_GetNativeArgument(args, index);
41 DCHECK(!LogIfError(list));
42
43 Float32List result(list);
44 return result;
45 }
46
47 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/tonic/float32_list.h ('k') | sky/examples/raw/painting.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698