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

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

Issue 1170963003: Sky: Add a DartConverterEnum and use that for all our enum needs. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: 360 no scope 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 | « 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 72558db91548f03e7bf81eb752786dc11e349bd4..11b7a92ef860e35e8f98598667f423762d3e7586 100644
--- a/sky/engine/bindings/scripts/dart_types.py
+++ b/sky/engine/bindings/scripts/dart_types.py
@@ -123,6 +123,7 @@ CPP_SPECIAL_CONVERSION_RULES = {
'Point': 'Point',
'Rect': 'Rect',
'MojoDataPipeConsumer': 'mojo::ScopedDataPipeConsumerHandle',
+ 'TileMode': 'SkShader::TileMode',
'TransferMode': 'SkXfermode::Mode',
'PaintingStyle': 'SkPaint::Style',
}
@@ -329,8 +330,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*/);'
-def pass_by_value_format(typename):
- return 'DartConverter<%s>::FromArguments{null_check}(args, {index}, exception)' % typename
+def pass_by_value_format(typename, null_check="{null_check}"):
+ return 'DartConverter<%s>::FromArguments%s(args, {index}, exception)' % (typename, null_check)
# For a given IDL type, the DartHandle to C++ conversion.
DART_TO_CPP_VALUE = {
@@ -373,8 +374,9 @@ DART_TO_CPP_VALUE = {
'Float32List': pass_by_value_format('Float32List'),
'Point': pass_by_value_format('Point'),
'Rect': pass_by_value_format('Rect'),
- 'TransferMode': pass_by_value_format('TransferMode'),
- 'PaintingStyle': pass_by_value_format('PaintingStyle'),
+ 'TileMode': pass_by_value_format('TileMode', ''),
+ 'TransferMode': pass_by_value_format('TransferMode', ''),
+ 'PaintingStyle': pass_by_value_format('PaintingStyle', ''),
'MojoDataPipeConsumer': pass_by_value_format('mojo::ScopedDataPipeConsumerHandle'),
}
« 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