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

Unified Diff: sky/engine/bindings/scripts/dart_types.py

Issue 1159663003: Re-land "Add a Color class to dart:sky." (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: ink_well Created 5 years, 7 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 | « no previous file | sky/engine/core/core.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/bindings/scripts/dart_types.py
diff --git a/sky/engine/bindings/scripts/dart_types.py b/sky/engine/bindings/scripts/dart_types.py
index 7b8ac0f8eaa210ebdf5889441a153baf45858fad..765f3c5d64b8af8f736a8a23ffa7e0e625f22dc7 100644
--- a/sky/engine/bindings/scripts/dart_types.py
+++ b/sky/engine/bindings/scripts/dart_types.py
@@ -114,7 +114,9 @@ CPP_SPECIAL_CONVERSION_RULES = {
'boolean': 'bool',
'unrestricted double': 'double',
'unrestricted float': 'float',
- 'Rect': 'Rect', # Pass Rect by value, not pointer.
+ # Pass these by value, not pointer.
+ 'Rect': 'Rect',
+ 'Color': 'CanvasColor',
}
@@ -354,6 +356,7 @@ DART_TO_CPP_VALUE = {
# We should handle it automatically, but map to a String for now.
'StorageType': 'DartUtilities::dartToString(args, {index}, exception, {auto_scope})',
'Rect': 'DartConverter<{implemented_as}>::FromArguments{null_check}(args, {index}, exception)',
+ 'Color': 'DartConverter<CanvasColor>::FromArguments{null_check}(args, {index}, exception)',
}
@@ -618,6 +621,7 @@ DART_SET_RETURN_VALUE = {
# Typed arrays don't have special Dart* classes for Dart.
'ArrayBuffer': 'Dart_SetReturnValue(args, DartUtilities::arrayBufferToDart({cpp_value}))',
'TypedList': 'Dart_SetReturnValue(args, DartUtilities::arrayBufferViewToDart({cpp_value}))',
+ 'Color': 'DartConverter<CanvasColor>::SetReturnValue(args, {cpp_value})',
}
« no previous file with comments | « no previous file | sky/engine/core/core.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698