Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Graphic Ui
提交
2e962594
G
Graphic Ui
项目概览
OpenHarmony
/
Graphic Ui
大约 1 年 前同步成功
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Graphic Ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2e962594
编写于
9月 16, 2021
作者:
O
openharmony_ci
提交者:
Gitee
9月 16, 2021
浏览文件
操作
浏览文件
下载
差异文件
!409 多线程模式下字体可能存在渲染花屏问题
Merge pull request !409 from wangtiantian/bug_bitmap_m
上级
5ca2796b
02ee0ff5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
17 deletion
+21
-17
frameworks/font/glyphs_manager.cpp
frameworks/font/glyphs_manager.cpp
+5
-2
frameworks/font/glyphs_manager.h
frameworks/font/glyphs_manager.h
+1
-1
frameworks/font/ui_font_bitmap.cpp
frameworks/font/ui_font_bitmap.cpp
+14
-13
interfaces/innerkits/font/ui_font_bitmap.h
interfaces/innerkits/font/ui_font_bitmap.h
+1
-1
未找到文件。
frameworks/font/glyphs_manager.cpp
浏览文件 @
2e962594
...
...
@@ -374,7 +374,7 @@ int16_t GlyphsManager::GetFontWidth(uint32_t unicode)
return
node
->
advance
;
}
int8_t
GlyphsManager
::
GetBitmap
(
uint32_t
unicode
,
uint8_t
*
bitmap
)
int8_t
GlyphsManager
::
GetBitmap
(
uint32_t
unicode
,
uint8_t
*
bitmap
,
GlyphNode
*
glyphNode
)
{
if
(
bitmap
==
nullptr
)
{
GRAPHIC_LOGE
(
"GlyphsManager::GetBitmap invalid parameter"
);
...
...
@@ -385,7 +385,10 @@ int8_t GlyphsManager::GetBitmap(uint32_t unicode, uint8_t* bitmap)
return
INVALID_RET_VALUE
;
}
const
GlyphNode
*
node
=
GetGlyphNode
(
unicode
);
const
GlyphNode
*
node
=
glyphNode
;
if
(
glyphNode
==
nullptr
)
{
node
=
GetGlyphNode
(
unicode
);
}
if
(
node
==
nullptr
)
{
GRAPHIC_LOGE
(
"GlyphsManager::GetBitmap node not found"
);
return
INVALID_RET_VALUE
;
...
...
frameworks/font/glyphs_manager.h
浏览文件 @
2e962594
...
...
@@ -41,7 +41,7 @@ public:
const
GlyphNode
*
GetGlyphNode
(
uint32_t
unicode
);
int8_t
GetBitmap
(
uint32_t
unicode
,
uint8_t
*
bitmap
);
int8_t
GetBitmap
(
uint32_t
unicode
,
uint8_t
*
bitmap
,
GlyphNode
*
glyphNode
=
nullptr
);
void
SetRamBuffer
(
uintptr_t
ramAddr
);
...
...
frameworks/font/ui_font_bitmap.cpp
浏览文件 @
2e962594
...
...
@@ -215,9 +215,9 @@ uint32_t UIFontBitmap::GetRamUsedLen(uint32_t textManagerRamUsed, uint32_t langF
return
dynamicFontRamUsed_
+
textManagerRamUsed
+
bitmapRamUsed_
+
langFontRamUsed
;
}
int8_t
UIFontBitmap
::
GetDynamicFontBitmap
(
uint32_t
unicode
,
uint8_t
*
bitmap
)
int8_t
UIFontBitmap
::
GetDynamicFontBitmap
(
uint32_t
unicode
,
uint8_t
*
bitmap
,
GlyphNode
*
glyphNode
)
{
return
dynamicFont_
.
GetBitmap
(
unicode
,
bitmap
);
return
dynamicFont_
.
GetBitmap
(
unicode
,
bitmap
,
glyphNode
);
}
uint8_t
*
UIFontBitmap
::
GetCacheBitmap
(
uint8_t
fontId
,
uint32_t
unicode
)
...
...
@@ -262,6 +262,9 @@ int16_t UIFontBitmap::GetDynamicFontWidth(uint32_t unicode, uint8_t fontId)
uint8_t
*
UIFontBitmap
::
SearchInFont
(
uint32_t
unicode
,
GlyphNode
&
glyphNode
,
uint8_t
fontId
)
{
if
(
bitmapCache_
==
nullptr
)
{
return
nullptr
;
}
if
(
!
UIFontAdaptor
::
IsSameTTFId
(
fontId
,
unicode
))
{
GRAPHIC_LOGE
(
"UIFontBitmap::GetWidthInFontId fontId and unicode not match"
);
return
nullptr
;
...
...
@@ -269,26 +272,24 @@ uint8_t* UIFontBitmap::SearchInFont(uint32_t unicode, GlyphNode& glyphNode, uint
if
(
fontId
!=
GetBaseFontId
())
{
SetCurrentFontId
(
fontId
);
}
if
(
bitmapCache_
==
nullptr
)
{
int8_t
ret
=
GetGlyphNode
(
unicode
,
glyphNode
);
while
((
ret
==
RET_VALUE_OK
)
&&
(
glyphNode
.
reserve
!=
fontId
))
{
SetCurrentFontId
(
fontId
);
ret
=
GetGlyphNode
(
unicode
,
glyphNode
);
}
if
(
ret
!=
RET_VALUE_OK
)
{
return
nullptr
;
}
uint8_t
*
bitmap
=
bitmapCache_
->
GetBitmap
(
GetBaseFontId
()
,
unicode
);
uint8_t
*
bitmap
=
bitmapCache_
->
GetBitmap
(
fontId
,
unicode
);
if
(
bitmap
!=
nullptr
)
{
GetGlyphNode
(
unicode
,
glyphNode
);
return
bitmap
;
}
int8_t
ret
=
GetGlyphNode
(
unicode
,
glyphNode
);
if
(
ret
!=
RET_VALUE_OK
)
{
return
nullptr
;
}
if
(
glyphNode
.
kernOff
<=
glyphNode
.
dataOff
)
{
return
nullptr
;
}
uint32_t
bitmapSize
=
glyphNode
.
kernOff
-
glyphNode
.
dataOff
;
bitmap
=
bitmapCache_
->
GetSpace
(
GetBaseFontId
()
,
unicode
,
bitmapSize
);
ret
=
dynamicFont_
.
GetBitmap
(
unicode
,
bitmap
);
bitmap
=
bitmapCache_
->
GetSpace
(
fontId
,
unicode
,
bitmapSize
);
ret
=
dynamicFont_
.
GetBitmap
(
unicode
,
bitmap
,
&
glyphNode
);
if
(
ret
==
RET_VALUE_OK
)
{
return
bitmap
;
}
...
...
interfaces/innerkits/font/ui_font_bitmap.h
浏览文件 @
2e962594
...
...
@@ -47,7 +47,7 @@ protected:
uint32_t
GetBitmapRamUsed
();
uint32_t
GetDynamicFontRamUsed
();
uint32_t
GetRamUsedLen
(
uint32_t
textManagerRamUsed
,
uint32_t
langFontRamUsed
);
int8_t
GetDynamicFontBitmap
(
uint32_t
unicode
,
uint8_t
*
bitmap
);
int8_t
GetDynamicFontBitmap
(
uint32_t
unicode
,
uint8_t
*
bitmap
,
GlyphNode
*
glyphNode
=
nullptr
);
uint8_t
*
GetCacheBitmap
(
uint8_t
fontId
,
uint32_t
unicode
);
uint8_t
*
GetCacheSpace
(
uint8_t
fontId
,
uint32_t
unicode
,
uint32_t
size
);
void
PutCacheSpace
(
uint8_t
*
addr
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录