Skip to content

Commit

Permalink
Merge pull request #9766 from jepler/vectorio-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler authored Oct 29, 2024
2 parents 98cc153 + 589c7f6 commit 68fac95
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
13 changes: 13 additions & 0 deletions ports/unix/displayio_min.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,16 @@ const mp_obj_module_t displayio_module = {
};

MP_REGISTER_MODULE(MP_QSTR_displayio, displayio_module);

displayio_buffer_transform_t null_transform = {
.x = 0,
.y = 0,
.dx = 1,
.dy = 1,
.scale = 1,
.width = 0,
.height = 0,
.mirror_x = false,
.mirror_y = false,
.transpose_xy = false
};
12 changes: 12 additions & 0 deletions ports/unix/variants/coverage/mpconfigvariant.mk
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ SRC_BITMAP := \
shared-bindings/synthio/Synthesizer.c \
shared-bindings/traceback/__init__.c \
shared-bindings/util.c \
shared-bindings/vectorio/Circle.c \
shared-bindings/vectorio/__init__.c \
shared-bindings/vectorio/Polygon.c \
shared-bindings/vectorio/Rectangle.c \
shared-bindings/vectorio/VectorShape.c \
shared-bindings/zlib/__init__.c \
shared-module/aesio/aes.c \
shared-module/aesio/__init__.c \
Expand Down Expand Up @@ -88,6 +93,12 @@ SRC_BITMAP := \
shared-module/synthio/Note.c \
shared-module/synthio/Biquad.c \
shared-module/synthio/Synthesizer.c \
shared-bindings/vectorio/Circle.c \
shared-module/vectorio/Circle.c \
shared-module/vectorio/__init__.c \
shared-module/vectorio/Polygon.c \
shared-module/vectorio/Rectangle.c \
shared-module/vectorio/VectorShape.c \
shared-module/traceback/__init__.c \
shared-module/zlib/__init__.c \

Expand Down Expand Up @@ -134,6 +145,7 @@ CFLAGS += \
-DCIRCUITPY_SYNTHIO=1 \
-DCIRCUITPY_SYNTHIO_MAX_CHANNELS=14 \
-DCIRCUITPY_TRACEBACK=1 \
-DCIRCUITPY_VECTORIO=1 \
-DCIRCUITPY_ZLIB=1

# CIRCUITPY-CHANGE: test native base classes.
Expand Down
4 changes: 2 additions & 2 deletions shared-bindings/vectorio/Circle.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
static mp_obj_t vectorio_circle_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
enum { ARG_pixel_shader, ARG_radius, ARG_x, ARG_y, ARG_color_index };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED },
{ MP_QSTR_radius, MP_ARG_REQUIRED | MP_ARG_INT },
{ MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, { .u_obj = NULL } },
{ MP_QSTR_radius, MP_ARG_REQUIRED | MP_ARG_INT, { .u_obj = NULL } },
{ MP_QSTR_x, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
{ MP_QSTR_y, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
{ MP_QSTR_color_index, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/vectorio/Polygon.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
static mp_obj_t vectorio_polygon_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
enum { ARG_pixel_shader, ARG_points_list, ARG_x, ARG_y, ARG_color_index };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED },
{ MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, { .u_obj = NULL } },
{ MP_QSTR_points, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
{ MP_QSTR_x, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
{ MP_QSTR_y, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
Expand Down
6 changes: 3 additions & 3 deletions shared-bindings/vectorio/Rectangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
static mp_obj_t vectorio_rectangle_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
enum { ARG_pixel_shader, ARG_width, ARG_height, ARG_x, ARG_y, ARG_color_index };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED },
{ MP_QSTR_width, MP_ARG_REQUIRED | MP_ARG_INT },
{ MP_QSTR_height, MP_ARG_REQUIRED | MP_ARG_INT },
{ MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, {.u_obj = NULL } },
{ MP_QSTR_width, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0 } },
{ MP_QSTR_height, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0 } },
{ MP_QSTR_x, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
{ MP_QSTR_y, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
{ MP_QSTR_color_index, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
Expand Down

0 comments on commit 68fac95

Please sign in to comment.