Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jringle/restructure c src #51

Merged
merged 24 commits into from
Oct 7, 2023

Conversation

ringlej
Copy link
Contributor

@ringlej ringlej commented Sep 30, 2023

This PR is on top of #31
and restructures the c_src as follows:

c_src/
├── device/
│   ├── cairo/
│   │   ├── cairo_ctx.h
│   │   ├── cairo_fb.c
│   │   ├── cairo_font_ops.c
│   │   ├── cairo_image_ops.c
│   │   └── cairo_script_ops.c
│   ├── device.h
│   └── nvg/
│       ├── bcm.c
│       ├── drm.c
│       ├── glfw.c
│       ├── gl_helpers.c
│       ├── nanovg/
│       │   ├── LICENSE.txt
│       │   ├── nanovg.c
│       │   ├── nanovg_gl.h
│       │   ├── nanovg_gl_utils.h
│       │   └── nanovg.h
│       ├── nvg_font_ops.c
│       ├── nvg_image_ops.c
│       └── nvg_script_ops.c
├── font/
│   ├── font.c
│   ├── font.h
│   ├── font_ops.h
│   ├── fontstash.h
│   └── stb_truetype.h
├── image/
│   ├── image.c
│   ├── image.h
│   ├── image_ops.h
│   └── stb_image.h
├── main.c
├── scenic/
│   ├── common.h
│   ├── comms.c
│   ├── comms.h
│   ├── scenic_ops.c
│   ├── scenic_ops.h
│   ├── scenic_types.h
│   ├── script.c
│   ├── script.h
│   ├── script_ops.c
│   ├── script_ops.h
│   ├── unix_comms.c
│   ├── unix_comms.h
│   ├── utils.c
│   └── utils.h
└── tommyds/

Implements:
* image_ops_create
* image_ops_update
* image_ops_delete
* font_ops_create (Using cairo w/ freetype2)
* script_ops_draw_line
* script_ops_draw_triangle
* script_ops_draw_quad
* script_ops_draw_rect
* script_ops_draw_rrect
* script_ops_draw_arc
* script_ops_draw_sector
* script_ops_draw_circle
* script_ops_draw_text
* script_ops_begin_path
* script_ops_close_path
* script_ops_fill_path
* script_ops_stroke_path
* script_ops_move_to
* script_ops_line_to
* script_ops_bezier_to
* script_ops_push_state
* script_ops_pop_state
* script_ops_transform
* script_ops_scale
* script_ops_rotate
* script_ops_translate
* script_ops_fill_color
* script_ops_fill_linear
* script_ops_fill_radial
* script_ops_fill_image
* script_ops_stroke_width
* script_ops_stroke_color
* script_ops_line_cap
* script_ops_line_join
* script_ops_miter_limit
* script_ops_font
* script_ops_font_size
* script_ops_text_align
* script_ops_text_base

Signed-off-by: Jon Ringle <[email protected]>
This matches what is done similarly in glnvg__allocTexture() in the nvg
code to generate ids to use for looking up image data. This change will
remove the 32-bit constraint that was previously done with cairo images
and allow cairo to build on 64-bit architecture.
This is useful to either run scenic_driver_local with:
 * gdbserver
 * valgrind

For example, you could now have in your config:
`debugger: "gdbserver :5555"`

which will wait for you to attach gdb with a remote target on port 5555 and
set breakpoints and step through code

valgrind is useful for debugging memory issues such as malloc/free, memory
overruns and memory leaks.
@ringlej ringlej force-pushed the jringle/restructure-c_src branch 2 times, most recently from d68c97a to 8eac561 Compare September 30, 2023 03:29
@ringlej ringlej mentioned this pull request Sep 30, 2023
Copy link
Contributor

@crertel crertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really like the new structure sir, good work!

c_src/
├── device/
│   ├── cairo/
│   │   ├── cairo_ctx.h
│   │   ├── cairo_fb.c
│   │   ├── cairo_font_ops.c
│   │   ├── cairo_image_ops.c
│   │   └── cairo_script_ops.c
│   ├── device.h
│   └── nvg/
│       ├── bcm.c
│       ├── drm.c
│       ├── glfw.c
│       ├── gl_helpers.c
│       ├── nanovg/
│       │   ├── LICENSE.txt
│       │   ├── nanovg.c
│       │   ├── nanovg_gl.h
│       │   ├── nanovg_gl_utils.h
│       │   └── nanovg.h
│       ├── nvg_font_ops.c
│       ├── nvg_image_ops.c
│       └── nvg_script_ops.c
├── font/
│   ├── font.c
│   ├── font.h
│   ├── font_ops.h
│   ├── fontstash.h
│   └── stb_truetype.h
├── image/
│   ├── image.c
│   ├── image.h
│   ├── image_ops.h
│   └── stb_image.h
├── main.c
├── scenic/
│   ├── common.h
│   ├── comms.c
│   ├── comms.h
│   ├── scenic_ops.c
│   ├── scenic_ops.h
│   ├── scenic_types.h
│   ├── script.c
│   ├── script.h
│   ├── script_ops.c
│   ├── script_ops.h
│   ├── unix_comms.c
│   ├── unix_comms.h
│   ├── utils.c
│   └── utils.h
└── tommyds/
@ringlej ringlej force-pushed the jringle/restructure-c_src branch from 8eac561 to 70286a8 Compare October 2, 2023 21:56
@crertel crertel merged commit 653bd98 into ScenicFramework:main Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants