| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "sky/engine/config.h" | 5 #include "sky/engine/config.h" |
| 6 #include "sky/engine/core/painting/Rect.h" | 6 #include "sky/engine/core/painting/Rect.h" |
| 7 | 7 |
| 8 #include "sky/engine/core/script/dom_dart_state.h" | 8 #include "sky/engine/core/script/dom_dart_state.h" |
| 9 #include "sky/engine/tonic/dart_error.h" | 9 #include "sky/engine/tonic/dart_error.h" |
| 10 #include "sky/engine/tonic/dart_value.h" | 10 #include "sky/engine/tonic/dart_value.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 // Convert dart_rect._value[0...3] ==> SkRect. | 15 // Convert dart_rect._value[0...3] ==> SkRect. |
| 16 Rect DartConverter<Rect, void>::FromArgumentsWithNullCheck( | 16 Rect DartConverter<Rect>::FromArgumentsWithNullCheck(Dart_NativeArguments args, |
| 17 Dart_NativeArguments args, | 17 int index, |
| 18 int index, | 18 Dart_Handle& exception) { |
| 19 Dart_Handle& exception) { | |
| 20 Rect result; | 19 Rect result; |
| 21 result.is_null = true; | 20 result.is_null = true; |
| 22 | 21 |
| 23 Dart_Handle dart_rect = Dart_GetNativeArgument(args, index); | 22 Dart_Handle dart_rect = Dart_GetNativeArgument(args, index); |
| 24 DCHECK(!LogIfError(dart_rect)); | 23 DCHECK(!LogIfError(dart_rect)); |
| 25 | 24 |
| 26 Dart_Handle value = | 25 Dart_Handle value = |
| 27 Dart_GetField(dart_rect, DOMDartState::Current()->value_handle()); | 26 Dart_GetField(dart_rect, DOMDartState::Current()->value_handle()); |
| 28 if (Dart_IsNull(value)) | 27 if (Dart_IsNull(value)) |
| 29 return result; | 28 return result; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 45 for (intptr_t i = 0; i < 4; ++i) | 44 for (intptr_t i = 0; i < 4; ++i) |
| 46 *dest[i] = data[i]; | 45 *dest[i] = data[i]; |
| 47 | 46 |
| 48 Dart_TypedDataReleaseData(value); | 47 Dart_TypedDataReleaseData(value); |
| 49 | 48 |
| 50 result.is_null = false; | 49 result.is_null = false; |
| 51 return result; | 50 return result; |
| 52 } | 51 } |
| 53 | 52 |
| 54 } // namespace blink | 53 } // namespace blink |
| OLD | NEW |