From ee2e96b7f78cb5025b7dd5619730fcb16cc20b4d Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Tue, 17 Aug 2021 14:25:02 +0900 Subject: [PATCH] add platuml files add class and sequence diagrams of pepper Change-Id: Ie31c045d8b9e5e4fe7f505832f8c40b616bc65b4 --- doc/plantuml/class-pepper-input.plantuml | 32 ++++++ doc/plantuml/class-pepper.plantuml | 121 +++++++++++++++++++++ doc/plantuml/sequence-idle_repaint.plantuml | 47 ++++++++ doc/plantuml/sequence-input-send.plantuml | 11 ++ doc/plantuml/sequence-input.plantuml | 64 +++++++++++ .../sequence-output_schedule_repaint.plantuml | 16 +++ doc/plantuml/sequence-shell-init.plantuml | 18 +++ doc/plantuml/sequence-surface-create.plantuml | 18 +++ doc/plantuml/sequence-surface-update.plantuml | 82 ++++++++++++++ doc/plantuml/sequence-view-create.plantuml | 35 ++++++ doc/plantuml/sequence-wl_surface_commit.plantuml | 72 ++++++++++++ 11 files changed, 516 insertions(+) create mode 100755 doc/plantuml/class-pepper-input.plantuml create mode 100755 doc/plantuml/class-pepper.plantuml create mode 100644 doc/plantuml/sequence-idle_repaint.plantuml create mode 100755 doc/plantuml/sequence-input-send.plantuml create mode 100755 doc/plantuml/sequence-input.plantuml create mode 100644 doc/plantuml/sequence-output_schedule_repaint.plantuml create mode 100755 doc/plantuml/sequence-shell-init.plantuml create mode 100755 doc/plantuml/sequence-surface-create.plantuml create mode 100755 doc/plantuml/sequence-surface-update.plantuml create mode 100755 doc/plantuml/sequence-view-create.plantuml create mode 100644 doc/plantuml/sequence-wl_surface_commit.plantuml diff --git a/doc/plantuml/class-pepper-input.plantuml b/doc/plantuml/class-pepper-input.plantuml new file mode 100755 index 0000000..b74732d --- /dev/null +++ b/doc/plantuml/class-pepper-input.plantuml @@ -0,0 +1,32 @@ +@startuml +class pepper_object_t +class pepper_compositor_t +class pepper_seat_t +class pepper_pointer_t +class pepper_keyboard_t +class pepper_touch_t +class pepper_input_device_t + +pepper_object_t <|-- pepper_compositor_t +pepper_object_t <|-- pepper_seat_t +pepper_object_t <|-- pepper_pointer_t +pepper_object_t <|-- pepper_keyboard_t +pepper_object_t <|-- pepper_touch_t +pepper_object_t <|-- pepper_input_device_t +pepper_input_device_t <|-- X11::pointer +pepper_input_device_t <|-- X11::key +pepper_input_device_t <|-- WAYLAND::pointer +pepper_input_device_t <|-- WAYLAND::key + +pepper_compositor_t "1"*--"*"pepper_seat_t +pepper_seat_t "1"*--"1" pepper_pointer_t +pepper_seat_t "1"*--"1" pepper_keyboard_t +pepper_seat_t "1"*--"1" pepper_touch_t +pepper_seat_t "1"*--"*" wl_resource::wl_seat +pepper_seat_t "1"*--"1" wl_global::wl_seat_interface +pepper_seat_t "1"*--"*" pepper_input_device_t + +pepper_pointer_t "1"*--"*" wl_resource::wl_pointer +pepper_keyboard_t "1"*--"*" wl_resource::wl_keyboard +pepper_touch_t "1"*--"*" wl_resource::wl_touch +@enduml \ No newline at end of file diff --git a/doc/plantuml/class-pepper.plantuml b/doc/plantuml/class-pepper.plantuml new file mode 100755 index 0000000..1d14606 --- /dev/null +++ b/doc/plantuml/class-pepper.plantuml @@ -0,0 +1,121 @@ +@startuml + +class pepper_object_t +class pepper_compositor_t +class pepper_output_t +class pepper_seat_t +class pepper_surface_t +class pepper_buffer_t +class pepper_view_t + +pepper_object_t <|-- pepper_compositor_t +pepper_object_t <|-- pepper_output_t +pepper_object_t <|-- pepper_seat_t +pepper_object_t <|-- pepper_surface_t +pepper_object_t <|-- pepper_buffer_t +pepper_object_t <|-- pepper_view_t + +pepper_compositor_t *-- pepper_seat_t +pepper_compositor_t *-- pepper_output_t + +class pepper_output_backend_t <> { + {abstract}destroy(void* output) + + {abstract}get_subpixel_order() + {abstract}get_maker_name() + {abstract}get_model_name() + {abstract}get_mode_count() + {abstract}get_mode() + {abstract}set_mode() + + {abstract}assign_planes() + {abstract}repaint() + {abstract}attach_surface() + -- listener-- + {abstract}add_destroy_listener() + {abstract}add_mode_change_listender() + {abstract}add_frame_listener() +} +pepper_output_t "1" *-- "1" pepper_output_backend_t + +class pepper_drm_output_backend +pepper_output_backend_t <|-- pepper_drm_output_backend : Implementation + +class pepper_fbdev_output_backend +pepper_output_backend_t <|-- pepper_fbdev_output_backend : Implementation + +class pepper_wayland_output_backend +pepper_output_backend_t <|-- pepper_wayland_output_backend : Implementation + +class pepper_x11_output_backend +pepper_output_backend_t <|-- pepper_x11_output_backend : Implementation + +class pepper_renderer_t <> { + pepper_compositor_t *compositor + pepper_render_target_t *target + + {abstract}destroy() + {abstract}attach_surface() + {abstract}flush_surface_damage() + {abstract}read_pixels() + {abstract}repaint_output() +} + +class pepper_pixman_renderer +pepper_renderer_t <|-- pepper_pixman_renderer + +class pepper_gl_renderer +pepper_renderer_t <|-- pepper_gl_renderer + +class pepper_render_target_t<> { + pepper_renderer_t *renderer + + {abstract}destroy() +} +pepper_renderer_t "1" -- "1" pepper_render_target_t + +class pepper_pixman_render_target +pepper_render_target_t <|-- pepper_pixman_render_target +pepper_drm_output_backend *-- pepper_pixman_render_target +pepper_fbdev_output_backend *-- pepper_pixman_render_target +pepper_wayland_output_backend *-- pepper_pixman_render_target +pepper_x11_output_backend *-- pepper_pixman_render_target + +class pepper_gl_render_target +pepper_render_target_t <|-- pepper_gl_render_target +pepper_drm_output_backend *-- pepper_gl_render_target +pepper_x11_output_backend *-- pepper_gl_render_target + +class pepper_plane_t { + pepper_output_t *output + pixman_region32_t damage_region + pixman_region32_t clip_region + + pepper_plane_create() + pepper_plane_add_damage_region() + pepper_plane_accumulate_damage() + pepper_plane_update() +} + +class pepper_drm #PaleGreen { + pepper_compositor_t *compositor + wl_list *output_list + pepper_renderer_t *pixman_renderer + pepper_renderer_t *gl_renderer + pepper_list_t plane_list + + pepper_drm_create() + pepper_drm_destroy() +} + +pepper_drm *-- pepper_compositor_t +pepper_drm *-- pepper_gl_renderer +pepper_drm *-- pepper_pixman_renderer + + +class pepper_drm_output #PaleGreen +pepper_drm "1" *-- "n" pepper_drm_output +pepper_drm_output *-- pepper_drm_output_backend +pepper_drm_output *-- pepper_plane_t + +@enduml \ No newline at end of file diff --git a/doc/plantuml/sequence-idle_repaint.plantuml b/doc/plantuml/sequence-idle_repaint.plantuml new file mode 100644 index 0000000..1761340 --- /dev/null +++ b/doc/plantuml/sequence-idle_repaint.plantuml @@ -0,0 +1,47 @@ +@startuml + +title idle_repaint + +activate output + + [->output : idle_repaint + output->output_backend : output->backend->start_repaint_loop + output<-output_backend : pepper_output_finish_frame + note right + output_backend should call pepper_output_finish_frame + endnote + + activate output + alt output->frame.scheduled == 1 + output->output : output_repaint + loop output->compositor->view_list + output->view : pepper_view_update + end loop + + output->output : pepper_list_init(output->view_list) + loop output->compositor->view_list + output->output : pepper_list_insert(output->view_list) + end loop + + output->output_backend : assign_planes + output->output : output_update_planes + output->output_backend : repaint + + output->output : output->frame.pending = 1 + output->output : output->frame.scheduled = 0 + + loop output->view_list + output->surface : pepper_surface_send_frame_callback_done(view->surface) + end loop + end alt + deactivate output + + activate surface + loop surface->frame_callback_list + surface->actor : wl_callback_send_done + end loop + deactivate surface + +deactivate output + +@enduml \ No newline at end of file diff --git a/doc/plantuml/sequence-input-send.plantuml b/doc/plantuml/sequence-input-send.plantuml new file mode 100755 index 0000000..8cb75fc --- /dev/null +++ b/doc/plantuml/sequence-input-send.plantuml @@ -0,0 +1,11 @@ +@startuml +actor client +participant compositor <> +participant pepper_seat +participant input_device <> +participant input_manager + +input_device <-] : Press_key +input_device ->] : emit PEPPER_EVENT_INPUT_DEVICE_KEYBOARD_KEY +pepper_seat <-] : call callback::PEPPER_EVENT_INPUT_DEVICE_KEYBOARD_KEY +@enduml diff --git a/doc/plantuml/sequence-input.plantuml b/doc/plantuml/sequence-input.plantuml new file mode 100755 index 0000000..0ada126 --- /dev/null +++ b/doc/plantuml/sequence-input.plantuml @@ -0,0 +1,64 @@ +@startuml +actor client +participant compositor <> +participant pepper_seat +participant input_device <> +participant input_manager + +create pepper_seat +compositor -> pepper_seat : pepper_compositor_add_seat(name) +pepper_seat -> compositor: add global for wl_seat +compositor ->] : send PEPPER_EVENT_COMPOSITOR_SEAT_ADD +compositor ->input_device : pepper_input_device_create +input_device -> input_device : initialize +input_device -> compositor : add input_device +compositor ->] :PEPPER_EVENT_COMPOSITOR_INPUT_DEVICE_ADD + +input_manager <-] :PEPPER_EVENT_COMPOSITOR_INPUT_DEVICE_ADD +input_manager -> pepper_seat : pepper_seat_add_input_device +pepper_seat -> pepper_seat : add input_device to list +pepper_seat -> pepper_seat : seat_update_caps(seat) +activate pepper_seat + alt new input caps + pepper_seat -> pepper_seat : seat_update_pointer_cap + activate pepper_seat + alt add new pointer + pepper_seat -> pepper_seat : init pepper_pointer + pepper_seat ->] : emit::PEPPER_EVENT_SEAT_POINTER_ADD + else + pepper_seat -> pepper_seat : fini pepper_pointer + pepper_seat ->] : emit::PEPPER_EVENT_SEAT_POINTER_REMOVE + end + + pepper_seat -> pepper_seat : update touch + pepper_seat -> pepper_seat : update keyboard + + loop wl_seat list + [<-pepper_seat: send wl_seat_send_capabilities + end + deactivate pepper_seat + end +deactivate pepper_seat +pepper_seat -> input_device : add Event Listener::PEPPER_EVENT_ALL +note right + PEPPER_EVENT_INPUT_DEVICE_POINTER_MOTION + PEPPER_EVENT_INPUT_DEVICE_POINTER_MOTION_ABSOLUTE, + PEPPER_EVENT_INPUT_DEVICE_POINTER_BUTTON, + PEPPER_EVENT_INPUT_DEVICE_POINTER_AXIS, + + PEPPER_EVENT_INPUT_DEVICE_KEYBOARD_KEY, + + PEPPER_EVENT_INPUT_DEVICE_TOUCH_DOWN, + PEPPER_EVENT_INPUT_DEVICE_TOUCH_UP, + PEPPER_EVENT_INPUT_DEVICE_TOUCH_MOTION, + PEPPER_EVENT_INPUT_DEVICE_TOUCH_FRAME, + PEPPER_EVENT_INPUT_DEVICE_TOUCH_CANCEL, +endnote +client <- compositor : registry::wl_seat +client -> pepper_seat : bind(wl_seat) +pepper_seat -> pepper_seat : create wl_resource for wl_seat +pepper_seat -> pepper_seat : add wl_resource to list + +client -> pepper_seat : wl_seat_get_pointer +pepper_seat -> pepper_seat : create wl_resource for wl_pointer +@enduml \ No newline at end of file diff --git a/doc/plantuml/sequence-output_schedule_repaint.plantuml b/doc/plantuml/sequence-output_schedule_repaint.plantuml new file mode 100644 index 0000000..732dca2 --- /dev/null +++ b/doc/plantuml/sequence-output_schedule_repaint.plantuml @@ -0,0 +1,16 @@ +@startuml + +title pepper_output_schedule_repaint + +activate output +->output : pepper_output_shedule_repaint +alt output->frame.scheduled == 1 + <-output +end +alt output->frame.pending == 1 + <-output +end +output->output : wl_event_loop_add_idle(idle_repaint); +deactivate output + +@enduml \ No newline at end of file diff --git a/doc/plantuml/sequence-shell-init.plantuml b/doc/plantuml/sequence-shell-init.plantuml new file mode 100755 index 0000000..a6e73cc --- /dev/null +++ b/doc/plantuml/sequence-shell-init.plantuml @@ -0,0 +1,18 @@ +@startuml + +actor user +create desktop_shell +user->desktop_shell : pepper_desktop_shell_init(compositor) +desktop_shell->desktop_shell : init wl_shell +desktop_shell->desktop_shell : init xdg_shell +desktop_shell->desktop_shell : init_listeners +activate desktop_shell + desktop_shell -> compositor: add event listener + note right + PEPPER_EVENT_COMPOSITOR_INPUT_DEVICE_ADD + PEPPER_EVENT_COMPOSITOR_SEAT_ADD + PEPPER_EVENT_COMPOSITOR_SEAT_REMOVE + endnote +deactivate desktop_shell + +@enduml \ No newline at end of file diff --git a/doc/plantuml/sequence-surface-create.plantuml b/doc/plantuml/sequence-surface-create.plantuml new file mode 100755 index 0000000..8cc3c8e --- /dev/null +++ b/doc/plantuml/sequence-surface-create.plantuml @@ -0,0 +1,18 @@ +@startuml +title Create surface +actor wl_client +wl_client -> compositor : wl_compositor_create_surface +create surface +compositor -> surface : pepper_surface_create +surface -> surface : create wl_surface resource +surface -> surface: initialize pepper_surface_t +note right + state, regions, frame_callback_list, view_list +end note +surface -> compositor : return new surface + +note left: need change +compositor -> compositor: add to surface_list +compositor -->]: emit PEPPER_EVENT_COMPOSITOR_SURFACE_ADD + +@enduml diff --git a/doc/plantuml/sequence-surface-update.plantuml b/doc/plantuml/sequence-surface-update.plantuml new file mode 100755 index 0000000..3ee7fe6 --- /dev/null +++ b/doc/plantuml/sequence-surface-update.plantuml @@ -0,0 +1,82 @@ +@startuml +title surface update + +actor user +user->user : update buffer +user->surface: wl_surface_attach(wl_buffer) +alt new buffer + create buffer + surface -> buffer: pepper_buffer_from_resoure(wl_buffer) +end +surface->surface : set to pending state, newly_attached:1 + +user->surface: wl_surface_damage +surface->surface : add to pending.damage_region +user->surface: wl_surface_commit + +surface->surface: pepper_surface_commit +activate surface +alt newly_attached==1 + alt buffer.buffer + surface->surface: buffer unreference(buffer) + surface->surface: event_listener_remove + end + alt pending.buffer + surface->buffer: refernece + surface->buffer: add destroy_listener::PEPPER_EVENT_OBJECT_DESTROY + end + surface->surface : Set buffer.buffer from pending.buffer + + surface->surface : attach_surface_to_outputs + activate surface + loop compositor::output_list + surface -> output: attach_surface(surface, &w, &h) + surface -> surface: set buffer.buffer w,h + end + deactivate surface +end + +surface->surface : Set buffer.transform,scale, frame_callback from pending +surface->surface : update_size +activate surface + note right + set w,h of surface from + buffer size, scale and transform + endnote +deactivate surface + +surface->surface : update damage_region +surface->surface : pepper_surface_flush_damage +activate surface + loop surface->view_list + surface->view : pepper_view_surface_damage + loop view->planes + view->plane: pepper_plane_add_damage_region + plane->plane: update damage_region + plane->output: pepper_output_schedule_repaint + output->output: add idle_repaint + note left + For screen update + endnote + end + end + + loop surface->compositor->output_list + surface->output : backend->flush_surface + end +deactivate surface +[<-surface : PEPPER_EVENT_SURFACE_COMMIT +deactivate surface + +[->shell_surface : PEPPER_EVENT_SURFACE_COMMIT +shell_surface -> shell_surface: Call surface_map function for type +note right + SHELL_SURFACE_TYPE_NONE, + SHELL_SURFACE_TYPE_TOPLEVEL, + SHELL_SURFACE_TYPE_TRANSIENT, + SHELL_SURFACE_TYPE_FULLSCREEN, + SHELL_SURFACE_TYPE_POPUP, + SHELL_SURFACE_TYPE_MAXIMIZED, + SHELL_SURFACE_TYPE_MINIMIZED, +endnote +@enduml \ No newline at end of file diff --git a/doc/plantuml/sequence-view-create.plantuml b/doc/plantuml/sequence-view-create.plantuml new file mode 100755 index 0000000..392bc69 --- /dev/null +++ b/doc/plantuml/sequence-view-create.plantuml @@ -0,0 +1,35 @@ +@startuml + +title wl_shell_surface create + +actor user +participant compositor<> +participant shell<> + +user->compositor:bind wl_shell +compositor->shell:bind_shell +shell->shell:shell_client_create +user->shell:wl_shell_get_shell_surface +shell->surface: pepper_surface_set_role() +create shell_surface +shell->shell_surface: shell_surface_create(surface) + +create view +shell_surface->view: create and add to compositor +shell_surface->surface:add_event_listener:PEPPER_EVENT_OBJECT_DESTROY +shell_surface->shell_surface +note right + set init values + type:SHELL_SURFACE_TYPE_NONE + child, parent +endnote +shell_surface->surface:add_event_listener:PEPPER_EVENT_SURFACE_COMMIT +shell_surface->shell_surface: Set send_configure callback by role +note left +role +wl_shell_surface +xdg_surface +xdg_popup +endnote + +@enduml diff --git a/doc/plantuml/sequence-wl_surface_commit.plantuml b/doc/plantuml/sequence-wl_surface_commit.plantuml new file mode 100644 index 0000000..add0323 --- /dev/null +++ b/doc/plantuml/sequence-wl_surface_commit.plantuml @@ -0,0 +1,72 @@ +@startuml +title wl_surface_commit + +actor user +user->surface: wl_surface_commit + +surface->surface: surface_commit +activate surface +surface->surface : pepper_subsurface_commit + +alt surface->pending.state->newly_attached == 1 + alt surface->buffer.buffer + surface->surface: unreference buffer + surface->surface: event_listener_remove + end + alt surface->pending.state->buffer + surface->buffer: reference buffer + surface->buffer: add destroy_listener::PEPPER_EVENT_OBJECT_DESTROY + end + surface->surface : Set buffer.buffer from pending.buffer + + surface->surface : attach_surface_to_outputs + activate surface + loop surface->compositor->output_list + surface -> output: attach_surface(surface, &w, &h) + surface -> surface: set buffer.buffer w,h + end loop + deactivate surface +end + +surface->surface : Set buffer.transform,scale, frame_callback from pending +surface->surface : update_size +activate surface + note right + set w,h of surface from + buffer size, scale and transform + endnote +deactivate surface + +surface->surface : update damage_region +surface->surface : pepper_surface_flush_damage +loop surface->view_list + surface->view : pepper_view_resize(view, surface->w, surface->h) + surface->view : pepper_view_mark_dirty + view->compositor : pepper_compositor_schedule_repaint + note right + schedule the update of + the compositor's outputs at idle time + endnote +end loop + +loop surface->compositor->output_list + surface->output : backend->flush_surface +end loop + +[<-surface : emit PEPPER_EVENT_SURFACE_COMMIT +deactivate surface + +[->shell_surface : signal PEPPER_EVENT_SURFACE_COMMIT +activate shell_surface + shell_surface -> shell_surface: Call surface_map function for type + note right + SHELL_SURFACE_TYPE_NONE, + SHELL_SURFACE_TYPE_TOPLEVEL, + SHELL_SURFACE_TYPE_TRANSIENT, + SHELL_SURFACE_TYPE_FULLSCREEN, + SHELL_SURFACE_TYPE_POPUP, + SHELL_SURFACE_TYPE_MAXIMIZED, + SHELL_SURFACE_TYPE_MINIMIZED, + endnote +deactivate shell_surface +@enduml \ No newline at end of file -- 2.7.4