当前位置:网站首页>[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);
}
边栏推荐
- 2021-09-15
- Explication du principe d'appariement le plus à gauche de MySQL
- C language recursive folder code
- HALCON联合C#检测表面缺陷——仿射变换(三)
- GNU EFI development environment settings
- UEFI edkii programming learning
- Strange error -- frame detected by contour detection, expansion corrosion, and reversal of opening and closing operation effect
- JVM (V) Virtual machine class loading (parental delegation mechanism)
- How high can C language reach by self-study alone?
- 【系统分析师之路】第十八章 复盘系统安全分析与设计
猜你喜欢
![[926. flip the string to monotonic increment]](/img/fa/1838405693aa0998694d4895a611c2.png)
[926. flip the string to monotonic increment]

UE4_ Explore the method of creating background scenes with ready-made resources

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

远程桌面不能复制粘贴解决办法

Redis (II) Memory mapped data structure

JVM (V) Virtual machine class loading (parental delegation mechanism)

Tp6 debugging (trace)
![[cloud native | kubernetes] kubernetes networkpolicy](/img/8b/9260fc39d3f595cdc2689a3ab26bd7.png)
[cloud native | kubernetes] kubernetes networkpolicy

markdown_图片并排的方案
![[preview of the open class of Jishu] arm's strongest MCU core cortex-m85 processor helps the innovation of the Internet of things in an all-round way (there is a lottery)](/img/25/c3af3f51c04865820e3bbe2f010098.png)
[preview of the open class of Jishu] arm's strongest MCU core cortex-m85 processor helps the innovation of the Internet of things in an all-round way (there is a lottery)
随机推荐
C 语言仅凭自学能到什么高度?
Halcon combined with C # to detect surface defects -- affine transformation (III)
2021-02-12
Auto. JS learning notes 8: some common and important APIs
How to implement Web3.0 and digital fashion?
【云原生 | Kubernetes篇】Kubernetes 网络策略(NetworkPolicy)
用于图像处理的高性能计算框架
Why is cross-border e-commerce so popular? Papaya mobile takes you to find out
机器学习之数据处理与可视化【鸢尾花数据分类|特征属性比较】
链式哈希表
Spark complex structure data retrieval method
哈希表的理论讲解
MySQL v Index and algorithm
《第五项修炼》读书笔记
First NFT platform in dfinity Ecology: impossible thoughts
np.meshgrid()函数 以及 三维空间中的坐标位置生成 以及 numpy.repeat()函数介绍
1268_FreeRTOS任务上下文切换的实现
2021-03-26
Pandorabox uses firewall rules to define non internet time
CLAHE in opencv for 16 bit image enhancement display