1 Star 0 Fork 44

pengmeng/xorg-x11-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0015-xwayland-Reuse-viewport-instead-of-recreating.patch 2.10 KB
一键复制 编辑 原始数据 按行查看 历史
yangcheng1203 提交于 2021-12-27 15:04 . provide xwayland
From 1f39cb2ef51c72ec0c448c5d9571540bb0d9f3eb Mon Sep 17 00:00:00 2001
From: Roman Gilg <subdiff@gmail.com>
Date: Fri, 3 Jan 2020 17:12:14 +0100
Subject: [PATCH xserver 15/24] xwayland: Reuse viewport instead of recreating
When a viewport is already created we can reuse this object instead of
destroying it and getting a new one for updating the source rectangle and
destination size.
Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 948e02872feb641a176b3af82b6ef1201c97bb16)
---
hw/xwayland/xwayland.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index f4d433bca..320589dde 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -550,17 +550,13 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window,
struct xwl_output *xwl_output,
struct xwl_emulated_mode *emulated_mode)
{
- /* If necessary disable old viewport to apply new settings */
- if (xwl_window_has_viewport_enabled(xwl_window))
- xwl_window_disable_viewport(xwl_window);
-
- DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n",
- emulated_mode->width, emulated_mode->height,
- xwl_output->width, xwl_output->height);
-
- xwl_window->viewport =
- wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter,
- xwl_window->surface);
+ if (!xwl_window_has_viewport_enabled(xwl_window)) {
+ DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n",
+ emulated_mode->width, emulated_mode->height,
+ xwl_output->width, xwl_output->height);
+ xwl_window->viewport = wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter,
+ xwl_window->surface);
+ }
wp_viewport_set_source(xwl_window->viewport,
wl_fixed_from_int(0),
--
2.25.2
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pengmeng-123/xorg-x11-server.git
git@gitee.com:pengmeng-123/xorg-x11-server.git
pengmeng-123
xorg-x11-server
xorg-x11-server
master

搜索帮助