提交 2d44c2ce 编写于 作者: O openharmony_ci 提交者: Gitee

!553 适配LiteOS-M内核编译,增加全量刷新判断宏,增加GIF配置

Merge pull request !553 from SimonLi/master
......@@ -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" ]
}
......@@ -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
......
......@@ -23,12 +23,12 @@
#include "gfx_utils/image_info.h"
#include "gfx_utils/mem_api.h"
#include "imgdecode/cache_manager.h"
#ifndef VERSION_LITE
#if (ENABLE_GIF == 1)
#include "gif_lib.h"
#endif
namespace OHOS {
#ifndef 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)
{
int32_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());
#ifndef VERSION_LITE
#if (ENABLE_GIF == 1)
gifImageAnimator_ = nullptr;
gifFrameFlag_ = false;
#endif
......@@ -239,7 +239,7 @@ UIImageView::UIImageView()
UIImageView::~UIImageView()
{
#ifndef 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)
{
#ifndef VERSION_LITE
#if (ENABLE_GIF == 1)
if (src == nullptr) {
return;
}
......@@ -543,7 +543,7 @@ void UIImageView::ReMeasure()
void UIImageView::SetSrc(const ImageInfo* src)
{
#ifndef VERSION_LITE
#if (ENABLE_GIF == 1)
if (!gifFrameFlag_ && (gifImageAnimator_ != nullptr)) {
RemoveAndStopGifAnimator();
}
......@@ -560,7 +560,7 @@ void UIImageView::SetSrc(const ImageInfo* src)
Invalidate();
}
#ifndef VERSION_LITE
#if (ENABLE_GIF == 1)
void UIImageView::AddAndStartGifAnimator()
{
if (gifImageAnimator_ != nullptr) {
......
......@@ -38,7 +38,7 @@
#include "common/image.h"
#include "components/ui_view.h"
#include "gfx_utils/graphic_types.h"
#ifndef VERSION_LITE
#if (ENABLE_GIF == 1)
#include "animator/animator.h"
#endif
......@@ -309,7 +309,7 @@ protected:
bool transMapInvalid_ = true;
private:
void ReMeasure() override;
#ifndef 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
......@@ -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 = [
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册