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

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

Issue 1162393002: Simplify TransferMode and Color types. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: format 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/painting/CanvasColor.h » ('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 bca2267ad3f95dfac045a0cc7998c8a56710fc23..dde7436e6110f3bd26fa5d4eb390c3f31ea12e65 100644
--- a/sky/engine/bindings/scripts/dart_types.py
+++ b/sky/engine/bindings/scripts/dart_types.py
@@ -115,10 +115,10 @@ CPP_SPECIAL_CONVERSION_RULES = {
'unrestricted double': 'double',
'unrestricted float': 'float',
# Pass these by value, not pointer.
- 'Color': 'CanvasColor',
+ 'Color': 'SkColor',
'Point': 'Point',
'Rect': 'Rect',
- 'TransferMode': 'TransferMode',
+ 'TransferMode': 'SkXfermode::Mode',
}
@@ -322,7 +322,8 @@ def set_component_dirs(new_component_dirs):
# TODO(terry): Need to fix to handle getter/setters for onEvent.
DART_FIX_ME = 'DART_UNIMPLEMENTED(/* Conversion unimplemented*/);'
-PASS_BY_VALUE_FORMAT = 'DartConverter<{implemented_as}>::FromArguments{null_check}(args, {index}, exception)'
+def pass_by_value_format(typename):
+ return 'DartConverter<%s>::FromArguments{null_check}(args, {index}, exception)' % typename
# For a given IDL type, the DartHandle to C++ conversion.
DART_TO_CPP_VALUE = {
@@ -361,10 +362,10 @@ DART_TO_CPP_VALUE = {
'StorageType': 'DartUtilities::dartToString(args, {index}, exception, {auto_scope})',
# Pass-by-value types.
- 'Color': PASS_BY_VALUE_FORMAT,
- 'Point': PASS_BY_VALUE_FORMAT,
- 'Rect': PASS_BY_VALUE_FORMAT,
- 'TransferMode': PASS_BY_VALUE_FORMAT,
+ 'Color': pass_by_value_format('CanvasColor'),
+ 'Point': pass_by_value_format('{implemented_as}'),
+ 'Rect': pass_by_value_format('{implemented_as}'),
+ 'TransferMode': pass_by_value_format('TransferMode'),
}
« no previous file with comments | « no previous file | sky/engine/core/painting/CanvasColor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698