Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Graphic Ui
提交
3e753dbb
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,发现更多精彩内容 >>
未验证
提交
3e753dbb
编写于
1月 17, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 17, 2022
浏览文件
操作
浏览文件
下载
差异文件
!581 修复可穿戴设备编译告警问题
Merge pull request !581 from 郝烁/master
上级
c78fee23
a2aab76f
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
99 addition
and
84 deletion
+99
-84
frameworks/animator/easing_equation.cpp
frameworks/animator/easing_equation.cpp
+11
-11
frameworks/components/ui_arc_label.cpp
frameworks/components/ui_arc_label.cpp
+7
-6
frameworks/components/ui_arc_scroll_bar.cpp
frameworks/components/ui_arc_scroll_bar.cpp
+8
-6
frameworks/components/ui_box_scroll_bar.cpp
frameworks/components/ui_box_scroll_bar.cpp
+6
-6
frameworks/components/ui_checkbox.cpp
frameworks/components/ui_checkbox.cpp
+4
-4
frameworks/components/ui_list.cpp
frameworks/components/ui_list.cpp
+7
-9
frameworks/components/ui_toggle_button.cpp
frameworks/components/ui_toggle_button.cpp
+10
-7
frameworks/dfx/event_injector.cpp
frameworks/dfx/event_injector.cpp
+16
-16
frameworks/draw/draw_utils.cpp
frameworks/draw/draw_utils.cpp
+10
-13
frameworks/font/ui_line_break.cpp
frameworks/font/ui_line_break.cpp
+9
-6
interfaces/kits/components/ui_button.h
interfaces/kits/components/ui_button.h
+11
-0
未找到文件。
frameworks/animator/easing_equation.cpp
浏览文件 @
3e753dbb
...
...
@@ -64,7 +64,7 @@ int16_t EasingEquation::CircEaseIn(int16_t startPos, int16_t endPos, uint16_t cu
{
if
(
curTime
<
durationTime
)
{
int32_t
t
=
(
curTime
<<
INTERPOLATION_RANGE_OFFSET
)
/
durationTime
;
uint32_t
x
=
INTERPOLATION_RANGE
-
Sqrt
(
INTERPOLATION_RANGE_SQUARE
-
t
*
t
);
uint32_t
x
=
INTERPOLATION_RANGE
-
static_cast
<
int32_t
>
(
Sqrt
(
INTERPOLATION_RANGE_SQUARE
-
t
*
t
)
);
return
static_cast
<
int16_t
>
(((
x
*
(
static_cast
<
int32_t
>
(
endPos
)
-
startPos
))
>>
INTERPOLATION_RANGE_OFFSET
)
+
startPos
);
}
...
...
@@ -251,4 +251,4 @@ int16_t EasingEquation::SineEaseInOut(int16_t startPos, int16_t endPos, uint16_t
}
return
SineEaseOut
(
halfStep
,
endPos
,
curTime
-
halfTime
,
halfTime
);
}
}
\ No newline at end of file
}
// namespace OHOS
\ No newline at end of file
frameworks/components/ui_arc_label.cpp
浏览文件 @
3e753dbb
...
...
@@ -196,7 +196,8 @@ void UIArcLabel::MeasureArcTextInfo()
// calculate max arc length
float
maxLength
=
static_cast
<
float
>
((
UI_PI
*
radius_
*
arcAngle
)
/
SEMICIRCLE_IN_DEGREE
);
arcTextInfo_
.
lineStart
=
0
;
arcTextInfo_
.
lineEnd
=
TypedText
::
GetNextLine
(
&
text
[
arcTextInfo_
.
lineStart
],
style_
->
letterSpace_
,
maxLength
);
arcTextInfo_
.
lineEnd
=
TypedText
::
GetNextLine
(
&
text
[
arcTextInfo_
.
lineStart
],
style_
->
letterSpace_
,
static_cast
<
int16_t
>
(
maxLength
));
arcTextInfo_
.
startAngle
=
startAngle_
%
CIRCLE_IN_DEGREE
;
int16_t
actLength
=
TypedText
::
GetTextWidth
(
&
text
[
arcTextInfo_
.
lineStart
],
arcTextInfo_
.
lineEnd
-
arcTextInfo_
.
lineStart
,
style_
->
letterSpace_
);
...
...
frameworks/components/ui_arc_scroll_bar.cpp
浏览文件 @
3e753dbb
...
...
@@ -34,7 +34,9 @@ UIArcScrollBar::UIArcScrollBar()
startAngle_
(
RIGHT_SIDE_START_ANGLE_IN_DEGREE
),
endAngle_
(
RIGHT_SIDE_END_ANGLE_IN_DEGREE
),
center_
({
0
,
0
}),
side_
(
SCROLL_BAR_RIGHT_SIDE
)
{}
side_
(
SCROLL_BAR_RIGHT_SIDE
)
{
}
void
UIArcScrollBar
::
SetPosition
(
int16_t
x
,
int16_t
y
,
int16_t
width
,
int16_t
radius
)
{
...
...
@@ -68,7 +70,7 @@ void UIArcScrollBar::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedAre
void
UIArcScrollBar
::
DrawForeground
(
BufferInfo
&
gfxDstBuffer
,
const
Rect
&
invalidatedArea
,
uint8_t
backgroundOpa
)
{
uint16_t
foregoundAngleRange
=
foregroundProportion_
*
(
endAngle_
-
startAngle_
);
uint16_t
foregoundAngleRange
=
static_cast
<
uint16_t
>
(
foregroundProportion_
*
(
endAngle_
-
startAngle_
)
);
if
(
foregoundAngleRange
<
SCROLL_BAR_MIN_ARC
)
{
foregoundAngleRange
=
SCROLL_BAR_MIN_ARC
;
}
...
...
@@ -79,12 +81,12 @@ void UIArcScrollBar::DrawForeground(BufferInfo& gfxDstBuffer, const Rect& invali
if
(
side_
==
SCROLL_BAR_RIGHT_SIDE
)
{
minAngle
=
startAngle_
;
maxAngle
=
endAngle_
-
foregoundAngleRange
;
startAngle
=
minAngle
+
s
crollProgress_
*
(
maxAngle
-
minAngle
);
startAngle
=
minAngle
+
s
tatic_cast
<
int16_t
>
(
scrollProgress_
*
(
maxAngle
-
minAngle
)
);
endAngle
=
startAngle
+
foregoundAngleRange
;
}
else
{
maxAngle
=
endAngle_
;
minAngle
=
startAngle_
+
foregoundAngleRange
;
endAngle
=
maxAngle
-
s
crollProgress_
*
(
maxAngle
-
minAngle
);
endAngle
=
maxAngle
-
s
tatic_cast
<
int16_t
>
(
scrollProgress_
*
(
maxAngle
-
minAngle
)
);
startAngle
=
endAngle
-
foregoundAngleRange
;
}
if
((
startAngle
>
endAngle_
)
||
(
endAngle
<
startAngle_
))
{
...
...
frameworks/components/ui_box_scroll_bar.cpp
浏览文件 @
3e753dbb
...
...
@@ -41,21 +41,21 @@ void UIBoxScrollBar::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedAre
/* Draw foreground */
if
(
backgroundRect_
.
GetWidth
()
<
backgroundRect_
.
GetHeight
())
{
int16_t
forgroundHeight
=
foregroundProportion_
*
backgroundRect_
.
GetHeight
(
);
int16_t
forgroundHeight
=
static_cast
<
int16_t
>
(
foregroundProportion_
*
backgroundRect_
.
GetHeight
()
);
if
(
forgroundHeight
<
SCROLL_BAR_MIN_LEN
)
{
forgroundHeight
=
SCROLL_BAR_MIN_LEN
;
}
int16_t
forgroundTop
=
backgroundRect_
.
GetTop
()
+
scrollProgress_
*
(
backgroundRect_
.
GetHeight
()
-
forgroundHeight
);
int16_t
forgroundTop
=
backgroundRect_
.
GetTop
()
+
static_cast
<
int16_t
>
(
scrollProgress_
*
(
backgroundRect_
.
GetHeight
()
-
forgroundHeight
)
);
rect
.
SetRect
(
backgroundRect_
.
GetLeft
(),
forgroundTop
,
backgroundRect_
.
GetRight
(),
forgroundTop
+
forgroundHeight
-
1
);
}
else
{
int16_t
forgroundWidth
=
foregroundProportion_
*
backgroundRect_
.
GetWidth
(
);
int16_t
forgroundWidth
=
static_cast
<
int16_t
>
(
foregroundProportion_
*
backgroundRect_
.
GetWidth
()
);
if
(
forgroundWidth
<
SCROLL_BAR_MIN_LEN
)
{
forgroundWidth
=
SCROLL_BAR_MIN_LEN
;
}
int16_t
forgroundLeft
=
backgroundRect_
.
GetLeft
()
+
scrollProgress_
*
(
backgroundRect_
.
GetWidth
()
-
forgroundWidth
);
int16_t
forgroundLeft
=
backgroundRect_
.
GetLeft
()
+
static_cast
<
int16_t
>
(
scrollProgress_
*
(
backgroundRect_
.
GetWidth
()
-
forgroundWidth
)
);
rect
.
SetRect
(
forgroundLeft
,
backgroundRect_
.
GetTop
(),
forgroundLeft
+
forgroundWidth
-
1
,
backgroundRect_
.
GetBottom
());
}
...
...
frameworks/components/ui_checkbox.cpp
浏览文件 @
3e753dbb
...
...
@@ -137,12 +137,12 @@ void UICheckBox::SelectedStateSoftwareDrawing(BufferInfo& gfxDstBuffer,
styleSelect
.
bgColor_
=
selectedStateColor_
;
styleSelect
.
bgOpa_
=
backgroundOpacity_
;
BaseGfxEngine
::
GetInstance
()
->
DrawRect
(
gfxDstBuffer
,
rect
,
trunc
,
styleSelect
,
opaScale_
);
int16_t
dx
=
borderWidth_
*
DEFAULT_COEFFICIENT_START_DX
;
int16_t
dy
=
borderWidth_
*
DEFAULT_COEFFICIENT_START_DY
;
int16_t
dx
=
static_cast
<
int16_t
>
(
borderWidth_
*
DEFAULT_COEFFICIENT_START_DX
)
;
int16_t
dy
=
static_cast
<
int16_t
>
(
borderWidth_
*
DEFAULT_COEFFICIENT_START_DY
)
;
Point
start
=
{
static_cast
<
int16_t
>
(
rect
.
GetX
()
+
dx
),
static_cast
<
int16_t
>
(
rect
.
GetY
()
+
dy
)};
dx
=
borderWidth_
*
DEFAULT_COEFFICIENT_MID_DX
;
dx
=
static_cast
<
int16_t
>
(
borderWidth_
*
DEFAULT_COEFFICIENT_MID_DX
)
;
Point
mid
=
{
static_cast
<
int16_t
>
(
start
.
x
+
dx
),
static_cast
<
int16_t
>
(
start
.
y
+
dx
)};
dx
=
borderWidth_
*
DEFAULT_COEFFICIENT_MID_DY
;
dx
=
static_cast
<
int16_t
>
(
borderWidth_
*
DEFAULT_COEFFICIENT_MID_DY
)
;
Point
end
=
{
static_cast
<
int16_t
>
(
mid
.
x
+
dx
),
static_cast
<
int16_t
>
(
mid
.
y
-
dx
)};
const
int16_t
half
=
2
;
// 2 :half
ArcInfo
arcInfoLeft
=
{
start
,
...
...
frameworks/components/ui_list.cpp
浏览文件 @
3e753dbb
...
...
@@ -356,23 +356,21 @@ bool UIList::MoveOffset(int16_t x, int16_t y)
if
(
!
isLoopList_
&&
scrollListener_
)
{
if
(
direction_
==
VERTICAL
)
{
if
(
childrenHead_
&&
(
childrenHead_
->
GetViewIndex
()
==
startIndex_
)
&&
childrenHead_
->
GetRelativeRect
().
GetTop
()
>=
0
&&
childrenHead_
->
GetRelativeRect
().
GetTop
()
-
y
<
0
)
{
if
(
childrenHead_
&&
(
childrenHead_
->
GetViewIndex
()
==
0
)
&&
childrenHead_
->
GetRelativeRect
().
GetTop
()
>=
0
&&
childrenHead_
->
GetRelativeRect
().
GetTop
()
-
y
<
0
)
{
scrollListener_
->
OnScrollTop
(
childrenHead_
->
GetViewIndex
(),
childrenHead_
);
}
if
(
childrenTail_
&&
(
childrenTail_
->
GetViewIndex
()
==
recycle_
.
GetAdapterItemCount
()
-
1
)
&&
if
(
childrenTail_
&&
(
childrenTail_
->
GetViewIndex
()
==
recycle_
.
GetAdapterItemCount
()
-
1
)
&&
(
childrenTail_
->
GetRelativeRect
().
GetBottom
()
<=
GetContentRect
().
GetHeight
()
-
1
)
&&
(
childrenTail_
->
GetRelativeRect
().
GetBottom
()
-
y
>
GetContentRect
().
GetHeight
()
-
1
))
{
scrollListener_
->
OnScrollBottom
(
childrenTail_
->
GetViewIndex
(),
childrenTail_
);
}
}
else
{
if
(
childrenHead_
&&
(
childrenHead_
->
GetViewIndex
()
==
startIndex_
)
&&
childrenHead_
->
GetRelativeRect
().
GetLeft
()
>=
0
&&
childrenHead_
->
GetRelativeRect
().
GetLeft
()
-
x
<
0
)
{
if
(
childrenHead_
&&
(
childrenHead_
->
GetViewIndex
()
==
0
)
&&
childrenHead_
->
GetRelativeRect
().
GetLeft
()
>=
0
&&
childrenHead_
->
GetRelativeRect
().
GetLeft
()
-
x
<
0
)
{
scrollListener_
->
OnScrollTop
(
childrenHead_
->
GetViewIndex
(),
childrenHead_
);
}
if
(
childrenTail_
&&
(
childrenTail_
->
GetViewIndex
()
==
recycle_
.
GetAdapterItemCount
()
-
1
)
&&
if
(
childrenTail_
&&
(
childrenTail_
->
GetViewIndex
()
==
recycle_
.
GetAdapterItemCount
()
-
1
)
&&
(
childrenTail_
->
GetRelativeRect
().
GetRight
()
<=
GetContentRect
().
GetWidth
()
-
1
)
&&
(
childrenTail_
->
GetRelativeRect
().
GetRight
()
-
x
>
GetContentRect
().
GetWidth
()
-
1
))
{
scrollListener_
->
OnScrollBottom
(
childrenTail_
->
GetViewIndex
(),
childrenTail_
);
...
...
frameworks/components/ui_toggle_button.cpp
浏览文件 @
3e753dbb
...
...
@@ -118,14 +118,17 @@ void UIToggleButton::Callback(UIView* view)
float
coefficient
=
Interpolation
::
GetBezierY
(
x
,
BEZIER_CONTROL_POINT_X_1
,
0
,
BEZIER_CONTROL_POINT_X_2
,
1
);
if
(
state_
==
SELECTED
)
{
currentCenter_
.
y
=
rightCenter_
.
y
;
currentCenter_
.
x
=
(
rightCenter_
.
x
-
leftCenter_
.
x
)
*
coefficient
+
leftCenter_
.
x
;
backgroundOpacity_
=
TOGGLE_BTN_UNSELECTED_OPA
+
(
OPA_OPAQUE
-
TOGGLE_BTN_UNSELECTED_OPA
)
*
coefficient
;
bgColor_
=
Color
::
GetMixColor
(
selectedStateColor_
,
Color
::
White
(),
OPA_OPAQUE
*
coefficient
);
currentCenter_
.
x
=
static_cast
<
int16_t
>
((
rightCenter_
.
x
-
leftCenter_
.
x
)
*
coefficient
)
+
leftCenter_
.
x
;
backgroundOpacity_
=
static_cast
<
uint8_t
>
(
TOGGLE_BTN_UNSELECTED_OPA
+
(
OPA_OPAQUE
-
TOGGLE_BTN_UNSELECTED_OPA
)
*
coefficient
);
bgColor_
=
Color
::
GetMixColor
(
selectedStateColor_
,
Color
::
White
(),
static_cast
<
uint8_t
>
(
OPA_OPAQUE
*
coefficient
));
}
else
{
currentCenter_
.
y
=
leftCenter_
.
y
;
currentCenter_
.
x
=
rightCenter_
.
x
-
(
rightCenter_
.
x
-
leftCenter_
.
x
)
*
coefficient
;
backgroundOpacity_
=
OPA_OPAQUE
-
(
OPA_OPAQUE
-
TOGGLE_BTN_UNSELECTED_OPA
)
*
coefficient
;
bgColor_
=
Color
::
GetMixColor
(
selectedStateColor_
,
Color
::
White
(),
OPA_OPAQUE
*
(
1
-
coefficient
));
currentCenter_
.
x
=
rightCenter_
.
x
-
static_cast
<
uint16_t
>
((
rightCenter_
.
x
-
leftCenter_
.
x
)
*
coefficient
);
backgroundOpacity_
=
static_cast
<
uint8_t
>
(
OPA_OPAQUE
-
(
OPA_OPAQUE
-
TOGGLE_BTN_UNSELECTED_OPA
)
*
coefficient
);
bgColor_
=
Color
::
GetMixColor
(
selectedStateColor_
,
Color
::
White
(),
static_cast
<
uint8_t
>
(
OPA_OPAQUE
*
(
1
-
coefficient
)));
}
Invalidate
();
}
...
...
frameworks/dfx/event_injector.cpp
浏览文件 @
3e753dbb
...
...
@@ -162,7 +162,7 @@ bool EventInjector::SetClickEvent(const Point& clickPoint)
if
(
!
SetInjectEvent
(
dataArray
,
clickArrayLen
,
EventDataType
::
POINT_TYPE
))
{
setResult
=
false
;
}
delete
[]
dataArray
;
delete
[]
dataArray
;
return
setResult
;
}
...
...
@@ -186,7 +186,7 @@ bool EventInjector::SetLongPressEvent(const Point& longPressPoint)
if
(
!
SetInjectEvent
(
dataArray
,
pointCount
,
EventDataType
::
POINT_TYPE
))
{
setResult
=
false
;
}
delete
[]
dataArray
;
delete
[]
dataArray
;
return
setResult
;
}
...
...
@@ -215,19 +215,19 @@ bool EventInjector::SetDragEvent(const Point& startPoint, const Point& endPoint,
}
for
(
uint16_t
i
=
0
;
i
<
pointCount
;
i
++
)
{
dataArray
[
i
].
point
.
x
=
startPoint
.
x
;
dataArray
[
i
].
point
.
y
=
startPoint
.
y
+
(
i
*
negativeFlag
*
pointStep
);
dataArray
[
i
].
point
.
y
=
startPoint
.
y
+
static_cast
<
int16_t
>
(
i
*
negativeFlag
*
pointStep
);
dataArray
[
i
].
state
=
InputDevice
::
STATE_PRESS
;
}
}
else
{
float
slope
=
static_cast
<
float
>
(
endPoint
.
y
-
startPoint
.
y
)
/
(
endPoint
.
x
-
startPoint
.
x
);
int16_t
constPara
=
startPoint
.
y
-
(
slope
*
startPoint
.
x
);
int16_t
constPara
=
startPoint
.
y
-
static_cast
<
int16_t
>
(
slope
*
startPoint
.
x
);
float
pointStep
=
static_cast
<
float
>
(
MATH_ABS
(
endPoint
.
x
-
startPoint
.
x
))
/
(
pointCount
-
1
);
if
(
endPoint
.
x
<
startPoint
.
x
)
{
negativeFlag
=
-
1
;
/* -1:represent the coordinate x of endPoint is smaller than startPoint. */
}
for
(
uint16_t
i
=
0
;
i
<
pointCount
;
i
++
)
{
dataArray
[
i
].
point
.
x
=
startPoint
.
x
+
(
i
*
negativeFlag
*
pointStep
);
dataArray
[
i
].
point
.
y
=
s
lope
*
(
dataArray
[
i
].
point
.
x
)
+
constPara
;
dataArray
[
i
].
point
.
x
=
startPoint
.
x
+
static_cast
<
int16_t
>
(
i
*
negativeFlag
*
pointStep
);
dataArray
[
i
].
point
.
y
=
s
tatic_cast
<
int16_t
>
(
slope
*
(
dataArray
[
i
].
point
.
x
)
)
+
constPara
;
dataArray
[
i
].
state
=
InputDevice
::
STATE_PRESS
;
}
}
...
...
@@ -236,7 +236,7 @@ bool EventInjector::SetDragEvent(const Point& startPoint, const Point& endPoint,
if
(
!
SetInjectEvent
(
dataArray
,
pointCount
,
EventDataType
::
POINT_TYPE
))
{
setResult
=
false
;
}
delete
[]
dataArray
;
delete
[]
dataArray
;
return
setResult
;
}
...
...
@@ -259,7 +259,7 @@ bool EventInjector::SetKeyEvent(uint16_t keyId, uint16_t state)
if
(
!
SetInjectEvent
(
dataArray
,
kevArrayLen
,
EventDataType
::
KEY_TYPE
))
{
setResult
=
false
;
}
delete
[]
dataArray
;
delete
[]
dataArray
;
return
setResult
;
}
...
...
@@ -271,5 +271,5 @@ void EventInjector::SetWindowId(uint8_t windowId)
}
}
#endif
}
}
// namespace OHOS
#endif // ENABLE_DEBUG
\ No newline at end of file
frameworks/draw/draw_utils.cpp
浏览文件 @
3e753dbb
...
...
@@ -89,10 +89,10 @@ namespace OHOS {
const float Alpha1 = static_cast<float>(a1) / OPA_OPAQUE; \
const float Alpha2 = static_cast<float>(a2) / OPA_OPAQUE; \
const float Alpha3 = 1 - (1 - Alpha1) * (1 - Alpha2); \
(r1) =
(Alpha2 * (r2) + (1 - Alpha2) * Alpha1 * (r1)) / Alpha3
; \
(g1) =
(Alpha2 * (g2) + (1 - Alpha2) * Alpha1 * (g1)) / Alpha3
; \
(b1) =
(Alpha2 * (b2) + (1 - Alpha2) * Alpha1 * (b1)) / Alpha3
; \
(a1) =
Alpha3 * OPA_OPAQUE
;
(r1) =
static_cast<uint8_t>((Alpha2 * (r2) + (1 - Alpha2) * Alpha1 * (r1)) / Alpha3)
; \
(g1) =
static_cast<uint8_t>((Alpha2 * (g2) + (1 - Alpha2) * Alpha1 * (g1)) / Alpha3)
; \
(b1) =
static_cast<uint8_t>((Alpha2 * (b2) + (1 - Alpha2) * Alpha1 * (b1)) / Alpha3)
; \
(a1) =
static_cast<uint8_t>(Alpha3 * OPA_OPAQUE)
;
#define COLOR_BLEND_RGB(r1, g1, b1, r2, g2, b2, a2) \
(r1) = (((r2) * (a2)) / OPA_OPAQUE) + (((r1) * (OPA_OPAQUE - (a2))) / OPA_OPAQUE); \
...
...
@@ -336,27 +336,22 @@ void DrawUtils::DrawLetter(BufferInfo& gfxDstBuffer,
Color32
fillColor
;
fillColor
.
full
=
Color
::
ColorTo32
(
color
);
uint8_t
opacityMask
;
uint8_t
colorMode
=
0
;
uint8_t
opacityStep
=
1
;
switch
(
fontWeight
)
{
case
FONT_WEIGHT_1
:
opacityStep
=
OPACITY_STEP_A1
;
opacityMask
=
0x01
;
colorMode
=
A1
;
break
;
case
FONT_WEIGHT_2
:
opacityStep
=
OPACITY_STEP_A2
;
opacityMask
=
0x03
;
colorMode
=
A2
;
break
;
case
FONT_WEIGHT_4
:
opacityStep
=
OPACITY_STEP_A4
;
opacityMask
=
0x0F
;
colorMode
=
A4
;
break
;
case
FONT_WEIGHT_8
:
opacityMask
=
0xFF
;
colorMode
=
A8
;
break
;
default:
return
;
...
...
@@ -1078,6 +1073,7 @@ static void DrawTriangleTrueColorBilinear8888Inner(const TriangleScanInfo& in,
}
#endif
#if ENABLE_FIXED_POINT
static
void
DrawFixedTriangleTrueColorBilinear8888Inner
(
const
TriangleScanInfo
&
in
,
uint8_t
*
screenBuffer
,
int16_t
len
,
...
...
@@ -1144,6 +1140,7 @@ static void DrawFixedTriangleTrueColorBilinear8888Inner(const TriangleScanInfo&
screenBuffer
+=
in
.
bufferPxSize
;
}
}
#endif
#ifdef ARM_NEON_OPT
static
void
DrawTriangleTrueColorBilinear8888InnerNeon
(
const
TriangleScanInfo
&
in
,
...
...
frameworks/font/ui_line_break.cpp
浏览文件 @
3e753dbb
...
...
@@ -58,7 +58,7 @@ uint16_t UILineBreakEngine::GetNextBreakPos(UILineBreakProxy& record)
reinterpret_cast
<
const
RBBIStateTableRow
*>
(
rbbStateTable
->
fTableData
+
rbbStateTable
->
fRowLen
*
state
);
UTrie2
*
trie2
=
reinterpret_cast
<
UTrie2
*>
(
lineBreakTrie_
);
for
(
uint16_t
index
=
0
;
index
<
record
.
GetStrLen
();
++
index
)
{
uint16_t
category
=
UTRIE2_GET16
(
trie2
,
st
r
[
index
]
);
uint16_t
category
=
UTRIE2_GET16
(
trie2
,
st
atic_cast
<
uint32_t
>
(
str
[
index
])
);
// 0x4000: remove the dictionary flag bit
if
((
category
&
0x4000
)
!=
0
)
{
// 0x4000: remove the dictionary flag bit
...
...
@@ -107,7 +107,10 @@ void UILineBreakEngine::LoadRule()
initSuccess_
=
true
;
}
uint32_t
UILineBreakEngine
::
GetNextLineAndWidth
(
const
char
*
text
,
int16_t
space
,
bool
allBreak
,
int16_t
&
maxWidth
,
uint32_t
UILineBreakEngine
::
GetNextLineAndWidth
(
const
char
*
text
,
int16_t
space
,
bool
allBreak
,
int16_t
&
maxWidth
,
uint16_t
len
)
{
if
(
text
==
nullptr
)
{
...
...
@@ -166,7 +169,7 @@ bool UILineBreakEngine::IsBreakPos(uint32_t unicode, int32_t& state)
utf16
=
(
unicode
&
TypedText
::
MAX_UINT16_LOW_SCOPE
);
}
else
if
(
unicode
<=
TypedText
::
MAX_UINT16_HIGH_SCOPE
)
{
utf16
=
static_cast
<
uint16_t
>
(
TypedText
::
UTF16_LOW_PARAM
+
(
unicode
&
TypedText
::
UTF16_LOW_MASK
));
// low
uint16_t
category
=
UTRIE2_GET16
(
reinterpret_cast
<
UTrie2
*>
(
lineBreakTrie_
),
utf16
);
uint16_t
category
=
UTRIE2_GET16
(
reinterpret_cast
<
UTrie2
*>
(
lineBreakTrie_
),
static_cast
<
uint32_t
>
(
utf16
)
);
// 0x4000: remove the dictionary flag bit
if
((
category
&
0x4000
)
!=
0
)
{
// 0x4000: remove the dictionary flag bit
...
...
@@ -174,10 +177,10 @@ bool UILineBreakEngine::IsBreakPos(uint32_t unicode, int32_t& state)
}
state
=
row
->
fNextState
[
category
];
row
=
reinterpret_cast
<
const
RBBIStateTableRow
*>
(
rbbStateTable
->
fTableData
+
rbbStateTable
->
fRowLen
*
state
);
utf16
=
static_cast
<
uint16_t
>
(
TypedText
::
UTF16_HIGH_PARAM1
+
(
unicode
>>
TypedText
::
UTF16_HIGH_SHIFT
)
-
TypedText
::
UTF16_HIGH_PARAM2
);
// high
utf16
=
static_cast
<
uint16_t
>
(
TypedText
::
UTF16_HIGH_PARAM1
+
(
unicode
>>
TypedText
::
UTF16_HIGH_SHIFT
)
-
TypedText
::
UTF16_HIGH_PARAM2
);
// high
}
uint16_t
category
=
UTRIE2_GET16
(
reinterpret_cast
<
UTrie2
*>
(
lineBreakTrie_
),
utf16
);
uint16_t
category
=
UTRIE2_GET16
(
reinterpret_cast
<
UTrie2
*>
(
lineBreakTrie_
),
static_cast
<
uint32_t
>
(
utf16
)
);
// 0x4000: remove the dictionary flag bit
if
((
category
&
0x4000
)
!=
0
)
{
// 0x4000: remove the dictionary flag bit
...
...
interfaces/kits/components/ui_button.h
浏览文件 @
3e753dbb
...
...
@@ -334,6 +334,17 @@ public:
*/
int64_t
GetStyle
(
uint8_t
key
)
const
override
;
/**
* @brief Sets the view style.
* @param style Indicates the view style.
* @since 1.0
* @version 1.0
*/
virtual
void
SetStyle
(
Style
&
style
)
override
{
UIView
::
SetStyle
(
style
);
}
/**
* @brief Sets a style.
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录