Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Graphic Ui
提交
fb4f9f1f
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看板
提交
fb4f9f1f
编写于
5月 13, 2021
作者:
W
wangtiantian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
IssueNo:#I3R5CP
Description:fix codestyle Sig:graphic Feature or Bugfix:Bugfix Binary Source:No
上级
91376559
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
52 addition
and
79 deletion
+52
-79
frameworks/components/ui_canvas.cpp
frameworks/components/ui_canvas.cpp
+1
-1
frameworks/components/ui_chart.cpp
frameworks/components/ui_chart.cpp
+2
-4
frameworks/components/ui_checkbox.cpp
frameworks/components/ui_checkbox.cpp
+9
-3
frameworks/components/ui_toggle_button.cpp
frameworks/components/ui_toggle_button.cpp
+9
-14
frameworks/draw/draw_arc.cpp
frameworks/draw/draw_arc.cpp
+18
-14
frameworks/draw/draw_arc.h
frameworks/draw/draw_arc.h
+2
-1
frameworks/draw/draw_label.cpp
frameworks/draw/draw_label.cpp
+2
-2
frameworks/draw/draw_line.cpp
frameworks/draw/draw_line.cpp
+1
-1
frameworks/draw/draw_utils.cpp
frameworks/draw/draw_utils.cpp
+2
-2
interfaces/kits/font/ui_font_header.h
interfaces/kits/font/ui_font_header.h
+0
-33
test/uitest/test_view_scale_rotate/ui_test_view_scale_rotate.h
...uitest/test_view_scale_rotate/ui_test_view_scale_rotate.h
+2
-2
tools/qt/simulator/drivers/display/monitor.cpp
tools/qt/simulator/drivers/display/monitor.cpp
+2
-1
tools/qt/simulator/drivers/display/monitor.h
tools/qt/simulator/drivers/display/monitor.h
+2
-1
未找到文件。
frameworks/components/ui_canvas.cpp
浏览文件 @
fb4f9f1f
...
@@ -687,7 +687,7 @@ void UICanvas::DoDrawImage(BufferInfo& gfxDstBuffer,
...
@@ -687,7 +687,7 @@ void UICanvas::DoDrawImage(BufferInfo& gfxDstBuffer,
cordsTmp
.
SetPosition
(
start
.
x
,
start
.
y
);
cordsTmp
.
SetPosition
(
start
.
x
,
start
.
y
);
cordsTmp
.
SetHeight
(
imageParam
->
height
);
cordsTmp
.
SetHeight
(
imageParam
->
height
);
cordsTmp
.
SetWidth
(
imageParam
->
width
);
cordsTmp
.
SetWidth
(
imageParam
->
width
);
DrawImage
::
DrawCommon
(
gfxDstBuffer
,
cordsTmp
,
invalidatedArea
,
DrawImage
::
DrawCommon
(
gfxDstBuffer
,
cordsTmp
,
invalidatedArea
,
imageParam
->
image
->
GetPath
(),
style
,
paint
.
GetOpacity
());
imageParam
->
image
->
GetPath
(),
style
,
paint
.
GetOpacity
());
}
}
...
...
frameworks/components/ui_chart.cpp
浏览文件 @
fb4f9f1f
...
@@ -746,8 +746,7 @@ void UIChartPolyline::DrawGradientColor(BufferInfo& gfxDstBuffer,
...
@@ -746,8 +746,7 @@ void UIChartPolyline::DrawGradientColor(BufferInfo& gfxDstBuffer,
}
}
start
.
y
=
enableReverse_
?
(
start
.
y
-
startY
)
:
(
startY
-
start
.
y
);
start
.
y
=
enableReverse_
?
(
start
.
y
-
startY
)
:
(
startY
-
start
.
y
);
end
.
y
=
enableReverse_
?
(
end
.
y
-
startY
)
:
(
startY
-
end
.
y
);
end
.
y
=
enableReverse_
?
(
end
.
y
-
startY
)
:
(
startY
-
end
.
y
);
polyLine
.
start
=
start
;
polyLine
=
{
start
,
end
};
polyLine
.
end
=
end
;
FindCrossPoints
(
linePoints
,
polyLine
,
cross
);
FindCrossPoints
(
linePoints
,
polyLine
,
cross
);
if
(
cross
.
firstFind
&&
cross
.
secondFind
)
{
if
(
cross
.
firstFind
&&
cross
.
secondFind
)
{
cross
.
first
.
y
=
enableReverse_
?
(
cross
.
first
.
y
+
startY
)
:
(
startY
-
cross
.
first
.
y
);
cross
.
first
.
y
=
enableReverse_
?
(
cross
.
first
.
y
+
startY
)
:
(
startY
-
cross
.
first
.
y
);
...
@@ -760,8 +759,7 @@ void UIChartPolyline::DrawGradientColor(BufferInfo& gfxDstBuffer,
...
@@ -760,8 +759,7 @@ void UIChartPolyline::DrawGradientColor(BufferInfo& gfxDstBuffer,
}
}
if
(
cross
.
firstFind
&&
!
cross
.
secondFind
)
{
if
(
cross
.
firstFind
&&
!
cross
.
secondFind
)
{
cross
.
second
.
x
=
limitPoints
.
end
.
x
;
cross
.
second
=
{
limitPoints
.
end
.
x
,
y
};
cross
.
second
.
y
=
y
;
cross
.
first
.
y
=
y
;
cross
.
first
.
y
=
y
;
BaseGfxEngine
::
GetInstance
()
->
DrawLine
(
gfxDstBuffer
,
cross
.
first
,
cross
.
second
,
BaseGfxEngine
::
GetInstance
()
->
DrawLine
(
gfxDstBuffer
,
cross
.
first
,
cross
.
second
,
invalidatedArea
,
1
,
data
->
GetFillColor
(),
mixData_
[
mixScale
]);
invalidatedArea
,
1
,
data
->
GetFillColor
(),
mixData_
[
mixScale
]);
...
...
frameworks/components/ui_checkbox.cpp
浏览文件 @
fb4f9f1f
...
@@ -156,15 +156,21 @@ void UICheckBox::SelectedStateSoftwareDrawing(BufferInfo& gfxDstBuffer,
...
@@ -156,15 +156,21 @@ void UICheckBox::SelectedStateSoftwareDrawing(BufferInfo& gfxDstBuffer,
styleSelect
.
lineOpa_
=
backgroundOpacity_
;
styleSelect
.
lineOpa_
=
backgroundOpacity_
;
uint8_t
opa
=
DrawUtils
::
GetMixOpacity
(
opaScale_
,
backgroundOpacity_
);
uint8_t
opa
=
DrawUtils
::
GetMixOpacity
(
opaScale_
,
backgroundOpacity_
);
BaseGfxEngine
::
GetInstance
()
->
DrawArc
(
gfxDstBuffer
,
arcInfoLeft
,
trunc
,
styleSelect
,
opaScale_
,
CapType
::
CAP_NONE
);
BaseGfxEngine
::
GetInstance
()
->
DrawArc
(
gfxDstBuffer
,
arcInfoLeft
,
trunc
,
styleSelect
,
opaScale_
,
CapType
::
CAP_NONE
);
// 2 : double
BaseGfxEngine
::
GetInstance
()
->
DrawLine
(
gfxDstBuffer
,
start
,
mid
,
trunc
,
rectLineWidth
*
2
,
Color
::
White
(),
BaseGfxEngine
::
GetInstance
()
->
DrawLine
(
gfxDstBuffer
,
start
,
mid
,
trunc
,
rectLineWidth
*
2
,
Color
::
White
(),
opa
);
// 2 : double
opa
);
BaseGfxEngine
::
GetInstance
()
->
DrawArc
(
gfxDstBuffer
,
arcInfoMid
,
trunc
,
styleSelect
,
opaScale_
,
CapType
::
CAP_NONE
);
BaseGfxEngine
::
GetInstance
()
->
DrawArc
(
gfxDstBuffer
,
arcInfoMid
,
trunc
,
styleSelect
,
opaScale_
,
CapType
::
CAP_NONE
);
// 2 : double
BaseGfxEngine
::
GetInstance
()
->
DrawLine
(
gfxDstBuffer
,
mid
,
end
,
trunc
,
rectLineWidth
*
2
,
Color
::
White
(),
BaseGfxEngine
::
GetInstance
()
->
DrawLine
(
gfxDstBuffer
,
mid
,
end
,
trunc
,
rectLineWidth
*
2
,
Color
::
White
(),
opa
);
// 2 : double
opa
);
BaseGfxEngine
::
GetInstance
()
->
DrawArc
(
gfxDstBuffer
,
arcInfoRight
,
trunc
,
styleSelect
,
opaScale_
,
CapType
::
CAP_NONE
);
BaseGfxEngine
::
GetInstance
()
->
DrawArc
(
gfxDstBuffer
,
arcInfoRight
,
trunc
,
styleSelect
,
opaScale_
,
CapType
::
CAP_NONE
);
}
}
void
UICheckBox
::
UnSelectedStateSoftwareDrawing
(
BufferInfo
&
gfxDstBuffer
,
Rect
rect
,
Rect
trunc
,
int16_t
borderRadius
,
int16_t
rectLineWidth
)
void
UICheckBox
::
UnSelectedStateSoftwareDrawing
(
BufferInfo
&
gfxDstBuffer
,
Rect
rect
,
Rect
trunc
,
int16_t
borderRadius
,
int16_t
rectLineWidth
)
{
{
Rect
contentRect
=
GetContentRect
();
Rect
contentRect
=
GetContentRect
();
Style
styleUnSelect
=
StyleDefault
::
GetBackgroundTransparentStyle
();
Style
styleUnSelect
=
StyleDefault
::
GetBackgroundTransparentStyle
();
...
...
frameworks/components/ui_toggle_button.cpp
浏览文件 @
fb4f9f1f
...
@@ -69,15 +69,16 @@ void UIToggleButton::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedAre
...
@@ -69,15 +69,16 @@ void UIToggleButton::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedAre
rectMid
.
SetRect
(
x
,
y
,
x
+
rectWidth_
,
y
+
(
corner_
<<
1
)
+
1
);
rectMid
.
SetRect
(
x
,
y
,
x
+
rectWidth_
,
y
+
(
corner_
<<
1
)
+
1
);
Rect
trunc
=
invalidatedArea
;
Rect
trunc
=
invalidatedArea
;
bool
isIntersect
=
trunc
.
Intersect
(
trunc
,
contentRect
);
bool
isIntersect
=
trunc
.
Intersect
(
trunc
,
contentRect
);
if
(
isIntersect
==
false
)
{
return
;
}
switch
(
state_
)
{
switch
(
state_
)
{
case
SELECTED
:
{
case
SELECTED
:
{
Style
styleSelect
=
StyleDefault
::
GetBackgroundTransparentStyle
();
Style
styleSelect
=
StyleDefault
::
GetBackgroundTransparentStyle
();
styleSelect
.
borderRadius_
=
corner_
;
styleSelect
.
borderRadius_
=
corner_
;
styleSelect
.
bgColor_
=
Color
::
GetColorFromRGB
(
DEFAULT_BG_RED
,
DEFAULT_BG_GREEN
,
DEFAULT_BG_BLUE
);
styleSelect
.
bgColor_
=
Color
::
GetColorFromRGB
(
DEFAULT_BG_RED
,
DEFAULT_BG_GREEN
,
DEFAULT_BG_BLUE
);
styleSelect
.
bgOpa_
=
OPA_OPAQUE
;
styleSelect
.
bgOpa_
=
OPA_OPAQUE
;
if
(
isIntersect
)
{
BaseGfxEngine
::
GetInstance
()
->
DrawRect
(
gfxDstBuffer
,
rectMid
,
trunc
,
styleSelect
,
opaScale_
);
BaseGfxEngine
::
GetInstance
()
->
DrawRect
(
gfxDstBuffer
,
rectMid
,
trunc
,
styleSelect
,
opaScale_
);
}
ArcInfo
arcInfoRight
=
{
ArcInfo
arcInfoRight
=
{
{
static_cast
<
int16_t
>
(
x
+
rectWidth_
-
corner_
),
static_cast
<
int16_t
>
(
y
+
corner_
)
},
{
0
},
{
static_cast
<
int16_t
>
(
x
+
rectWidth_
-
corner_
),
static_cast
<
int16_t
>
(
y
+
corner_
)
},
{
0
},
radius_
,
0
,
CIRCLE_IN_DEGREE
,
nullptr
radius_
,
0
,
CIRCLE_IN_DEGREE
,
nullptr
...
@@ -85,10 +86,8 @@ void UIToggleButton::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedAre
...
@@ -85,10 +86,8 @@ void UIToggleButton::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedAre
styleSelect
.
bgColor_
=
Color
::
White
();
styleSelect
.
bgColor_
=
Color
::
White
();
styleSelect
.
lineWidth_
=
radius_
;
styleSelect
.
lineWidth_
=
radius_
;
styleSelect
.
lineColor_
=
Color
::
White
();
styleSelect
.
lineColor_
=
Color
::
White
();
if
(
isIntersect
)
{
BaseGfxEngine
::
GetInstance
()
->
DrawArc
(
gfxDstBuffer
,
arcInfoRight
,
trunc
,
BaseGfxEngine
::
GetInstance
()
->
DrawArc
(
gfxDstBuffer
,
arcInfoRight
,
trunc
,
styleSelect
,
OPA_OPAQUE
,
CapType
::
CAP_NONE
);
styleSelect
,
OPA_OPAQUE
,
CapType
::
CAP_NONE
);
}
break
;
break
;
}
}
case
UNSELECTED
:
{
case
UNSELECTED
:
{
...
@@ -96,19 +95,15 @@ void UIToggleButton::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedAre
...
@@ -96,19 +95,15 @@ void UIToggleButton::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedAre
styleUnSelect
.
bgColor_
=
Color
::
White
();
styleUnSelect
.
bgColor_
=
Color
::
White
();
styleUnSelect
.
bgOpa_
=
DEFAULT_UNSELECTED_OPA
;
styleUnSelect
.
bgOpa_
=
DEFAULT_UNSELECTED_OPA
;
styleUnSelect
.
borderRadius_
=
corner_
;
styleUnSelect
.
borderRadius_
=
corner_
;
if
(
isIntersect
)
{
BaseGfxEngine
::
GetInstance
()
->
DrawRect
(
gfxDstBuffer
,
rectMid
,
trunc
,
styleUnSelect
,
opaScale_
);
BaseGfxEngine
::
GetInstance
()
->
DrawRect
(
gfxDstBuffer
,
rectMid
,
trunc
,
styleUnSelect
,
opaScale_
);
}
ArcInfo
arcInfoLeft
=
{
ArcInfo
arcInfoLeft
=
{
{
static_cast
<
int16_t
>
(
x
+
corner_
),
static_cast
<
int16_t
>
(
y
+
corner_
)
},
{
0
},
radius_
,
0
,
{
static_cast
<
int16_t
>
(
x
+
corner_
),
static_cast
<
int16_t
>
(
y
+
corner_
)
},
{
0
},
radius_
,
0
,
CIRCLE_IN_DEGREE
,
nullptr
CIRCLE_IN_DEGREE
,
nullptr
};
};
styleUnSelect
.
lineColor_
=
Color
::
White
();
styleUnSelect
.
lineColor_
=
Color
::
White
();
styleUnSelect
.
lineWidth_
=
radius_
;
styleUnSelect
.
lineWidth_
=
radius_
;
if
(
isIntersect
)
{
BaseGfxEngine
::
GetInstance
()
->
DrawArc
(
gfxDstBuffer
,
arcInfoLeft
,
trunc
,
BaseGfxEngine
::
GetInstance
()
->
DrawArc
(
gfxDstBuffer
,
arcInfoLeft
,
trunc
,
styleUnSelect
,
OPA_OPAQUE
,
CapType
::
CAP_NONE
);
styleUnSelect
,
OPA_OPAQUE
,
CapType
::
CAP_NONE
);
}
break
;
break
;
}
}
default:
default:
...
...
frameworks/draw/draw_arc.cpp
浏览文件 @
fb4f9f1f
...
@@ -197,7 +197,11 @@ void DrawArc::DrawCircleNoEndpoint(BufferInfo& gfxDstBuffer,
...
@@ -197,7 +197,11 @@ void DrawArc::DrawCircleNoEndpoint(BufferInfo& gfxDstBuffer,
}
}
}
}
void
DrawArc
::
DrawAxisLine
(
BufferInfo
&
gfxDstBuffer
,
ArcInfo
&
arcInfo
,
const
Rect
&
mask
,
const
Style
&
style
,
uint8_t
opa
)
void
DrawArc
::
DrawAxisLine
(
BufferInfo
&
gfxDstBuffer
,
ArcInfo
&
arcInfo
,
const
Rect
&
mask
,
const
Style
&
style
,
uint8_t
opa
)
{
{
int16_t
lineWidth
=
0
;
int16_t
lineWidth
=
0
;
int16_t
outRadius
=
outRadius_
-
1
;
int16_t
outRadius
=
outRadius_
-
1
;
...
@@ -209,22 +213,22 @@ void DrawArc::DrawAxisLine(BufferInfo& gfxDstBuffer, ArcInfo& arcInfo, const Rec
...
@@ -209,22 +213,22 @@ void DrawArc::DrawAxisLine(BufferInfo& gfxDstBuffer, ArcInfo& arcInfo, const Rec
lineWidth
=
outRadius
-
inRadius
;
lineWidth
=
outRadius
-
inRadius
;
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
THREE_QUARTER_IN_DEGREE
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
THREE_QUARTER_IN_DEGREE
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
DrawHorLine
(
gfxDstBuffer
,
Point
{
static_cast
<
int16_t
>
(
arcInfo
.
center
.
x
-
outRadius
),
arcInfo
.
center
.
y
},
DrawHorLine
(
gfxDstBuffer
,
Point
{
static_cast
<
int16_t
>
(
arcInfo
.
center
.
x
-
outRadius
),
arcInfo
.
center
.
y
},
arcInfo
.
imgPos
,
mask
,
lineWidth
,
style
,
opa
,
arcInfo
.
imgSrc
);
arcInfo
.
imgPos
,
mask
,
lineWidth
,
style
,
opa
,
arcInfo
.
imgSrc
);
}
}
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
QUARTER_IN_DEGREE
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
QUARTER_IN_DEGREE
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
DrawHorLine
(
gfxDstBuffer
,
Point
{
static_cast
<
int16_t
>
(
arcInfo
.
center
.
x
+
inRadius
),
arcInfo
.
center
.
y
},
DrawHorLine
(
gfxDstBuffer
,
Point
{
static_cast
<
int16_t
>
(
arcInfo
.
center
.
x
+
inRadius
),
arcInfo
.
center
.
y
},
arcInfo
.
imgPos
,
mask
,
lineWidth
,
style
,
opa
,
arcInfo
.
imgSrc
);
arcInfo
.
imgPos
,
mask
,
lineWidth
,
style
,
opa
,
arcInfo
.
imgSrc
);
}
}
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
0
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
0
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
DrawVerLine
(
gfxDstBuffer
,
Point
{
arcInfo
.
center
.
x
,
static_cast
<
int16_t
>
(
arcInfo
.
center
.
y
-
outRadius
)
},
DrawVerLine
(
gfxDstBuffer
,
Point
{
arcInfo
.
center
.
x
,
static_cast
<
int16_t
>
(
arcInfo
.
center
.
y
-
outRadius
)
},
arcInfo
.
imgPos
,
mask
,
lineWidth
,
style
,
opa
,
arcInfo
.
imgSrc
);
arcInfo
.
imgPos
,
mask
,
lineWidth
,
style
,
opa
,
arcInfo
.
imgSrc
);
}
}
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
SEMICIRCLE_IN_DEGREE
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
SEMICIRCLE_IN_DEGREE
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
DrawVerLine
(
gfxDstBuffer
,
Point
{
arcInfo
.
center
.
x
,
static_cast
<
int16_t
>
(
arcInfo
.
center
.
y
+
inRadius
)
},
DrawVerLine
(
gfxDstBuffer
,
Point
{
arcInfo
.
center
.
x
,
static_cast
<
int16_t
>
(
arcInfo
.
center
.
y
+
inRadius
)
},
arcInfo
.
imgPos
,
mask
,
lineWidth
,
style
,
opa
,
arcInfo
.
imgSrc
);
arcInfo
.
imgPos
,
mask
,
lineWidth
,
style
,
opa
,
arcInfo
.
imgSrc
);
}
}
}
}
...
@@ -240,9 +244,9 @@ void DrawArc::DrawLineWithDegree(BufferInfo& gfxDstBuffer,
...
@@ -240,9 +244,9 @@ void DrawArc::DrawLineWithDegree(BufferInfo& gfxDstBuffer,
uint8_t
quadrant
)
uint8_t
quadrant
)
{
{
if
(
isCircle_
)
{
if
(
isCircle_
)
{
DrawHorLine
(
gfxDstBuffer
,
Point
{
static_cast
<
int16_t
>
(
arcInfo
.
center
.
x
+
start
),
DrawHorLine
(
gfxDstBuffer
,
static_cast
<
int16_t
>
(
arcInfo
.
center
.
y
+
y
)},
arcInfo
.
imgPos
,
Point
{
static_cast
<
int16_t
>
(
arcInfo
.
center
.
x
+
start
),
static_cast
<
int16_t
>
(
arcInfo
.
center
.
y
+
y
)}
,
mask
,
end
-
start
,
style
,
opaScale
,
arcInfo
.
imgSrc
);
arcInfo
.
imgPos
,
mask
,
end
-
start
,
style
,
opaScale
,
arcInfo
.
imgSrc
);
return
;
return
;
}
}
uint16_t
degreeStart
=
GetDegreeInQuadrant
(
CalculateTanDegree
(
MATH_ABS
(
start
),
MATH_ABS
(
y
)),
quadrant
);
uint16_t
degreeStart
=
GetDegreeInQuadrant
(
CalculateTanDegree
(
MATH_ABS
(
start
),
MATH_ABS
(
y
)),
quadrant
);
...
@@ -260,7 +264,7 @@ void DrawArc::DrawLineWithDegree(BufferInfo& gfxDstBuffer,
...
@@ -260,7 +264,7 @@ void DrawArc::DrawLineWithDegree(BufferInfo& gfxDstBuffer,
return
;
return
;
case
IN_DEGREE_RANG
:
case
IN_DEGREE_RANG
:
DrawHorLine
(
gfxDstBuffer
,
DrawHorLine
(
gfxDstBuffer
,
Point
{
static_cast
<
int16_t
>
(
arcInfo
.
center
.
x
+
start
),
static_cast
<
int16_t
>
(
arcInfo
.
center
.
y
+
y
)
},
Point
{
static_cast
<
int16_t
>
(
arcInfo
.
center
.
x
+
start
),
static_cast
<
int16_t
>
(
arcInfo
.
center
.
y
+
y
)
},
arcInfo
.
imgPos
,
mask
,
end
-
start
,
style
,
opaScale
,
arcInfo
.
imgSrc
);
arcInfo
.
imgPos
,
mask
,
end
-
start
,
style
,
opaScale
,
arcInfo
.
imgSrc
);
return
;
return
;
case
INTERSECT
:
case
INTERSECT
:
...
@@ -306,7 +310,7 @@ int16_t DrawArc::DrawLineWithDegreeInner(BufferInfo& gfxDstBuffer,
...
@@ -306,7 +310,7 @@ int16_t DrawArc::DrawLineWithDegreeInner(BufferInfo& gfxDstBuffer,
}
}
if
((
drawStart
!=
COORD_MIN
)
&&
(
drawEnd
!=
COORD_MIN
))
{
if
((
drawStart
!=
COORD_MIN
)
&&
(
drawEnd
!=
COORD_MIN
))
{
DrawHorLine
(
gfxDstBuffer
,
DrawHorLine
(
gfxDstBuffer
,
Point
{
static_cast
<
int16_t
>
(
arcInfo
.
center
.
x
+
drawStart
),
static_cast
<
int16_t
>
(
arcInfo
.
center
.
y
+
y
)
},
Point
{
static_cast
<
int16_t
>
(
arcInfo
.
center
.
x
+
drawStart
),
static_cast
<
int16_t
>
(
arcInfo
.
center
.
y
+
y
)
},
arcInfo
.
imgPos
,
mask
,
drawEnd
-
drawStart
,
style
,
opaScale
,
arcInfo
.
imgSrc
);
arcInfo
.
imgPos
,
mask
,
drawEnd
-
drawStart
,
style
,
opaScale
,
arcInfo
.
imgSrc
);
}
}
return
drawEnd
;
return
drawEnd
;
...
@@ -367,22 +371,22 @@ void DrawArc::DrawPointAnti(BufferInfo& gfxDstBuffer, ArcInfo& arcInfo, int16_t
...
@@ -367,22 +371,22 @@ void DrawArc::DrawPointAnti(BufferInfo& gfxDstBuffer, ArcInfo& arcInfo, int16_t
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
CIRCLE_IN_DEGREE
-
degreeBase
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
CIRCLE_IN_DEGREE
-
degreeBase
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
startX
=
arcInfo
.
center
.
x
+
x
;
startX
=
arcInfo
.
center
.
x
+
x
;
starty
=
arcInfo
.
center
.
y
+
y_
;
starty
=
arcInfo
.
center
.
y
+
y_
;
DrawHorLine
(
gfxDstBuffer
,
Point
{
startX
,
starty
},
arcInfo
.
imgPos
,
mask
,
0
,
style
,
antiOpa
,
arcInfo
.
imgSrc
);
DrawHorLine
(
gfxDstBuffer
,
Point
{
startX
,
starty
},
arcInfo
.
imgPos
,
mask
,
0
,
style
,
antiOpa
,
arcInfo
.
imgSrc
);
}
}
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
SEMICIRCLE_IN_DEGREE
+
degreeBase
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
SEMICIRCLE_IN_DEGREE
+
degreeBase
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
startX
=
arcInfo
.
center
.
x
+
x
;
startX
=
arcInfo
.
center
.
x
+
x
;
starty
=
arcInfo
.
center
.
y
-
y_
;
starty
=
arcInfo
.
center
.
y
-
y_
;
DrawHorLine
(
gfxDstBuffer
,
Point
{
startX
,
starty
},
arcInfo
.
imgPos
,
mask
,
0
,
style
,
antiOpa
,
arcInfo
.
imgSrc
);
DrawHorLine
(
gfxDstBuffer
,
Point
{
startX
,
starty
},
arcInfo
.
imgPos
,
mask
,
0
,
style
,
antiOpa
,
arcInfo
.
imgSrc
);
}
}
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
degreeBase
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
degreeBase
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
startX
=
arcInfo
.
center
.
x
-
x
;
startX
=
arcInfo
.
center
.
x
-
x
;
starty
=
arcInfo
.
center
.
y
+
y_
;
starty
=
arcInfo
.
center
.
y
+
y_
;
DrawHorLine
(
gfxDstBuffer
,
Point
{
startX
,
starty
},
arcInfo
.
imgPos
,
mask
,
0
,
style
,
antiOpa
,
arcInfo
.
imgSrc
);
DrawHorLine
(
gfxDstBuffer
,
Point
{
startX
,
starty
},
arcInfo
.
imgPos
,
mask
,
0
,
style
,
antiOpa
,
arcInfo
.
imgSrc
);
}
}
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
SEMICIRCLE_IN_DEGREE
-
degreeBase
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
if
(
isCircle_
||
(
IS_IN_DEGREERANE
(
SEMICIRCLE_IN_DEGREE
-
degreeBase
,
arcInfo
.
startAngle
,
arcInfo
.
endAngle
)))
{
startX
=
arcInfo
.
center
.
x
-
x
;
startX
=
arcInfo
.
center
.
x
-
x
;
starty
=
arcInfo
.
center
.
y
-
y_
;
starty
=
arcInfo
.
center
.
y
-
y_
;
DrawHorLine
(
gfxDstBuffer
,
Point
{
startX
,
starty
},
arcInfo
.
imgPos
,
mask
,
0
,
style
,
antiOpa
,
arcInfo
.
imgSrc
);
DrawHorLine
(
gfxDstBuffer
,
Point
{
startX
,
starty
},
arcInfo
.
imgPos
,
mask
,
0
,
style
,
antiOpa
,
arcInfo
.
imgSrc
);
}
}
}
}
#endif
#endif
...
...
frameworks/draw/draw_arc.h
浏览文件 @
fb4f9f1f
...
@@ -113,7 +113,8 @@ private:
...
@@ -113,7 +113,8 @@ private:
int16_t
GetDrawAngle
(
int16_t
angle
);
int16_t
GetDrawAngle
(
int16_t
angle
);
void
DrawCircleNoEndpoint
(
BufferInfo
&
gfxDstBuffer
,
ArcInfo
&
arcInfo
,
const
Rect
&
mask
,
const
Style
&
style
,
uint8_t
opa
,
bool
anti
);
void
DrawCircleNoEndpoint
(
BufferInfo
&
gfxDstBuffer
,
ArcInfo
&
arcInfo
,
const
Rect
&
mask
,
const
Style
&
style
,
uint8_t
opa
,
bool
anti
);
void
DrawAxisLine
(
BufferInfo
&
gfxDstBuffer
,
ArcInfo
&
arcInfo
,
const
Rect
&
mask
,
const
Style
&
style
,
uint8_t
opa
);
void
DrawAxisLine
(
BufferInfo
&
gfxDstBuffer
,
ArcInfo
&
arcInfo
,
const
Rect
&
mask
,
const
Style
&
style
,
uint8_t
opa
);
...
...
frameworks/draw/draw_label.cpp
浏览文件 @
fb4f9f1f
...
@@ -115,7 +115,7 @@ void DrawLabel::DrawArcText(BufferInfo& gfxDstBuffer,
...
@@ -115,7 +115,7 @@ void DrawLabel::DrawArcText(BufferInfo& gfxDstBuffer,
TypedText
::
GetArcLetterPos
(
arcCenter
,
arcTextInfo
.
radius
,
angle
,
posX
,
posY
);
TypedText
::
GetArcLetterPos
(
arcCenter
,
arcTextInfo
.
radius
,
angle
,
posX
,
posY
);
angle
+=
incrementAngle
;
angle
+=
incrementAngle
;
DrawLetterWithRotate
(
gfxDstBuffer
,
mask
,
fontId
,
letter
,
Point
{
MATH_ROUND
(
posX
),
MATH_ROUND
(
posY
)
},
DrawLetterWithRotate
(
gfxDstBuffer
,
mask
,
fontId
,
letter
,
Point
{
MATH_ROUND
(
posX
),
MATH_ROUND
(
posY
)
},
static_cast
<
int16_t
>
(
rotateAngle
),
style
.
textColor_
,
opaScale
);
static_cast
<
int16_t
>
(
rotateAngle
),
style
.
textColor_
,
opaScale
);
}
}
}
}
...
@@ -165,7 +165,7 @@ void DrawLabel::DrawLetterWithRotate(BufferInfo& gfxDstBuffer,
...
@@ -165,7 +165,7 @@ void DrawLabel::DrawLetterWithRotate(BufferInfo& gfxDstBuffer,
transMap
.
Rotate
(
rotateAngle
,
Vector2
<
float
>
(
-
node
.
left
,
node
.
top
-
head
.
ascender
));
transMap
.
Rotate
(
rotateAngle
,
Vector2
<
float
>
(
-
node
.
left
,
node
.
top
-
head
.
ascender
));
TransformDataInfo
letterTranDataInfo
=
{
ImageHeader
{
colorMode
,
0
,
0
,
0
,
node
.
cols
,
node
.
rows
},
fontMap
,
fontWeight
,
TransformDataInfo
letterTranDataInfo
=
{
ImageHeader
{
colorMode
,
0
,
0
,
0
,
node
.
cols
,
node
.
rows
},
fontMap
,
fontWeight
,
BlurLevel
::
LEVEL0
};
BlurLevel
::
LEVEL0
};
BaseGfxEngine
::
GetInstance
()
->
DrawTransform
(
gfxDstBuffer
,
mask
,
Point
{
0
,
0
},
color
,
opaScale
,
transMap
,
BaseGfxEngine
::
GetInstance
()
->
DrawTransform
(
gfxDstBuffer
,
mask
,
Point
{
0
,
0
},
color
,
opaScale
,
transMap
,
letterTranDataInfo
);
letterTranDataInfo
);
}
}
}
// namespace OHOS
}
// namespace OHOS
frameworks/draw/draw_line.cpp
浏览文件 @
fb4f9f1f
...
@@ -181,7 +181,7 @@ void DrawLine::DrawWuLine(BufferInfo& gfxDstBuffer, const Point& start, const Po
...
@@ -181,7 +181,7 @@ void DrawLine::DrawWuLine(BufferInfo& gfxDstBuffer, const Point& start, const Po
// width is longer than distance between start point and end point, need swap direction of line.
// width is longer than distance between start point and end point, need swap direction of line.
if
(
dx
*
dx
+
dy
*
dy
<
width
*
width
)
{
if
(
dx
*
dx
+
dy
*
dy
<
width
*
width
)
{
if
((
dx
==
1
)
&&
(
dy
==
1
))
{
if
((
dx
==
1
)
&&
(
dy
==
1
))
{
DrawThinWuLine
(
gfxDstBuffer
,
{
x0Int
,
y0Int
},
{
x3Int
,
y3Int
},
mask
,
2
,
color
,
opacity
);
// 2 :
width of line
DrawThinWuLine
(
gfxDstBuffer
,
{
x0Int
,
y0Int
},
{
x3Int
,
y3Int
},
mask
,
2
,
color
,
opacity
);
// 2 :
line width
return
;
return
;
}
}
dx
=
MATH_ABS
(
x0Int
-
x1Int
);
dx
=
MATH_ABS
(
x0Int
-
x1Int
);
...
...
frameworks/draw/draw_utils.cpp
浏览文件 @
fb4f9f1f
...
@@ -562,7 +562,7 @@ void DrawUtils::BlendWithSoftWare(const uint8_t* src1,
...
@@ -562,7 +562,7 @@ void DrawUtils::BlendWithSoftWare(const uint8_t* src1,
uint8_t
*
dest
=
dst
+
destStride
*
y
;
uint8_t
*
dest
=
dst
+
destStride
*
y
;
dest
+=
destByteSize
*
x
;
dest
+=
destByteSize
*
x
;
uint8_t
pxByteSize
=
GetPxSizeByColorMode
(
srcMode
)
>>
3
;
uint8_t
pxByteSize
=
GetPxSizeByColorMode
(
srcMode
)
>>
3
;
// 3 : right shift 3 bits
uint8_t
*
src
=
const_cast
<
uint8_t
*>
(
src1
)
+
srcStride
*
srcRect
.
GetY
()
+
pxByteSize
*
srcRect
.
GetX
();
uint8_t
*
src
=
const_cast
<
uint8_t
*>
(
src1
)
+
srcStride
*
srcRect
.
GetY
()
+
pxByteSize
*
srcRect
.
GetX
();
uint32_t
width
=
srcRect
.
GetWidth
();
uint32_t
width
=
srcRect
.
GetWidth
();
uint32_t
height
=
srcRect
.
GetHeight
();
uint32_t
height
=
srcRect
.
GetHeight
();
...
@@ -862,7 +862,7 @@ void DrawUtils::DrawTriangleTrueColorBilinear888(const TriangleScanInfo& in, con
...
@@ -862,7 +862,7 @@ void DrawUtils::DrawTriangleTrueColorBilinear888(const TriangleScanInfo& in, con
static
void
DrawTriangleTrueColorBilinear8888Inner
(
const
TriangleScanInfo
&
in
,
static
void
DrawTriangleTrueColorBilinear8888Inner
(
const
TriangleScanInfo
&
in
,
uint8_t
*
screenBuffer
,
uint8_t
*
screenBuffer
,
int16_t
len
,
int16_t
len
,
const
ColorMode
bufferMode
,
const
ColorMode
bufferMode
,
int32_t
u
,
int32_t
u
,
int32_t
v
)
int32_t
v
)
{
{
...
...
interfaces/kits/font/ui_font_header.h
浏览文件 @
fb4f9f1f
...
@@ -376,38 +376,5 @@ struct FileCommonHeader {
...
@@ -376,38 +376,5 @@ struct FileCommonHeader {
uint32_t
fileLength
;
uint32_t
fileLength
;
};
};
#pragma pack()
#pragma pack()
/**
* @brief Get the Text Lang Fonts Table
* @param uint8_t langFontId [in] the font id
* @return UITextLanguageFontParam* the font table, definition is in font tool
*/
UITextLanguageFontParam
*
GetTextLangFontsTable
(
uint8_t
langFontId
);
/**
* @brief Get the Total Lang Id
* @return uint8_t the total Lang id, definition is in font tool
*/
uint8_t
GetTotalLangId
();
/**
* @brief Get the Total Font Id
* @return uint8_t the total font id, definition is in font tool
*/
uint8_t
GetTotalFontId
();
uint8_t
GetBitmapFontIdMax
();
/**
* @brief Get the Total Text Id
* @return uint8_t the total text id, definition is in font tool
*/
uint16_t
GetTotalTextId
();
/**
* @brief Get the Lang Text default param table
* @return LangTextParam* the param table, definition is in font tool
*/
LangTextParam
*
GetLangTextDefaultParamTable
();
}
// namespace OHOS
}
// namespace OHOS
#endif
/* UI_FONT_HEADER_H */
#endif
/* UI_FONT_HEADER_H */
\ No newline at end of file
test/uitest/test_view_scale_rotate/ui_test_view_scale_rotate.h
浏览文件 @
fb4f9f1f
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#ifndef UI_TEST_VIEW_SCALE_ROTATE_H
#ifndef UI_TEST_VIEW_SCALE_ROTATE_H
#define UI_TEST_VIEW_SCALE_ROTATE_H
#define UI_TEST_VIEW_SCALE_ROTATE_H
#include <cstdio>
#include "components/ui_arc_label.h"
#include "components/ui_arc_label.h"
#include "components/ui_box_progress.h"
#include "components/ui_box_progress.h"
#include "components/ui_button.h"
#include "components/ui_button.h"
...
@@ -27,10 +28,9 @@
...
@@ -27,10 +28,9 @@
#include "components/ui_scroll_view.h"
#include "components/ui_scroll_view.h"
#include "components/ui_slider.h"
#include "components/ui_slider.h"
#include "components/ui_swipe_view.h"
#include "components/ui_swipe_view.h"
#include "layout/list_layout.h"
#include "gfx_utils/sys_info.h"
#include "gfx_utils/sys_info.h"
#include "layout/list_layout.h"
#include "ui_test.h"
#include "ui_test.h"
#include <stdio.h>
namespace
OHOS
{
namespace
OHOS
{
class
UITestViewScaleRotate
:
public
UITest
,
public
AnimatorCallback
{
class
UITestViewScaleRotate
:
public
UITest
,
public
AnimatorCallback
{
...
...
tools/qt/simulator/drivers/display/monitor.cpp
浏览文件 @
fb4f9f1f
...
@@ -72,7 +72,8 @@ BufferInfo* Monitor::GetBufferInfo()
...
@@ -72,7 +72,8 @@ BufferInfo* Monitor::GetBufferInfo()
bufferInfo
->
mode
=
ARGB8888
;
bufferInfo
->
mode
=
ARGB8888
;
bufferInfo
->
color
=
0x44
;
bufferInfo
->
color
=
0x44
;
bufferInfo
->
phyAddr
=
bufferInfo
->
virAddr
=
tftFb_
;
bufferInfo
->
phyAddr
=
bufferInfo
->
virAddr
=
tftFb_
;
bufferInfo
->
stride
=
HORIZONTAL_RESOLUTION
*
(
DrawUtils
::
GetPxSizeByColorMode
(
bufferInfo
->
mode
)
>>
3
);
// 3: Shift right 3 bits
// 3: Shift right 3 bits
bufferInfo
->
stride
=
HORIZONTAL_RESOLUTION
*
(
DrawUtils
::
GetPxSizeByColorMode
(
bufferInfo
->
mode
)
>>
3
);
bufferInfo
->
width
=
HORIZONTAL_RESOLUTION
;
bufferInfo
->
width
=
HORIZONTAL_RESOLUTION
;
bufferInfo
->
height
=
VERTICAL_RESOLUTION
;
bufferInfo
->
height
=
VERTICAL_RESOLUTION
;
}
}
...
...
tools/qt/simulator/drivers/display/monitor.h
浏览文件 @
fb4f9f1f
...
@@ -16,9 +16,10 @@
...
@@ -16,9 +16,10 @@
#ifndef GRAPHIC_LITE_MONITOR_H
#ifndef GRAPHIC_LITE_MONITOR_H
#define GRAPHIC_LITE_MONITOR_H
#define GRAPHIC_LITE_MONITOR_H
#include <QtCore/qobject.h>
#include "engines/gfx/gfx_engine_manager.h"
#include "engines/gfx/gfx_engine_manager.h"
#include "font/ui_font_header.h"
#include "font/ui_font_header.h"
#include <QtCore/qobject.h>
namespace
OHOS
{
namespace
OHOS
{
class
Monitor
:
public
QObject
,
public
BaseGfxEngine
{
class
Monitor
:
public
QObject
,
public
BaseGfxEngine
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录