Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Graphic Ui
提交
2d44c2ce
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,发现更多精彩内容 >>
提交
2d44c2ce
编写于
12月 02, 2021
作者:
O
openharmony_ci
提交者:
Gitee
12月 02, 2021
浏览文件
操作
浏览文件
下载
差异文件
!553 适配LiteOS-M内核编译,增加全量刷新判断宏,增加GIF配置
Merge pull request !553 from SimonLi/master
上级
68abfc81
ff5b2655
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
91 addition
and
62 deletion
+91
-62
BUILD.gn
BUILD.gn
+66
-40
frameworks/components/root_view.cpp
frameworks/components/root_view.cpp
+9
-0
frameworks/components/ui_image_view.cpp
frameworks/components/ui_image_view.cpp
+8
-8
interfaces/kits/components/ui_image_view.h
interfaces/kits/components/ui_image_view.h
+3
-3
test/framework/BUILD.gn
test/framework/BUILD.gn
+2
-4
test/unittest/BUILD.gn
test/unittest/BUILD.gn
+3
-7
未找到文件。
BUILD.gn
浏览文件 @
2d44c2ce
...
...
@@ -29,20 +29,21 @@ config("graphic_define_config") {
"interfaces/kits",
"interfaces/innerkits",
]
if (ohos_kernel_type != "liteos_m") {
defines = [
"ENABLE_VECTOR_FONT=1",
"ENABLE_BITMAP_FONT=0",
"ENABLE_SHAPING=0",
"ENABLE_ICU=1",
"ENABLE_MULTI_FONT=0",
"DEFAULT_ANIMATION=1",
]
defines = [
"ENABLE_VECTOR_FONT=1",
"ENABLE_BITMAP_FONT=0",
"ENABLE_SHAPING=0",
"ENABLE_ICU=1",
"ENABLE_MULTI_FONT=0",
"DEFAULT_ANIMATION=1"
]
if (ohos_kernel_type == "linux") {
defines += [ "RESOURCE_DIR=\"/storage/data/\"" ]
} else {
defines += [ "RESOURCE_DIR=\"/user/data/\"" ]
if (ohos_kernel_type == "linux") {
defines += [ "RESOURCE_DIR=\"/storage/data/\"" ]
} else {
defines += [ "RESOURCE_DIR=\"/user/data/\"" ]
}
}
}
...
...
@@ -56,15 +57,15 @@ if (enable_graphic_font) {
}
}
shared
_library("ui") {
lite
_library("ui") {
sources = [
"frameworks/animator/animator.cpp",
"frameworks/animator/animator_manager.cpp",
"frameworks/animator/easing_equation.cpp",
"frameworks/animator/interpolation.cpp",
"frameworks/common/graphic_startup.cpp",
"frameworks/common/image_decode_ability.cpp",
"frameworks/common/image.cpp",
"frameworks/common/image_decode_ability.cpp",
"frameworks/common/input_device_manager.cpp",
"frameworks/common/screen.cpp",
"frameworks/common/task.cpp",
...
...
@@ -135,6 +136,8 @@ shared_library("ui") {
"frameworks/draw/draw_rect.cpp",
"frameworks/draw/draw_triangle.cpp",
"frameworks/draw/draw_utils.cpp",
"frameworks/engines/gfx/gfx_engine_manager.cpp",
"frameworks/engines/gfx/hi3516/hi3516_engine.cpp",
"frameworks/events/event.cpp",
"frameworks/font/base_font.cpp",
"frameworks/font/glyphs_manager.cpp",
...
...
@@ -158,34 +161,58 @@ shared_library("ui") {
"frameworks/themes/theme_manager.cpp",
"frameworks/window/window.cpp",
"frameworks/window/window_impl.cpp",
"frameworks/engines/gfx/gfx_engine_manager.cpp",
"frameworks/engines/gfx/hi3516/hi3516_engine.cpp",
]
include_dirs = [ "//foundation/graphic/ui/frameworks" ]
deps = [
"//build/lite/config/component/cJSON:cjson_shared",
"//foundation/graphic/surface:lite_surface",
"//foundation/graphic/utils:lite_graphic_hals",
"//foundation/graphic/wms:lite_wms",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/freetype:freetype",
"//third_party/giflib:libgif",
"//third_party/icu/icu4c/source/common:icu_font",
"//third_party/libjpeg:libjpeg",
"//third_party/libpng:libpng",
"//third_party/qrcodegen:qrcodegen",
]
if (enable_video_component) {
defines += [ "ENABLE_VIDEO_COMPONENT=1" ]
source += [
"frameworks/components/ui_video.cpp",
if (ohos_kernel_type == "liteos_m") {
target_type = "static_library"
include_dirs = [
"frameworks",
"//third_party/freetype/include",
]
deps += [
"//foundation/multimedia/media_lite/frameworks/player_lite:player_lite",
sources -= [
"frameworks/components/ui_surface_view.cpp",
"frameworks/dfx/ui_dump_dom_tree.cpp",
"frameworks/dfx/ui_screenshot.cpp",
"frameworks/engines/gfx/hi3516/hi3516_engine.cpp",
"frameworks/window/window.cpp",
"frameworks/window/window_impl.cpp",
]
deps = [
"//build/lite/config/component/cJSON:cjson_static",
"//third_party/bounds_checking_function:libsec_static",
"//third_party/freetype:freetype",
"//third_party/giflib:libgif",
"//third_party/libjpeg:libjpeg",
"//third_party/libpng:libpng",
"//third_party/qrcodegen:qrcodegen",
]
} else {
target_type = "shared_library"
include_dirs = [ "frameworks" ]
deps = [
"//build/lite/config/component/cJSON:cjson_shared",
"//foundation/graphic/surface:lite_surface",
"//foundation/graphic/utils:lite_graphic_hals",
"//foundation/graphic/wms:lite_wms",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/freetype:freetype",
"//third_party/giflib:libgif",
"//third_party/icu/icu4c/source/common:icu_font",
"//third_party/libjpeg:libjpeg",
"//third_party/libpng:libpng",
"//third_party/qrcodegen:qrcodegen",
]
if (enable_video_component) {
defines += [ "ENABLE_VIDEO_COMPONENT=1" ]
source += [ "frameworks/components/ui_video.cpp" ]
deps += [
"//foundation/multimedia/media_lite/frameworks/player_lite:player_lite",
]
}
ldflags = [ "-Wl,-rpath-link=$ohos_root_path/$root_out_dir" ]
}
public_deps = [ "//foundation/graphic/utils:lite_graphic_utils" ]
...
...
@@ -195,5 +222,4 @@ shared_library("ui") {
"-fno-exceptions",
]
cflags_cc = cflags
ldflags = [ "-Wl,-rpath-link=$ohos_root_path/$root_out_dir" ]
}
frameworks/components/root_view.cpp
浏览文件 @
2d44c2ce
...
...
@@ -529,9 +529,18 @@ void RootView::Render()
invalidateMap_
.
clear
();
#else
if
(
invalidateRects_
.
Size
()
>
0
)
{
#if (FULLY_RENDER != 1)
// only draw invalid rects. in this case, buffers (if there are two buffers or more to display) should keep
// same with each others, because only delta changes write to the buffer between each frames, so it fits one
// buffer to display.
for
(
ListNode
<
Rect
>*
iter
=
invalidateRects_
.
Begin
();
iter
!=
invalidateRects_
.
End
();
iter
=
iter
->
next_
)
{
RenderManager
::
RenderRect
(
iter
->
data_
,
this
);
}
#else
// fully draw whole reacts. in this case, buffers (if there are two buffers or more to display) could be
// independent on each others, so it fits two buffers or more to display.
RenderManager
::
RenderRect
(
GetScreenRect
(),
this
);
#endif
invalidateRects_
.
Clear
();
#endif
...
...
frameworks/components/ui_image_view.cpp
浏览文件 @
2d44c2ce
...
...
@@ -23,12 +23,12 @@
#include "gfx_utils/image_info.h"
#include "gfx_utils/mem_api.h"
#include "imgdecode/cache_manager.h"
#if
ndef VERSION_LITE
#if
(ENABLE_GIF == 1)
#include "gif_lib.h"
#endif
namespace
OHOS
{
#if
ndef VERSION_LITE
#if
(ENABLE_GIF == 1)
class
GifImageAnimator
:
public
Animator
,
public
AnimatorCallback
{
public:
GifImageAnimator
(
UIView
*
view
,
const
char
*
src
)
...
...
@@ -85,7 +85,7 @@ private:
const
void
GifImageAnimator
::
OpenGifFile
(
const
char
*
src
)
{
int
32_t
error
=
D_GIF_SUCCEEDED
;
int
error
=
D_GIF_SUCCEEDED
;
GifFileType
*
gifFileType
=
DGifOpenFileName
(
src
,
&
error
);
if
(
error
!=
D_GIF_SUCCEEDED
)
{
return
;
...
...
@@ -231,7 +231,7 @@ UIImageView::UIImageView()
reserve_
(
0
)
{
style_
=
&
(
StyleDefault
::
GetBackgroundTransparentStyle
());
#if
ndef VERSION_LITE
#if
(ENABLE_GIF == 1)
gifImageAnimator_
=
nullptr
;
gifFrameFlag_
=
false
;
#endif
...
...
@@ -239,7 +239,7 @@ UIImageView::UIImageView()
UIImageView
::~
UIImageView
()
{
#if
ndef VERSION_LITE
#if
(ENABLE_GIF == 1)
RemoveAndStopGifAnimator
();
#endif
if
(
drawTransMap_
!=
nullptr
)
{
...
...
@@ -475,7 +475,7 @@ void UIImageView::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea)
void
UIImageView
::
SetSrc
(
const
char
*
src
)
{
#if
ndef VERSION_LITE
#if
(ENABLE_GIF == 1)
if
(
src
==
nullptr
)
{
return
;
}
...
...
@@ -543,7 +543,7 @@ void UIImageView::ReMeasure()
void
UIImageView
::
SetSrc
(
const
ImageInfo
*
src
)
{
#if
ndef VERSION_LITE
#if
(ENABLE_GIF == 1)
if
(
!
gifFrameFlag_
&&
(
gifImageAnimator_
!=
nullptr
))
{
RemoveAndStopGifAnimator
();
}
...
...
@@ -560,7 +560,7 @@ void UIImageView::SetSrc(const ImageInfo* src)
Invalidate
();
}
#if
ndef VERSION_LITE
#if
(ENABLE_GIF == 1)
void
UIImageView
::
AddAndStartGifAnimator
()
{
if
(
gifImageAnimator_
!=
nullptr
)
{
...
...
interfaces/kits/components/ui_image_view.h
浏览文件 @
2d44c2ce
...
...
@@ -38,7 +38,7 @@
#include "common/image.h"
#include "components/ui_view.h"
#include "gfx_utils/graphic_types.h"
#if
ndef VERSION_LITE
#if
(ENABLE_GIF == 1)
#include "animator/animator.h"
#endif
...
...
@@ -309,7 +309,7 @@ protected:
bool
transMapInvalid_
=
true
;
private:
void
ReMeasure
()
override
;
#if
ndef VERSION_LITE
#if
(ENABLE_GIF == 1)
friend
class
GifImageAnimator
;
void
AddAndStartGifAnimator
();
void
RemoveAndStopGifAnimator
();
...
...
@@ -322,4 +322,4 @@ private:
int16_t
widgetWidth
,
int16_t
widgetHeight
)
const
;
};
}
// namespace OHOS
#endif // GRAPHIC_LITE_UI_IMAGE_VIEW_H
\ No newline at end of file
#endif // GRAPHIC_LITE_UI_IMAGE_VIEW_H
test/framework/BUILD.gn
浏览文件 @
2d44c2ce
...
...
@@ -24,6 +24,7 @@ test_sources = [
"../uitest/test_animator/ui_test_animator.cpp",
"../uitest/test_anti_aliasing/ui_test_anti_aliasing.cpp",
"../uitest/test_arc_label/ui_test_arc_label.cpp",
"../uitest/test_border_margin_padding/ui_test_border_margin_padding.cpp",
"../uitest/test_button/ui_test_button.cpp",
"../uitest/test_canvas/ui_test_canvas.cpp",
"../uitest/test_chart/ui_test_chart_pillar.cpp",
...
...
@@ -66,7 +67,6 @@ test_sources = [
"../uitest/test_view_group/ui_test_view_group.cpp",
"../uitest/test_view_percent/ui_test_view_percent.cpp",
"../uitest/test_view_scale_rotate/ui_test_view_scale_rotate.cpp",
"../uitest/test_border_margin_padding/ui_test_border_margin_padding.cpp",
"common/ui_text_language.cpp",
"src/test_ability.cpp",
"src/test_case_list_adapter.cpp",
...
...
@@ -75,9 +75,7 @@ test_sources = [
]
if (enable_video_component) {
test_sources += [
"../uitest/test_video/ui_test_video.cpp",
]
test_sources += [ "../uitest/test_video/ui_test_video.cpp" ]
}
auto_test_sources = [
...
...
test/unittest/BUILD.gn
浏览文件 @
2d44c2ce
...
...
@@ -65,11 +65,11 @@ if (ohos_build_type == "debug") {
"components/ui_image_unit_test.cpp",
"components/ui_label_button_unit_test.cpp",
"components/ui_label_unit_test.cpp",
"components/ui_list_unit_test.cpp",
"components/ui_picker_unit_test.cpp",
"components/ui_qrcode_unit_test.cpp",
"components/ui_radio_button_unit_test.cpp",
"components/ui_repeat_button_unit_test.cpp",
"components/ui_list_unit_test.cpp",
"components/ui_scroll_bar_test.cpp",
"components/ui_scroll_view_unit_test.cpp",
"components/ui_slider_unit_test.cpp",
...
...
@@ -101,14 +101,10 @@ if (ohos_build_type == "debug") {
"themes/theme_manager_unit_test.cpp",
]
deps = [
"//foundation/graphic/ui:ui",
]
deps = [ "//foundation/graphic/ui:ui" ]
if (enable_video_component) {
sources += [
"components/ui_video_unit_test.cpp",
]
sources += [ "components/ui_video_unit_test.cpp" ]
deps += [
"//foundation/multimedia/media_lite/frameworks/player_lite:player_lite",
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录