Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Graphic Ui
提交
2831b4db
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,发现更多精彩内容 >>
提交
2831b4db
编写于
5月 20, 2021
作者:
O
openharmony_ci
提交者:
Gitee
5月 20, 2021
浏览文件
操作
浏览文件
下载
差异文件
!177 修复组件旋转缩放流程,组件设置margin属性后显示不正确
Merge pull request !177 from guyuanzhang/scale
上级
d6e29598
2e01729f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
14 deletion
+15
-14
frameworks/components/root_view.cpp
frameworks/components/root_view.cpp
+15
-14
未找到文件。
frameworks/components/root_view.cpp
浏览文件 @
2831b4db
...
...
@@ -302,7 +302,7 @@ void RootView::OptimizeInvalidView(UIView* curview, UIView* background, List<Rec
Rect
&
invalidRect
=
mapEntry
->
second
.
Front
();
/* Transparent views should draw from background */
if
(((
curview
->
GetStyleConst
().
bgOpa_
!=
OPA_OPAQUE
)
||
(
curview
->
GetOpaScale
()
!=
OPA_OPAQUE
)
||
(
!
curview
->
IsTransInvalid
()))
&&
(
!
curview
->
IsTransInvalid
()))
&&
(
curview
!=
this
))
{
AddInvalidateRect
(
invalidRect
,
background
);
invalidateMap_
.
erase
(
mapEntry
);
...
...
@@ -361,7 +361,7 @@ void RootView::OptimizeInvalidMap()
if
(
curview
->
IsViewGroup
())
{
/* Set background/topview */
if
(((
curview
->
GetStyleConst
().
bgOpa_
==
OPA_OPAQUE
)
&&
(
curview
->
GetOpaScale
()
==
OPA_OPAQUE
)
&&
curview
->
IsTransInvalid
())
||
curview
->
IsTransInvalid
())
||
(
curview
==
this
))
{
background
[
opaStackCount
]
=
curview
;
}
else
{
...
...
@@ -515,10 +515,9 @@ void RootView::BlitMapBuffer(Rect& curViewRect, TransformMap& transMap, const Re
imageInfo
.
header
.
height
=
dc_
.
mapBufferInfo
->
height
;
imageInfo
.
header
.
reserved
=
0
;
imageInfo
.
data
=
reinterpret_cast
<
uint8_t
*>
(
dc_
.
mapBufferInfo
->
virAddr
);
TransformDataInfo
imageTranDataInfo
=
{
imageInfo
.
header
,
imageInfo
.
data
,
pxSize
,
LEVEL0
,
BILINEAR
};
BaseGfxEngine
::
GetInstance
()
->
DrawTransform
(
*
dc_
.
bufferInfo
,
invalidRect
,
{
0
,
0
},
Color
::
Black
(),
OPA_OPAQUE
,
transMap
,
imageTranDataInfo
);
TransformDataInfo
imageTranDataInfo
=
{
imageInfo
.
header
,
imageInfo
.
data
,
pxSize
,
LEVEL0
,
BILINEAR
};
BaseGfxEngine
::
GetInstance
()
->
DrawTransform
(
*
dc_
.
bufferInfo
,
invalidRect
,
{
0
,
0
},
Color
::
Black
(),
OPA_OPAQUE
,
transMap
,
imageTranDataInfo
);
}
}
...
...
@@ -566,8 +565,9 @@ void RootView::DrawTop(UIView* view, const Rect& rect)
origRect
=
curView
->
GetOrigRect
();
relativeRect
=
curView
->
GetRelativeRect
();
curView
->
GetTransformMap
().
SetInvalid
(
true
);
curView
->
SetPosition
(
relativeRect
.
GetX
()
-
origRect
.
GetX
(),
relativeRect
.
GetY
()
-
origRect
.
GetY
());
curView
->
SetPosition
(
relativeRect
.
GetX
()
-
origRect
.
GetX
()
-
curView
->
GetStyle
(
STYLE_MARGIN_LEFT
),
relativeRect
.
GetY
()
-
origRect
.
GetY
()
-
curView
->
GetStyle
(
STYLE_MARGIN_TOP
));
ClearMapBuffer
();
curTransMap
=
curView
->
GetTransformMap
();
...
...
@@ -608,7 +608,8 @@ void RootView::DrawTop(UIView* view, const Rect& rect)
BlitMapBuffer
(
origRect
,
curTransMap
,
mask
);
curView
->
GetTransformMap
().
SetInvalid
(
false
);
enableAnimator
=
false
;
curView
->
SetPosition
(
relativeRect
.
GetX
(),
relativeRect
.
GetY
());
curView
->
SetPosition
(
relativeRect
.
GetX
()
-
curView
->
GetStyle
(
STYLE_MARGIN_LEFT
),
relativeRect
.
GetY
()
-
curView
->
GetStyle
(
STYLE_MARGIN_TOP
));
}
}
}
...
...
@@ -628,7 +629,8 @@ void RootView::DrawTop(UIView* view, const Rect& rect)
BlitMapBuffer
(
origRect
,
curTransMap
,
mask
);
transViewGroup
->
GetTransformMap
().
SetInvalid
(
false
);
enableAnimator
=
false
;
transViewGroup
->
SetPosition
(
relativeRect
.
GetX
(),
relativeRect
.
GetY
());
transViewGroup
->
SetPosition
(
relativeRect
.
GetX
()
-
curView
->
GetStyle
(
STYLE_MARGIN_LEFT
),
relativeRect
.
GetY
()
-
curView
->
GetStyle
(
STYLE_MARGIN_TOP
));
transViewGroup
=
nullptr
;
}
curView
=
g_viewStack
[
stackCount
]
->
GetNextSibling
();
...
...
@@ -703,7 +705,7 @@ bool RootView::FindSubView(const UIView& parentView, const UIView* subView)
void
RootView
::
InitMapBufferInfo
(
BufferInfo
*
bufferInfo
)
{
uint32_t
bufferSize
=
bufferInfo
->
width
*
bufferInfo
->
height
*
(
DrawUtils
::
GetPxSizeByColorMode
(
bufferInfo
->
mode
)
>>
3
);
// 3: Shift right 3 bits
(
DrawUtils
::
GetPxSizeByColorMode
(
bufferInfo
->
mode
)
>>
3
);
// 3: Shift right 3 bits
dc_
.
mapBufferInfo
=
new
BufferInfo
();
if
(
dc_
.
mapBufferInfo
==
nullptr
)
{
...
...
@@ -722,7 +724,7 @@ void RootView::InitMapBufferInfo(BufferInfo* bufferInfo)
void
RootView
::
DestroyMapBufferInfo
()
{
if
(
dc_
.
mapBufferInfo
!=
nullptr
)
{
BaseGfxEngine
::
GetInstance
()
->
FreeBuffer
(
static_cast
<
uint8_t
*>
(
dc_
.
mapBufferInfo
->
virAddr
));
BaseGfxEngine
::
GetInstance
()
->
FreeBuffer
(
static_cast
<
uint8_t
*>
(
dc_
.
mapBufferInfo
->
virAddr
));
dc_
.
mapBufferInfo
->
virAddr
=
dc_
.
mapBufferInfo
->
phyAddr
=
nullptr
;
delete
dc_
.
mapBufferInfo
;
dc_
.
mapBufferInfo
=
nullptr
;
...
...
@@ -751,8 +753,7 @@ void RootView::UpdateBufferInfo(BufferInfo* fbBufferInfo)
dc_
.
bufferInfo
=
fbBufferInfo
;
InitMapBufferInfo
(
fbBufferInfo
);
}
else
{
if
(
dc_
.
bufferInfo
->
width
!=
fbBufferInfo
->
width
||
dc_
.
bufferInfo
->
height
!=
fbBufferInfo
->
height
||
if
(
dc_
.
bufferInfo
->
width
!=
fbBufferInfo
->
width
||
dc_
.
bufferInfo
->
height
!=
fbBufferInfo
->
height
||
dc_
.
bufferInfo
->
mode
!=
fbBufferInfo
->
mode
)
{
DestroyMapBufferInfo
();
InitMapBufferInfo
(
fbBufferInfo
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录