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

Side by Side Diff: sky/engine/core/painting/Point.cpp

Issue 1158843002: Sky: Add a Point class. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: style revert 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/core/painting/Point.h ('k') | sky/engine/core/painting/Point.dart » ('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/core/painting/Point.h"
7
8 #include "sky/engine/tonic/dart_error.h"
9 #include "sky/engine/tonic/dart_state.h"
10 #include "base/logging.h"
11
12 namespace blink {
13
14 // Convert dartPoint.x,y ==> SkPoint.
15 Point DartConverter<Point, void>::FromArgumentsWithNullCheck(
16 Dart_NativeArguments args,
17 int index,
18 Dart_Handle& exception) {
19 Point result;
20 result.is_null = true;
21
22 Dart_Handle dartPoint = Dart_GetNativeArgument(args, index);
23 DCHECK(!LogIfError(dartPoint));
24
25 Dart_Handle xValue = Dart_GetField(dartPoint, Dart_NewStringFromCString("x"));
26 Dart_Handle yValue = Dart_GetField(dartPoint, Dart_NewStringFromCString("y"));
27
28 double x = 0.0, y = 0.0;
29 Dart_Handle err = Dart_DoubleValue(xValue, &x);
30 DCHECK(!LogIfError(err));
31 err = Dart_DoubleValue(xValue, &y);
32 DCHECK(!LogIfError(err));
33 result.sk_point.set(x, y);
34 result.is_null = false;
35 return result;
36 }
37
38 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/painting/Point.h ('k') | sky/engine/core/painting/Point.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698