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

Unified Diff: sky/engine/core/painting/Size.cpp

Issue 1214833004: Split Size into Size and Offset. (Closed) Base URL: https://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
« no previous file with comments | « sky/engine/core/painting/Size.h ('k') | sky/engine/core/painting/Size.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/painting/Size.cpp
diff --git a/sky/engine/core/painting/Point.cpp b/sky/engine/core/painting/Size.cpp
similarity index 51%
copy from sky/engine/core/painting/Point.cpp
copy to sky/engine/core/painting/Size.cpp
index e3baafff70d99efae2cdeab9ef87e231152b2a69..55a893abd9efad6926c94d5e3420f75da01d06b0 100644
--- a/sky/engine/core/painting/Point.cpp
+++ b/sky/engine/core/painting/Size.cpp
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sky/engine/core/painting/Point.h"
+#include "sky/engine/core/painting/Size.h"
#include "sky/engine/core/script/dom_dart_state.h"
#include "sky/engine/tonic/dart_error.h"
@@ -10,29 +10,26 @@
namespace blink {
-// Convert handle.x,y ==> SkPoint.
-Point DartConverter<Point>::FromDart(Dart_Handle handle) {
- Point result;
- result.is_null = true;
-
+// Convert handle.x,y ==> SkSize.
+Size DartConverter<Size>::FromDart(Dart_Handle handle) {
DCHECK(!LogIfError(handle));
-
- Dart_Handle x_value =
- Dart_GetField(handle, DOMDartState::Current()->x_handle());
- Dart_Handle y_value =
- Dart_GetField(handle, DOMDartState::Current()->y_handle());
-
- double x = 0.0, y = 0.0;
- Dart_Handle err = Dart_DoubleValue(x_value, &x);
+ Dart_Handle dx_value =
+ Dart_GetField(handle, DOMDartState::Current()->dx_handle());
+ Dart_Handle dy_value =
+ Dart_GetField(handle, DOMDartState::Current()->dy_handle());
+ double dx = 0.0, dy = 0.0;
+ Dart_Handle err = Dart_DoubleValue(dx_value, &dx);
DCHECK(!LogIfError(err));
- err = Dart_DoubleValue(y_value, &y);
+ err = Dart_DoubleValue(dy_value, &dy);
DCHECK(!LogIfError(err));
- result.sk_point.set(x, y);
+
+ Size result;
+ result.sk_size.set(dx, dy);
result.is_null = false;
return result;
}
-Point DartConverter<Point>::FromArgumentsWithNullCheck(
+Size DartConverter<Size>::FromArgumentsWithNullCheck(
Dart_NativeArguments args,
int index,
Dart_Handle& exception) {
« no previous file with comments | « sky/engine/core/painting/Size.h ('k') | sky/engine/core/painting/Size.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698