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

cairo-gtk #52

Merged
merged 31 commits into from
Oct 7, 2023
Merged

cairo-gtk #52

merged 31 commits into from
Oct 7, 2023

Conversation

ringlej
Copy link
Contributor

@ringlej ringlej commented Sep 30, 2023

Add cairo-gtk that renders cairo to a window on a host

This is on top of #51 (which is on top of #31)

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.
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/cairo-gtk branch 5 times, most recently from 3ed372b to 92b10e5 Compare October 4, 2023 17:41
@ringlej ringlej force-pushed the jringle/cairo-gtk branch 7 times, most recently from 38d4fba to 47c6a3b Compare October 6, 2023 15:26
@ringlej ringlej changed the title WIP: cairo-gtk cairo-gtk Oct 6, 2023
@ringlej ringlej marked this pull request as ready for review October 6, 2023 15:28
@ringlej ringlej force-pushed the jringle/cairo-gtk branch from 47c6a3b to 3957f46 Compare October 6, 2023 15:31
@ringlej ringlej force-pushed the jringle/cairo-gtk branch from 3957f46 to e0a9e7b Compare October 6, 2023 21:10
@crertel crertel merged commit fa19761 into ScenicFramework:main Oct 7, 2023
1 check passed
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