Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Graphic Ui
提交
ac944d22
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,发现更多精彩内容 >>
提交
ac944d22
编写于
3月 22, 2021
作者:
G
guyuanzhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix arm_math.h path err
Change-Id: Id52eba166bf66255868e38e8b5bc9d783387f5f2
上级
6320ae9a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
32 deletion
+32
-32
frameworks/draw/draw_utils.cpp
frameworks/draw/draw_utils.cpp
+32
-32
未找到文件。
frameworks/draw/draw_utils.cpp
浏览文件 @
ac944d22
...
...
@@ -32,7 +32,7 @@
#include "hals/gfx_engines.h"
#endif
#if
def _LITEOS
#if
ENABLE_ARM_MATH
#include "arm_math.h"
#endif
...
...
@@ -713,10 +713,10 @@ void DrawUtils::DrawTriangleAlphaBilinear(const TriangleScanInfo& in)
int32_t
w3
=
FO_MUL
(
decUMinus1
,
decV
);
int32_t
w4
=
FO_MUL
(
decU
,
decV
);
// parameters above are Q15 fixed-point number
#ifndef _LITEOS
const
int32_t
outA
=
p1
*
w1
+
p2
*
w2
+
p3
*
w3
+
p4
*
w4
;
#else
#if ENABLE_ARM_MATH
const
int32_t
outA
=
__SMUAD
(
p1
,
w1
)
+
__SMUAD
(
p2
,
w2
)
+
__SMUAD
(
p3
,
w3
)
+
__SMUAD
(
p4
,
w4
);
#else
const
int32_t
outA
=
p1
*
w1
+
p2
*
w2
+
p3
*
w3
+
p4
*
w4
;
#endif
Color32
result
;
result
.
full
=
Color
::
ColorTo32
(
in
.
color
);
...
...
@@ -758,12 +758,12 @@ void DrawUtils::DrawTriangleTrueColorBilinear565(const TriangleScanInfo& in)
int16_t
intU
=
FO_TO_INTEGER
(
u
);
int16_t
intV
=
FO_TO_INTEGER
(
v
);
if
((
u
>=
0
)
&&
(
intU
<
(
in
.
info
.
header
.
width
-
1
))
&&
(
v
>=
0
)
&&
(
intV
<
(
in
.
info
.
header
.
height
-
1
)))
{
#ifndef _LITEOS
uint32_t
px1
=
intV
*
in
.
srcLineWidth
+
intU
*
in
.
pixelSize
;
#else
#if ENABLE_ARM_MATH
uint32_t
val1
=
__SMUAD
(
intV
,
in
.
srcLineWidth
);
uint32_t
val2
=
__SMUAD
(
intU
,
in
.
pixelSize
);
uint32_t
px1
=
val1
+
val2
;
#else
uint32_t
px1
=
intV
*
in
.
srcLineWidth
+
intU
*
in
.
pixelSize
;
#endif
uint8_t
*
imgHead
=
const_cast
<
uint8_t
*>
(
in
.
info
.
data
);
const
Color16
p1
=
*
(
reinterpret_cast
<
Color16
*>
(
&
imgHead
[
px1
]));
...
...
@@ -781,17 +781,17 @@ void DrawUtils::DrawTriangleTrueColorBilinear565(const TriangleScanInfo& in)
int32_t
w3
=
FO_MUL
(
decUMinus1
,
decV
);
int32_t
w4
=
FO_MUL
(
decU
,
decV
);
// parameters above are Q15 fixed-point number
#ifndef _LITEOS
const
int32_t
outR
=
p1
.
red
*
w1
+
p2
.
red
*
w2
+
p3
.
red
*
w3
+
p4
.
red
*
w4
;
const
int32_t
outG
=
p1
.
green
*
w1
+
p2
.
green
*
w2
+
p3
.
green
*
w3
+
p4
.
green
*
w4
;
const
int32_t
outB
=
p1
.
blue
*
w1
+
p2
.
blue
*
w2
+
p3
.
blue
*
w3
+
p4
.
blue
*
w4
;
#else
#if ENABLE_ARM_MATH
const
int32_t
outR
=
__SMUAD
(
p1
.
red
,
w1
)
+
__SMUAD
(
p2
.
red
,
w2
)
+
__SMUAD
(
p3
.
red
,
w3
)
+
__SMUAD
(
p4
.
red
,
w4
);
const
int32_t
outG
=
__SMUAD
(
p1
.
green
,
w1
)
+
__SMUAD
(
p2
.
green
,
w2
)
+
__SMUAD
(
p3
.
green
,
w3
)
+
__SMUAD
(
p4
.
green
,
w4
);
const
int32_t
outB
=
__SMUAD
(
p1
.
blue
,
w1
)
+
__SMUAD
(
p2
.
blue
,
w2
)
+
__SMUAD
(
p3
.
blue
,
w3
)
+
__SMUAD
(
p4
.
blue
,
w4
);
#else
const
int32_t
outR
=
p1
.
red
*
w1
+
p2
.
red
*
w2
+
p3
.
red
*
w3
+
p4
.
red
*
w4
;
const
int32_t
outG
=
p1
.
green
*
w1
+
p2
.
green
*
w2
+
p3
.
green
*
w3
+
p4
.
green
*
w4
;
const
int32_t
outB
=
p1
.
blue
*
w1
+
p2
.
blue
*
w2
+
p3
.
blue
*
w3
+
p4
.
blue
*
w4
;
#endif
Color16
result
;
...
...
@@ -839,12 +839,12 @@ void DrawUtils::DrawTriangleTrueColorBilinear888(const TriangleScanInfo& in)
int16_t
intU
=
FO_TO_INTEGER
(
u
);
int16_t
intV
=
FO_TO_INTEGER
(
v
);
if
((
u
>=
0
)
&&
(
intU
<
in
.
info
.
header
.
width
-
1
)
&&
(
v
>=
0
)
&&
(
intV
<
in
.
info
.
header
.
height
-
1
))
{
#ifndef _LITEOS
uint32_t
px1
=
intV
*
in
.
srcLineWidth
+
intU
*
in
.
pixelSize
;
#else
#if ENABLE_ARM_MATH
uint32_t
val1
=
__SMUAD
(
intV
,
in
.
srcLineWidth
);
uint32_t
val2
=
__SMUAD
(
intU
,
in
.
pixelSize
);
uint32_t
px1
=
val1
+
val2
;
#else
uint32_t
px1
=
intV
*
in
.
srcLineWidth
+
intU
*
in
.
pixelSize
;
#endif
uint8_t
*
imgHead
=
const_cast
<
uint8_t
*>
(
in
.
info
.
data
);
const
Color24
p1
=
*
(
reinterpret_cast
<
Color24
*>
(
&
imgHead
[
px1
]));
...
...
@@ -862,17 +862,17 @@ void DrawUtils::DrawTriangleTrueColorBilinear888(const TriangleScanInfo& in)
int32_t
w3
=
FO_MUL
(
decUMinus1
,
decV
);
int32_t
w4
=
FO_MUL
(
decU
,
decV
);
// parameters above are Q15 fixed-point number
#ifndef _LITEOS
const
int32_t
outR
=
p1
.
red
*
w1
+
p2
.
red
*
w2
+
p3
.
red
*
w3
+
p4
.
red
*
w4
;
const
int32_t
outG
=
p1
.
green
*
w1
+
p2
.
green
*
w2
+
p3
.
green
*
w3
+
p4
.
green
*
w4
;
const
int32_t
outB
=
p1
.
blue
*
w1
+
p2
.
blue
*
w2
+
p3
.
blue
*
w3
+
p4
.
blue
*
w4
;
#else
#if ENABLE_ARM_MATH
const
int32_t
outR
=
__SMUAD
(
p1
.
red
,
w1
)
+
__SMUAD
(
p2
.
red
,
w2
)
+
__SMUAD
(
p3
.
red
,
w3
)
+
__SMUAD
(
p4
.
red
,
w4
);
const
int32_t
outG
=
__SMUAD
(
p1
.
green
,
w1
)
+
__SMUAD
(
p2
.
green
,
w2
)
+
__SMUAD
(
p3
.
green
,
w3
)
+
__SMUAD
(
p4
.
green
,
w4
);
const
int32_t
outB
=
__SMUAD
(
p1
.
blue
,
w1
)
+
__SMUAD
(
p2
.
blue
,
w2
)
+
__SMUAD
(
p3
.
blue
,
w3
)
+
__SMUAD
(
p4
.
blue
,
w4
);
#else
const
int32_t
outR
=
p1
.
red
*
w1
+
p2
.
red
*
w2
+
p3
.
red
*
w3
+
p4
.
red
*
w4
;
const
int32_t
outG
=
p1
.
green
*
w1
+
p2
.
green
*
w2
+
p3
.
green
*
w3
+
p4
.
green
*
w4
;
const
int32_t
outB
=
p1
.
blue
*
w1
+
p2
.
blue
*
w2
+
p3
.
blue
*
w3
+
p4
.
blue
*
w4
;
#endif
Color24
result
;
...
...
@@ -911,12 +911,12 @@ static void DrawTriangleTrueColorBilinear8888Inner(const TriangleScanInfo& in,
int16_t
intU
=
FO_TO_INTEGER
(
u
);
int16_t
intV
=
FO_TO_INTEGER
(
v
);
if
((
u
>=
0
)
&&
(
intU
<
in
.
info
.
header
.
width
-
1
)
&&
(
v
>=
0
)
&&
(
intV
<
in
.
info
.
header
.
height
-
1
))
{
#ifndef _LITEOS
uint32_t
px1
=
intV
*
in
.
srcLineWidth
+
intU
*
in
.
pixelSize
;
#else
#if ENABLE_ARM_MATH
uint32_t
val1
=
__SMUAD
(
intV
,
in
.
srcLineWidth
);
uint32_t
val2
=
__SMUAD
(
intU
,
in
.
pixelSize
);
uint32_t
px1
=
val1
+
val2
;
#else
uint32_t
px1
=
intV
*
in
.
srcLineWidth
+
intU
*
in
.
pixelSize
;
#endif
uint8_t
*
imgHead
=
const_cast
<
uint8_t
*>
(
in
.
info
.
data
);
const
ColorType
p1
=
*
(
reinterpret_cast
<
ColorType
*>
(
&
imgHead
[
px1
]));
...
...
@@ -935,12 +935,7 @@ static void DrawTriangleTrueColorBilinear8888Inner(const TriangleScanInfo& in,
int32_t
w4
=
FO_MUL
(
decU
,
decV
);
// parameters above are Q15 fixed-point number
#ifndef _LITEOS
const
int32_t
outR
=
p1
.
red
*
w1
+
p2
.
red
*
w2
+
p3
.
red
*
w3
+
p4
.
red
*
w4
;
const
int32_t
outG
=
p1
.
green
*
w1
+
p2
.
green
*
w2
+
p3
.
green
*
w3
+
p4
.
green
*
w4
;
const
int32_t
outB
=
p1
.
blue
*
w1
+
p2
.
blue
*
w2
+
p3
.
blue
*
w3
+
p4
.
blue
*
w4
;
const
int32_t
outA
=
p1
.
alpha
*
w1
+
p2
.
alpha
*
w2
+
p3
.
alpha
*
w3
+
p4
.
alpha
*
w4
;
#else
#if ENABLE_ARM_MATH
const
int32_t
outR
=
__SMUAD
(
p1
.
red
,
w1
)
+
__SMUAD
(
p2
.
red
,
w2
)
+
__SMUAD
(
p3
.
red
,
w3
)
+
__SMUAD
(
p4
.
red
,
w4
);
const
int32_t
outG
=
__SMUAD
(
p1
.
green
,
w1
)
+
__SMUAD
(
p2
.
green
,
w2
)
+
__SMUAD
(
p3
.
green
,
w3
)
+
__SMUAD
(
p4
.
green
,
w4
);
...
...
@@ -948,6 +943,11 @@ static void DrawTriangleTrueColorBilinear8888Inner(const TriangleScanInfo& in,
__SMUAD
(
p1
.
blue
,
w1
)
+
__SMUAD
(
p2
.
blue
,
w2
)
+
__SMUAD
(
p3
.
blue
,
w3
)
+
__SMUAD
(
p4
.
blue
,
w4
);
const
int32_t
outA
=
__SMUAD
(
p1
.
alpha
,
w1
)
+
__SMUAD
(
p2
.
alpha
,
w2
)
+
__SMUAD
(
p3
.
alpha
,
w3
)
+
__SMUAD
(
p4
.
alpha
,
w4
);
#else
const
int32_t
outR
=
p1
.
red
*
w1
+
p2
.
red
*
w2
+
p3
.
red
*
w3
+
p4
.
red
*
w4
;
const
int32_t
outG
=
p1
.
green
*
w1
+
p2
.
green
*
w2
+
p3
.
green
*
w3
+
p4
.
green
*
w4
;
const
int32_t
outB
=
p1
.
blue
*
w1
+
p2
.
blue
*
w2
+
p3
.
blue
*
w3
+
p4
.
blue
*
w4
;
const
int32_t
outA
=
p1
.
alpha
*
w1
+
p2
.
alpha
*
w2
+
p3
.
alpha
*
w3
+
p4
.
alpha
*
w4
;
#endif
Color32
result
;
...
...
@@ -1165,12 +1165,12 @@ void DrawUtils::DrawTriangleTrueColorNearest(const TriangleScanInfo& in)
int16_t
intU
=
FO_TO_INTEGER
(
u
);
int16_t
intV
=
FO_TO_INTEGER
(
v
);
if
((
u
>=
0
)
&&
(
intU
<
(
in
.
info
.
header
.
width
-
1
))
&&
(
v
>=
0
)
&&
(
intV
<
(
in
.
info
.
header
.
height
-
1
)))
{
#ifndef _LITEOS
uint32_t
px1
=
intV
*
in
.
srcLineWidth
+
intU
*
in
.
pixelSize
;
#else
#if ENABLE_ARM_MATH
uint32_t
val1
=
__SMUAD
(
intV
,
in
.
srcLineWidth
);
uint32_t
val2
=
__SMUAD
(
intU
,
in
.
pixelSize
);
uint32_t
px1
=
val1
+
val2
;
#else
uint32_t
px1
=
intV
*
in
.
srcLineWidth
+
intU
*
in
.
pixelSize
;
#endif
uint8_t
*
imgHead
=
const_cast
<
uint8_t
*>
(
in
.
info
.
data
);
OpacityType
opa
=
in
.
opaScale
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录