1 Star 0 Fork 25

zhangqiumiao/cairo

forked from src-openEuler/cairo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-tee-ft-dont-use-scaled_glyph-dev_private-to-store-data.patch 2.92 KB
一键复制 编辑 原始数据 按行查看 历史
zhangqiumiao 提交于 2023-07-21 17:05 . update to 1.17.8
From 10cc34f521cf272f881bbad9a6fc4e794cca8687 Mon Sep 17 00:00:00 2001
From: Adrian Johnson <ajohnson@redneon.com>
Date: Sat, 13 May 2023 18:51:40 +0930
Subject: [PATCH] ft: don't use scaled_glyph->dev_private to store data
It is also used by the xlib surface.
Fixes #778
Reference:https://gitlab.freedesktop.org/cairo/cairo/-/commit/10cc34f521cf272f881bbad9a6fc4e794cca8687
Conflict:NA
---
src/cairo-ft-font.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 834e4ba31..76c9e008f 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -2600,6 +2600,7 @@ _cairo_ft_scaled_glyph_set_foreground_color (cairo_ft_scaled_font_t *scaled_font
static cairo_int_status_t
_cairo_ft_scaled_glyph_init_surface (cairo_ft_scaled_font_t *scaled_font,
cairo_scaled_glyph_t *scaled_glyph,
+ cairo_ft_glyph_private_t *glyph_priv,
cairo_scaled_glyph_info_t info,
FT_Face face,
const cairo_color_t *foreground_color,
@@ -2611,7 +2612,6 @@ _cairo_ft_scaled_glyph_init_surface (cairo_ft_scaled_font_t *scaled_font,
cairo_status_t status;
cairo_image_surface_t *surface;
cairo_bool_t uses_foreground_color = FALSE;
- cairo_ft_glyph_private_t *glyph_priv = scaled_glyph->dev_private;
/* Only one info type at a time handled in this function */
assert (info == CAIRO_SCALED_GLYPH_INFO_COLOR_SURFACE || info == CAIRO_SCALED_GLYPH_INFO_SURFACE);
@@ -3302,7 +3302,6 @@ _cairo_ft_scaled_glyph_init_metrics (cairo_ft_scaled_font_t *scaled_font,
_cairo_scaled_glyph_attach_private (scaled_glyph, &glyph_priv->base,
&ft_glyph_private_key,
_cairo_ft_glyph_fini);
- scaled_glyph->dev_private = glyph_priv;
/* We need to load color to determine if this is a color format. */
int color_flag = 0;
@@ -3461,8 +3460,8 @@ _cairo_ft_scaled_glyph_init (void *abstract_font,
goto FAIL;
}
- /* scaled_glyph->dev_private is intialized by _cairo_ft_scaled_glyph_init_metrics() */
- glyph_priv = scaled_glyph->dev_private;
+ glyph_priv = (cairo_ft_glyph_private_t *) _cairo_scaled_glyph_find_private (scaled_glyph,
+ &ft_glyph_private_key);
assert (glyph_priv != NULL);
if (info & CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE) {
@@ -3514,6 +3513,7 @@ _cairo_ft_scaled_glyph_init (void *abstract_font,
} else {
status = _cairo_ft_scaled_glyph_init_surface (scaled_font,
scaled_glyph,
+ glyph_priv,
CAIRO_SCALED_GLYPH_INFO_COLOR_SURFACE,
face,
foreground_color,
@@ -3527,6 +3527,7 @@ _cairo_ft_scaled_glyph_init (void *abstract_font,
if (info & CAIRO_SCALED_GLYPH_INFO_SURFACE) {
status = _cairo_ft_scaled_glyph_init_surface (scaled_font,
scaled_glyph,
+ glyph_priv,
CAIRO_SCALED_GLYPH_INFO_SURFACE,
face,
NULL, /* foreground color */
--
GitLab
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangqiumiao/cairo.git
git@gitee.com:zhangqiumiao/cairo.git
zhangqiumiao
cairo
cairo
master

搜索帮助