当前位置:网站首页>[Wayland] Weston multi screen display
[Wayland] Weston multi screen display
2022-06-12 10:09:00 【Lindo】
Weston Multi screen display
- Weston Multi screen display is supported by default ( For example, front screen + Rear screen )

- output An object can be understood as a logical screen , about DRM, Its information is via drmModeGetResources Interface to get .
- View There are two members in the structure to Record output Information , A preservation output Object as primary output, One is used to record the current View According to the output Information .
struct weston_view {
// Omit
/* * The primary output for this view. * Used for picking the output for driving internal animations on the * view, inheriting the primary output for related views in shells, etc. */
struct weston_output *output;
/* * A more complete representation of all outputs this surface is * displayed on. */
uint32_t output_mask;
}
- weston_view_assign_output Function is responsible for view Distribute output object .
static void
weston_view_assign_output(struct weston_view *ev)
{
struct weston_compositor *ec = ev->surface->compositor;
struct weston_output *output, *new_output;
pixman_region32_t region;
uint32_t max, area, mask;
pixman_box32_t *e;
new_output = NULL;
max = 0;
mask = 0;
pixman_region32_init(®ion);
wl_list_for_each(output, &ec->output_list, link) {
if (output->destroying)
continue;
pixman_region32_intersect(®ion, &ev->transform.boundingbox,
&output->region);
e = pixman_region32_extents(®ion);
area = (e->x2 - e->x1) * (e->y2 - e->y1);
// Calculation mask
if (area > 0)
mask |= 1u << output->id;
// choice output
if (area >= max) {
new_output = output;
max = area;
}
}
pixman_region32_fini(®ion);
// Distribute output
ev->output = new_output;
// Record mask
ev->output_mask = mask;
weston_surface_assign_output(ev->surface);
}
- Process according to the above code , Select... For the largest display area output, As primary output. When there are two output( Two screens ) According to the information in the figure above ,mask The processing is as follows
- output0 Of id by 0, 1 Move left 0 position , obtain 1. Then with 0 do | operation . Final mask by 0001( Binary system )
- output1 Of id by 1,1 Move left 1 position , wait until 2. Then with 0001 do | function . Final mask by 0011( Binary system ).
- Empathy , If there are four output, that mask The value of is 1111( Binary system ).
- Processing of the composite part : About multi screen compositing , In fact, the single screen is mostly the same . Just a little more , To show output The judgment of the .
- weston_surface_schedule_repaint: Redraw operation ,surface commit and surface damage Will trigger this function .
/** * \param surface The surface to be repainted * * Marks the output(s) that the surface is shown on as needing to be * repainted. See weston_output_schedule_repaint(). */
WL_EXPORT void
weston_surface_schedule_repaint(struct weston_surface *surface)
{
struct weston_output *output;
wl_list_for_each(output, &surface->compositor->output_list, link)
// such as output->id by 0 output_mask by 0001
// Below Judge , Would pass . This triggers the selected output Conduct repaint
if (surface->output_mask & (1u << output->id))
weston_output_schedule_repaint(output);
}
边栏推荐
- 1268_FreeRTOS任务上下文切换的实现
- 在App内跳转微信,打开微信
- 001: what is a data lake?
- 1268_ Implementation of FreeRTOS task context switching
- MYSQL的最左匹配原則的原理講解
- [path of system analyst] Chapter 18 security analysis and design of double disk system
- Autojs learning notes 6:text (txt) Findone() will report an error when switching apps. Finally, solve the implementation effect and switch any app until the script finds the control with the specified
- 004:aws data Lake solution
- Theoretical explanation of hash table
- [cloud native | kubernetes] kubernetes networkpolicy
猜你喜欢

True north reading notes

Clickhouse column basic data type description

7-13 underground maze exploration (adjacency table)

First NFT platform in dfinity Ecology: impossible thoughts

哈希表的线性探测法代码实现

Research on autojs wechat: the control IP in wechat on different versions of wechat or simulators is different.

Implementation of fruit mall wholesale platform based on SSM
![[Wayland] Wayland agreement description](/img/7b/b2dc41fcd15447252f48d2b61e8d59.jpg)
[Wayland] Wayland agreement description

MySQL v Index and algorithm

Autojs learning notes 6:text (txt) Findone() will report an error when switching apps. Finally, solve the implementation effect and switch any app until the script finds the control with the specified
随机推荐
Essentials reading notes
markdown_ Picture side by side scheme
[cloud native] establishment of Eureka service registration
[926. flip the string to monotonic increment]
Overview of software definition storage (one article is enough)
Yarn scheduling
7-4 network red dot punch in strategy (DFS)
【926. 将字符串翻转到单调递增】
Clickhouse column basic data type description
Canal ha mode configuration
7-5 zhe zhe playing games
The white paper "protecting our digital heritage: DNA data storage" was released
Dazzle the "library" action - award solicitation from the golden warehouse of the National People's Congress - high availability failover and recovery of kingbasees cluster
哈希表的线性探测法代码实现
Autojs learning notes 6:text (txt) Findone() will report an error when switching apps. Finally, solve the implementation effect and switch any app until the script finds the control with the specified
JVM (IV) Class file structure (complete parsing of bytecode attached)
one
Enumerate all USB device codes
7-13 underground maze exploration (adjacency table)
JVM (V) Virtual machine class loading (parental delegation mechanism)