Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Graphic Ui
提交
9f199e77
G
Graphic Ui
项目概览
OpenHarmony
/
Graphic Ui
11 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
9f199e77
编写于
7月 12, 2021
作者:
O
openharmony_ci
提交者:
Gitee
7月 12, 2021
浏览文件
操作
浏览文件
下载
差异文件
!276 回退HILOG修改
Merge pull request !276 from YueBiang/hilog
上级
b9132fb4
664e17e6
变更
53
隐藏空白更改
内联
并排
Showing
53 changed file
with
262 addition
and
286 deletion
+262
-286
frameworks/animator/animator_manager.cpp
frameworks/animator/animator_manager.cpp
+1
-2
frameworks/common/graphic_startup.cpp
frameworks/common/graphic_startup.cpp
+6
-6
frameworks/common/image.cpp
frameworks/common/image.cpp
+4
-4
frameworks/common/input_device_manager.cpp
frameworks/common/input_device_manager.cpp
+1
-1
frameworks/common/text.cpp
frameworks/common/text.cpp
+1
-1
frameworks/common/typed_text.cpp
frameworks/common/typed_text.cpp
+10
-10
frameworks/components/root_view.cpp
frameworks/components/root_view.cpp
+1
-1
frameworks/components/ui_abstract_progress.cpp
frameworks/components/ui_abstract_progress.cpp
+7
-7
frameworks/components/ui_analog_clock.cpp
frameworks/components/ui_analog_clock.cpp
+2
-2
frameworks/components/ui_arc_label.cpp
frameworks/components/ui_arc_label.cpp
+0
-12
frameworks/components/ui_box_progress.cpp
frameworks/components/ui_box_progress.cpp
+5
-5
frameworks/components/ui_button.cpp
frameworks/components/ui_button.cpp
+3
-3
frameworks/components/ui_canvas.cpp
frameworks/components/ui_canvas.cpp
+10
-10
frameworks/components/ui_dialog.cpp
frameworks/components/ui_dialog.cpp
+10
-10
frameworks/components/ui_digital_clock.cpp
frameworks/components/ui_digital_clock.cpp
+1
-1
frameworks/components/ui_image_view.cpp
frameworks/components/ui_image_view.cpp
+1
-2
frameworks/components/ui_label.cpp
frameworks/components/ui_label.cpp
+1
-1
frameworks/components/ui_label_button.cpp
frameworks/components/ui_label_button.cpp
+0
-13
frameworks/components/ui_list.cpp
frameworks/components/ui_list.cpp
+2
-2
frameworks/components/ui_picker.cpp
frameworks/components/ui_picker.cpp
+0
-12
frameworks/components/ui_qrcode.cpp
frameworks/components/ui_qrcode.cpp
+8
-9
frameworks/components/ui_scroll_view.cpp
frameworks/components/ui_scroll_view.cpp
+1
-1
frameworks/components/ui_slider.cpp
frameworks/components/ui_slider.cpp
+7
-7
frameworks/components/ui_surface_view.cpp
frameworks/components/ui_surface_view.cpp
+9
-10
frameworks/components/ui_swipe_view.cpp
frameworks/components/ui_swipe_view.cpp
+1
-1
frameworks/components/ui_time_picker.cpp
frameworks/components/ui_time_picker.cpp
+1
-1
frameworks/components/ui_video.cpp
frameworks/components/ui_video.cpp
+11
-12
frameworks/components/ui_view.cpp
frameworks/components/ui_view.cpp
+5
-20
frameworks/components/ui_view_group.cpp
frameworks/components/ui_view_group.cpp
+4
-4
frameworks/core/task_manager.cpp
frameworks/core/task_manager.cpp
+1
-1
frameworks/dfx/event_injector.cpp
frameworks/dfx/event_injector.cpp
+7
-11
frameworks/dfx/key_event_injector.cpp
frameworks/dfx/key_event_injector.cpp
+2
-2
frameworks/dfx/point_event_injector.cpp
frameworks/dfx/point_event_injector.cpp
+2
-2
frameworks/dfx/ui_dump_dom_tree.cpp
frameworks/dfx/ui_dump_dom_tree.cpp
+9
-9
frameworks/dfx/ui_screenshot.cpp
frameworks/dfx/ui_screenshot.cpp
+6
-11
frameworks/dock/pointer_input_device.cpp
frameworks/dock/pointer_input_device.cpp
+1
-1
frameworks/dock/screen_device_proxy.cpp
frameworks/dock/screen_device_proxy.cpp
+4
-4
frameworks/draw/clip_utils.cpp
frameworks/draw/clip_utils.cpp
+1
-1
frameworks/draw/draw_label.cpp
frameworks/draw/draw_label.cpp
+1
-1
frameworks/draw/draw_rect.cpp
frameworks/draw/draw_rect.cpp
+1
-1
frameworks/draw/draw_utils.cpp
frameworks/draw/draw_utils.cpp
+1
-1
frameworks/font/glyphs_manager.cpp
frameworks/font/glyphs_manager.cpp
+26
-26
frameworks/font/ui_font_bitmap.cpp
frameworks/font/ui_font_bitmap.cpp
+11
-11
frameworks/imgdecode/cache_manager.cpp
frameworks/imgdecode/cache_manager.cpp
+1
-1
frameworks/imgdecode/image_load.cpp
frameworks/imgdecode/image_load.cpp
+6
-6
frameworks/window/window_impl.cpp
frameworks/window/window_impl.cpp
+12
-12
interfaces/kits/components/ui_arc_label.h
interfaces/kits/components/ui_arc_label.h
+10
-1
interfaces/kits/components/ui_label_button.h
interfaces/kits/components/ui_label_button.h
+12
-1
interfaces/kits/components/ui_picker.h
interfaces/kits/components/ui_picker.h
+10
-1
interfaces/kits/components/ui_view.h
interfaces/kits/components/ui_view.h
+14
-1
test/framework/src/compare_tools.cpp
test/framework/src/compare_tools.cpp
+7
-7
test/uitest/test_ui_dump_dom_tree/ui_test_dump_dom.cpp
test/uitest/test_ui_dump_dom_tree/ui_test_dump_dom.cpp
+3
-3
test/unittest/dfx/event_injector_unit_test.cpp
test/unittest/dfx/event_injector_unit_test.cpp
+1
-1
未找到文件。
frameworks/animator/animator_manager.cpp
浏览文件 @
9f199e77
...
...
@@ -16,7 +16,6 @@
#include "animator/animator_manager.h"
#include "common/task_manager.h"
#include "gfx_utils/graphic_log.h"
#include "hal_tick.h"
namespace
OHOS
{
...
...
@@ -40,7 +39,7 @@ void AnimatorManager::Add(Animator* animator)
ListNode
<
Animator
*>*
pos
=
list_
.
Begin
();
while
(
pos
!=
list_
.
End
())
{
if
(
pos
->
data_
==
animator
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"do not add animator multi times"
);
GRAPHIC_LOGI
(
"do not add animator multi times"
);
return
;
}
pos
=
pos
->
next_
;
...
...
frameworks/common/graphic_startup.cpp
浏览文件 @
9f199e77
...
...
@@ -49,19 +49,19 @@ void GraphicStartUp::InitFontEngine(uintptr_t cacheMemAddr,
{
UIFont
*
uiFont
=
UIFont
::
GetInstance
();
if
(
uiFont
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"Get UIFont error"
);
GRAPHIC_LOGE
(
"Get UIFont error"
);
return
;
}
uiFont
->
SetPsramMemory
(
cacheMemAddr
,
cacheMemLen
);
int8_t
ret
=
uiFont
->
SetFontPath
(
const_cast
<
char
*>
(
dPath
),
nullptr
);
if
(
ret
==
INVALID_RET_VALUE
)
{
HILOG_WARN
(
HILOG_MODULE_GRAPHIC
,
"SetFontPath failed"
);
GRAPHIC_LOGW
(
"SetFontPath failed"
);
}
if
(
uiFont
->
IsVectorFont
())
{
if
(
ttfName
!=
nullptr
)
{
uint8_t
ret2
=
uiFont
->
RegisterFontInfo
(
ttfName
);
if
(
ret2
==
INVALID_UCHAR_ID
)
{
HILOG_WARN
(
HILOG_MODULE_GRAPHIC
,
"SetTtfName failed"
);
GRAPHIC_LOGW
(
"SetTtfName failed"
);
}
}
}
else
{
...
...
@@ -79,7 +79,7 @@ void GraphicStartUp::InitLineBreakEngine(uintptr_t cacheMemAddr, uint32_t cacheM
uint32_t
len
=
static_cast
<
uint32_t
>
(
strlen
(
path
)
+
strlen
(
fileName
)
+
1
);
char
*
lineBreakRuleFile
=
reinterpret_cast
<
char
*>
(
UIMalloc
(
len
));
if
(
lineBreakRuleFile
==
nullptr
)
{
HILOG_WARN
(
HILOG_MODULE_GRAPHIC
,
"UIMalloc failed"
);
GRAPHIC_LOGW
(
"UIMalloc failed"
);
return
;
}
if
(
strcpy_s
(
lineBreakRuleFile
,
len
,
path
)
!=
EOK
)
{
...
...
@@ -101,7 +101,7 @@ void GraphicStartUp::InitLineBreakEngine(uintptr_t cacheMemAddr, uint32_t cacheM
if
(
fp
<
0
)
{
UIFree
(
reinterpret_cast
<
void
*>
(
lineBreakRuleFile
));
lineBreakRuleFile
=
nullptr
;
HILOG_WARN
(
HILOG_MODULE_GRAPHIC
,
"Open lineBreak rule file failed"
);
GRAPHIC_LOGW
(
"Open lineBreak rule file failed"
);
return
;
}
int32_t
lineBreakSize
=
lseek
(
fp
,
0
,
SEEK_END
);
...
...
@@ -139,7 +139,7 @@ void GraphicStartUp::Init()
#ifdef VERSION_STANDARD
OHOSInputDevice
*
input
=
new
OHOSInputDevice
();
if
(
input
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new OHOSInputDevice fail"
);
GRAPHIC_LOGE
(
"new OHOSInputDevice fail"
);
return
;
}
InputDeviceManager
::
GetInstance
()
->
Add
(
input
);
...
...
frameworks/common/image.cpp
浏览文件 @
9f199e77
...
...
@@ -69,7 +69,7 @@ Image::ImageType Image::CheckImgType(const char* src)
int32_t
fd
=
open
(
src
,
O_RDONLY
);
#endif
if
(
fd
<
0
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"can't open %s
\n
"
,
src
);
GRAPHIC_LOGE
(
"can't open %s
\n
"
,
src
);
return
IMG_UNKNOWN
;
}
if
(
read
(
fd
,
buf
,
IMG_BYTES_TO_CHECK
)
!=
IMG_BYTES_TO_CHECK
)
{
...
...
@@ -235,7 +235,7 @@ void Image::DrawImage(BufferInfo& gfxDstBuffer,
}
else
if
(
srcType_
==
IMG_SRC_FILE
)
{
DrawImage
::
DrawCommon
(
gfxDstBuffer
,
coords
,
mask
,
path_
,
style
,
opaScale
);
}
else
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"Image::DrawImage:: failed with error srctype!
\n
"
);
GRAPHIC_LOGE
(
"Image::DrawImage:: failed with error srctype!
\n
"
);
}
}
...
...
@@ -256,7 +256,7 @@ bool Image::SetPNGSrc(const char* src)
return
false
;
}
if
((
infile
=
fopen
(
src
,
"rb"
))
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"can't open %s
\n
"
,
src
);
GRAPHIC_LOGE
(
"can't open %s
\n
"
,
src
);
srcType_
=
IMG_SRC_UNKNOWN
;
png_destroy_read_struct
(
&
png
,
&
info
,
nullptr
);
return
false
;
...
...
@@ -380,7 +380,7 @@ bool Image::SetJPEGSrc(const char* src)
FILE
*
infile
=
nullptr
;
if
((
infile
=
fopen
(
src
,
"rb"
))
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"can't open %s
\n
"
,
src
);
GRAPHIC_LOGE
(
"can't open %s
\n
"
,
src
);
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
}
...
...
frameworks/common/input_device_manager.cpp
浏览文件 @
9f199e77
...
...
@@ -35,7 +35,7 @@ void InputDeviceManager::Init()
void
InputDeviceManager
::
Add
(
InputDevice
*
device
)
{
if
(
device
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"InputDeviceManager::Add invalid param
\n
"
);
GRAPHIC_LOGE
(
"InputDeviceManager::Add invalid param
\n
"
);
return
;
}
deviceList_
.
PushBack
(
device
);
...
...
frameworks/common/text.cpp
浏览文件 @
9f199e77
...
...
@@ -130,7 +130,7 @@ void Text::SetFont(const char* name, uint8_t size, char*& destName, uint8_t& des
void
Text
::
SetFontId
(
uint8_t
fontId
)
{
if
((
fontId
>=
UIFontBuilder
::
GetInstance
()
->
GetTotalFontId
())
||
(
fontId_
==
fontId
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"Text::SetFontId invalid fontId(%d)"
,
fontId
);
GRAPHIC_LOGE
(
"Text::SetFontId invalid fontId(%d)"
,
fontId
);
return
;
}
UITextLanguageFontParam
*
fontParam
=
UIFontBuilder
::
GetInstance
()
->
GetTextLangFontsTable
(
fontId
);
...
...
frameworks/common/typed_text.cpp
浏览文件 @
9f199e77
...
...
@@ -27,7 +27,7 @@ Point TypedText::GetTextSize(const char* text, int16_t letterSpace, int16_t line
Point
size
{
0
,
0
};
if
(
text
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"TypedText::GetTextSize invalid parameter"
);
GRAPHIC_LOGE
(
"TypedText::GetTextSize invalid parameter"
);
return
size
;
}
...
...
@@ -69,7 +69,7 @@ Rect TypedText::GetArcTextRect(const char* text,
const
UIArcLabel
::
ArcTextInfo
&
arcTextInfo
)
{
if
((
text
==
nullptr
)
||
(
arcTextInfo
.
lineStart
==
arcTextInfo
.
lineEnd
)
||
(
arcTextInfo
.
radius
==
0
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"TypedText::GetArcTextRect invalid parameter
\n
"
);
GRAPHIC_LOGE
(
"TypedText::GetArcTextRect invalid parameter
\n
"
);
return
Rect
();
}
...
...
@@ -229,7 +229,7 @@ bool TypedText::GetWrapPoint(const char* text, uint32_t& breakPoint)
int16_t
TypedText
::
GetTextWidth
(
const
char
*
text
,
uint16_t
length
,
int16_t
letterSpace
)
{
if
((
text
==
nullptr
)
||
(
length
==
0
)
||
(
length
>
strlen
(
text
)))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"TypedText::GetTextWidth invalid parameter
\n
"
);
GRAPHIC_LOGE
(
"TypedText::GetTextWidth invalid parameter
\n
"
);
return
0
;
}
...
...
@@ -273,7 +273,7 @@ uint32_t TypedText::GetUTF8Next(const char* text, uint32_t i, uint32_t& j)
{
uint32_t
unicode
=
0
;
if
(
text
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"text invalid parameter"
);
GRAPHIC_LOGE
(
"text invalid parameter"
);
return
0
;
}
...
...
@@ -312,7 +312,7 @@ uint32_t TypedText::GetUTF8Next(const char* text, uint32_t i, uint32_t& j)
uint32_t
TypedText
::
GetByteIndexFromUTF8Id
(
const
char
*
text
,
uint32_t
utf8Id
)
{
if
(
text
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"TypedText::GetByteIndexFromUTF8Id text invalid parameter
\n
"
);
GRAPHIC_LOGE
(
"TypedText::GetByteIndexFromUTF8Id text invalid parameter
\n
"
);
return
0
;
}
uint32_t
byteIndex
=
0
;
...
...
@@ -329,7 +329,7 @@ uint32_t TypedText::GetUTF8CharacterSize(const char* text, uint32_t byteIndex)
uint32_t
size
=
0
;
if
(
text
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"TypedText::GetUTF8CharacterSize text invalid parameter
\n
"
);
GRAPHIC_LOGE
(
"TypedText::GetUTF8CharacterSize text invalid parameter
\n
"
);
return
0
;
}
while
((
text
[
i
]
!=
'\0'
)
&&
(
i
<
byteIndex
))
{
...
...
@@ -343,7 +343,7 @@ uint32_t TypedText::GetUTF8CharacterSize(const char* text, uint32_t byteIndex)
void
TypedText
::
Utf8ToUtf16
(
const
char
*
utf8Str
,
uint16_t
*
utf16Str
,
uint32_t
len
)
{
if
((
utf8Str
==
nullptr
)
||
(
utf16Str
==
nullptr
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"utf8Str or u16Str is null"
);
GRAPHIC_LOGE
(
"utf8Str or u16Str is null"
);
return
;
}
...
...
@@ -362,7 +362,7 @@ void TypedText::Utf8ToUtf16(const char* utf8Str, uint16_t* utf16Str, uint32_t le
UTF16_HIGH_PARAM2
);
// high
}
}
else
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"Invalid unicode"
);
GRAPHIC_LOGE
(
"Invalid unicode"
);
return
;
}
cnt
++
;
...
...
@@ -373,7 +373,7 @@ void TypedText::Utf8ToUtf16(const char* utf8Str, uint16_t* utf16Str, uint32_t le
uint32_t
TypedText
::
GetUtf16Cnt
(
const
char
*
utf8Str
)
{
if
(
utf8Str
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"text invalid parameter"
);
GRAPHIC_LOGE
(
"text invalid parameter"
);
return
0
;
}
uint32_t
len
=
0
;
...
...
@@ -386,7 +386,7 @@ uint32_t TypedText::GetUtf16Cnt(const char* utf8Str)
}
else
if
(
unicode
<=
MAX_UINT16_HIGH_SCOPE
)
{
len
+=
2
;
// 2: low and high, two uint16_t numbers
}
else
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"Invalid unicode"
);
GRAPHIC_LOGE
(
"Invalid unicode"
);
return
0
;
}
}
...
...
frameworks/components/root_view.cpp
浏览文件 @
9f199e77
...
...
@@ -526,7 +526,7 @@ void RootView::ClearMapBuffer()
uint8_t
pxSize
=
DrawUtils
::
GetPxSizeByColorMode
(
dc_
.
mapBufferInfo
->
mode
);
uint32_t
dataSize
=
dc_
.
mapBufferInfo
->
width
*
dc_
.
mapBufferInfo
->
height
*
(
pxSize
>>
3
);
if
(
memset_s
(
dc_
.
mapBufferInfo
->
virAddr
,
dataSize
,
0
,
dataSize
)
!=
EOK
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"animator buffer memset failed."
);
GRAPHIC_LOGE
(
"animator buffer memset failed."
);
}
}
...
...
frameworks/components/ui_abstract_progress.cpp
浏览文件 @
9f199e77
...
...
@@ -81,7 +81,7 @@ void UIAbstractProgress::SetRange(int32_t rangeMax, int32_t rangeMin)
lastValue_
=
rangeMin
;
SetValue
(
curValue_
);
}
else
{
HILOG_WARN
(
HILOG_MODULE_GRAPHIC
,
"UIAbstractProgress::SetRange rangeMax less than rangeMin !
\n
"
);
GRAPHIC_LOGW
(
"UIAbstractProgress::SetRange rangeMax less than rangeMin !
\n
"
);
}
};
...
...
@@ -142,7 +142,7 @@ void UIAbstractProgress::SetBackgroundStyle(const Style& style)
if
(
!
backgroundStyleAllocFlag_
)
{
backgroundStyle_
=
new
Style
();
if
(
backgroundStyle_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Style1 fail"
);
GRAPHIC_LOGE
(
"new Style1 fail"
);
return
;
}
backgroundStyleAllocFlag_
=
true
;
...
...
@@ -155,7 +155,7 @@ void UIAbstractProgress::SetBackgroundStyle(uint8_t key, int64_t value)
if
(
!
backgroundStyleAllocFlag_
)
{
backgroundStyle_
=
new
Style
(
*
backgroundStyle_
);
if
(
backgroundStyle_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Style1 fail"
);
GRAPHIC_LOGE
(
"new Style1 fail"
);
return
;
}
backgroundStyleAllocFlag_
=
true
;
...
...
@@ -178,7 +178,7 @@ void UIAbstractProgress::SetForegroundStyle(const Style& style)
if
(
!
foregroundStyleAllocFlag_
)
{
foregroundStyle_
=
new
Style
();
if
(
foregroundStyle_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Style1 fail"
);
GRAPHIC_LOGE
(
"new Style1 fail"
);
return
;
}
foregroundStyleAllocFlag_
=
true
;
...
...
@@ -191,7 +191,7 @@ void UIAbstractProgress::SetForegroundStyle(uint8_t key, int64_t value)
if
(
!
foregroundStyleAllocFlag_
)
{
foregroundStyle_
=
new
Style
(
*
foregroundStyle_
);
if
(
foregroundStyle_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Style1 fail"
);
GRAPHIC_LOGE
(
"new Style1 fail"
);
return
;
}
foregroundStyleAllocFlag_
=
true
;
...
...
@@ -214,14 +214,14 @@ bool UIAbstractProgress::InitImage()
if
(
backgroundImage_
==
nullptr
)
{
backgroundImage_
=
new
Image
();
if
(
backgroundImage_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Image fail"
);
GRAPHIC_LOGE
(
"new Image fail"
);
return
false
;
}
}
if
(
foregroundImage_
==
nullptr
)
{
foregroundImage_
=
new
Image
();
if
(
foregroundImage_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Image fail"
);
GRAPHIC_LOGE
(
"new Image fail"
);
return
false
;
}
}
...
...
frameworks/components/ui_analog_clock.cpp
浏览文件 @
9f199e77
...
...
@@ -158,7 +158,7 @@ uint16_t UIAnalogClock::ConvertHandValueToAngle(uint8_t handValue, uint8_t range
uint8_t
secondHandValue
,
uint8_t
ratio
)
const
{
if
((
range
==
0
)
||
(
ratio
==
0
))
{
HILOG_WARN
(
HILOG_MODULE_GRAPHIC
,
"UIAnalogClock::ConvertHandValueToAngle Invalid range or ratio
\n
"
);
GRAPHIC_LOGW
(
"UIAnalogClock::ConvertHandValueToAngle Invalid range or ratio
\n
"
);
return
0
;
}
/*
...
...
@@ -175,7 +175,7 @@ uint16_t UIAnalogClock::ConvertHandValueToAngle(uint8_t handValue, uint8_t range
uint16_t
UIAnalogClock
::
ConvertHandValueToAngle
(
uint8_t
handValue
,
uint8_t
range
)
const
{
if
(
range
==
0
)
{
HILOG_WARN
(
HILOG_MODULE_GRAPHIC
,
"UIAnalogClock::ConvertHandValueToAngle Invalid range or ratio
\n
"
);
GRAPHIC_LOGW
(
"UIAnalogClock::ConvertHandValueToAngle Invalid range or ratio
\n
"
);
return
0
;
}
/*
...
...
frameworks/components/ui_arc_label.cpp
浏览文件 @
9f199e77
...
...
@@ -18,7 +18,6 @@
#include "draw/draw_label.h"
#include "engines/gfx/gfx_engine_manager.h"
#include "font/ui_font.h"
#include "gfx_utils/graphic_log.h"
#include "themes/theme_manager.h"
namespace
OHOS
{
...
...
@@ -210,15 +209,4 @@ void UIArcLabel::MeasureArcTextInfo()
arcTextInfo_
.
direct
,
orientation_
);
}
}
void
UIArcLabel
::
InitArcLabelText
()
{
if
(
arcLabelText_
==
nullptr
)
{
arcLabelText_
=
new
Text
();
if
(
arcLabelText_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Text fail"
);
return
;
}
}
}
}
// namespace OHOS
\ No newline at end of file
frameworks/components/ui_box_progress.cpp
浏览文件 @
9f199e77
...
...
@@ -52,7 +52,7 @@ void UIBoxProgress::DrawValidRect(BufferInfo& gfxDstBuffer,
cordsTmp
.
SetPosition
(
area
.
GetLeft
(),
area
.
GetBottom
()
+
radius
-
header
.
height
);
break
;
default:
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIBoxProgress: DrawValidRect direction Err!
\n
"
);
GRAPHIC_LOGE
(
"UIBoxProgress: DrawValidRect direction Err!
\n
"
);
break
;
}
cordsTmp
.
SetHeight
(
header
.
height
);
...
...
@@ -109,7 +109,7 @@ void UIBoxProgress::DrawRoundCap(BufferInfo& gfxDstBuffer,
break
;
}
default:
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIBoxProgress: DrawRoundCap direction Err!
\n
"
);
GRAPHIC_LOGE
(
"UIBoxProgress: DrawRoundCap direction Err!
\n
"
);
break
;
}
...
...
@@ -194,7 +194,7 @@ void UIBoxProgress::DrawRoundCap(BufferInfo& gfxDstBuffer,
break
;
}
default:
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIBoxProgress: DrawRoundCap direction Err!
\n
"
);
GRAPHIC_LOGE
(
"UIBoxProgress: DrawRoundCap direction Err!
\n
"
);
break
;
}
}
...
...
@@ -230,7 +230,7 @@ void UIBoxProgress::GetBackgroundParam(Point& startPoint,
startPoint
.
y
+=
radius
;
break
;
default:
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIBoxProgress: GetBackgroundParam direction Err!
\n
"
);
GRAPHIC_LOGE
(
"UIBoxProgress: GetBackgroundParam direction Err!
\n
"
);
return
;
}
}
...
...
@@ -282,7 +282,7 @@ void UIBoxProgress::DrawForeground(BufferInfo& gfxDstBuffer, const Rect& invalid
break
;
}
default:
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIBoxProgress: DrawForeground direction Err!
\n
"
);
GRAPHIC_LOGE
(
"UIBoxProgress: DrawForeground direction Err!
\n
"
);
return
;
}
}
...
...
frameworks/components/ui_button.cpp
浏览文件 @
9f199e77
...
...
@@ -135,7 +135,7 @@ void UIButton::SetStyleForState(uint8_t key, int64_t value, ButtonState state)
Style
styleSaved
=
*
buttonStyles_
[
i
];
buttonStyles_
[
i
]
=
new
Style
;
if
(
buttonStyles_
[
i
]
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Style fail"
);
GRAPHIC_LOGE
(
"new Style fail"
);
return
;
}
*
(
buttonStyles_
[
i
])
=
styleSaved
;
...
...
@@ -257,14 +257,14 @@ bool UIButton::InitImage()
if
(
defaultImgSrc_
==
nullptr
)
{
defaultImgSrc_
=
new
Image
();
if
(
defaultImgSrc_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Image fail"
);
GRAPHIC_LOGE
(
"new Image fail"
);
return
false
;
}
}
if
(
triggeredImgSrc_
==
nullptr
)
{
triggeredImgSrc_
=
new
Image
();
if
(
triggeredImgSrc_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Image fail"
);
GRAPHIC_LOGE
(
"new Image fail"
);
return
false
;
}
}
...
...
frameworks/components/ui_canvas.cpp
浏览文件 @
9f199e77
...
...
@@ -38,7 +38,7 @@ void UICanvas::BeginPath()
path_
=
new
UICanvasPath
();
if
(
path_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UICanvasPath fail"
);
GRAPHIC_LOGE
(
"new UICanvasPath fail"
);
return
;
}
}
...
...
@@ -187,7 +187,7 @@ void UICanvas::DrawLine(const Point& startPoint, const Point& endPoint, const Pa
{
LineParam
*
lineParam
=
new
LineParam
;
if
(
lineParam
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new LineParam fail"
);
GRAPHIC_LOGE
(
"new LineParam fail"
);
return
;
}
lineParam
->
start
=
startPoint
;
...
...
@@ -217,7 +217,7 @@ void UICanvas::DrawCurve(const Point& startPoint,
{
CurveParam
*
curveParam
=
new
CurveParam
;
if
(
curveParam
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new CurveParam fail"
);
GRAPHIC_LOGE
(
"new CurveParam fail"
);
return
;
}
curveParam
->
start
=
startPoint
;
...
...
@@ -244,7 +244,7 @@ void UICanvas::DrawRect(const Point& startPoint, int16_t height, int16_t width,
if
(
static_cast
<
uint8_t
>
(
paint
.
GetStyle
())
&
Paint
::
PaintStyle
::
STROKE_STYLE
)
{
RectParam
*
rectParam
=
new
RectParam
;
if
(
rectParam
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new RectParam fail"
);
GRAPHIC_LOGE
(
"new RectParam fail"
);
return
;
}
rectParam
->
start
=
startPoint
;
...
...
@@ -262,7 +262,7 @@ void UICanvas::DrawRect(const Point& startPoint, int16_t height, int16_t width,
if
(
static_cast
<
uint8_t
>
(
paint
.
GetStyle
())
&
Paint
::
PaintStyle
::
FILL_STYLE
)
{
RectParam
*
rectParam
=
new
RectParam
;
if
(
rectParam
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new RectParam fail"
);
GRAPHIC_LOGE
(
"new RectParam fail"
);
return
;
}
rectParam
->
start
=
startPoint
;
...
...
@@ -284,7 +284,7 @@ void UICanvas::DrawCircle(const Point& center, uint16_t radius, const Paint& pai
{
CircleParam
*
circleParam
=
new
CircleParam
;
if
(
circleParam
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new CircleParam fail"
);
GRAPHIC_LOGE
(
"new CircleParam fail"
);
return
;
}
circleParam
->
center
=
center
;
...
...
@@ -321,7 +321,7 @@ void UICanvas::DrawArc(const Point& center, uint16_t radius, int16_t startAngle,
if
(
static_cast
<
uint8_t
>
(
paint
.
GetStyle
())
&
Paint
::
PaintStyle
::
STROKE_STYLE
)
{
ArcParam
*
arcParam
=
new
ArcParam
;
if
(
arcParam
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new ArcParam fail"
);
GRAPHIC_LOGE
(
"new ArcParam fail"
);
return
;
}
arcParam
->
center
=
center
;
...
...
@@ -364,7 +364,7 @@ void UICanvas::DrawLabel(const Point& startPoint,
if
(
static_cast
<
uint8_t
>
(
paint
.
GetStyle
())
&
Paint
::
PaintStyle
::
FILL_STYLE
)
{
UILabel
*
label
=
new
UILabel
();
if
(
label
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UILabel fail"
);
GRAPHIC_LOGE
(
"new UILabel fail"
);
return
;
}
label
->
SetLineBreakMode
(
UILabel
::
LINE_BREAK_CLIP
);
...
...
@@ -397,7 +397,7 @@ void UICanvas::DrawImage(const Point& startPoint, const char* image, const Paint
ImageParam
*
imageParam
=
new
ImageParam
;
if
(
imageParam
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new ImageParam fail"
);
GRAPHIC_LOGE
(
"new ImageParam fail"
);
return
;
}
imageParam
->
image
=
new
Image
();
...
...
@@ -433,7 +433,7 @@ void UICanvas::DrawPath(const Paint& paint)
path_
->
strokeCount_
++
;
PathParam
*
param
=
new
PathParam
;
if
(
param
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new PathParam fail"
);
GRAPHIC_LOGE
(
"new PathParam fail"
);
return
;
}
param
->
path
=
path_
;
...
...
frameworks/components/ui_dialog.cpp
浏览文件 @
9f199e77
...
...
@@ -173,7 +173,7 @@ void UIDialog::SetButton(DialogButtonType buttonType, const char* text, UIView::
if
(
button1_
==
nullptr
)
{
button1_
=
new
UIDialogLabelButton
(
this
);
if
(
button1_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UIDialogLabelButton fail"
);
GRAPHIC_LOGE
(
"new UIDialogLabelButton fail"
);
return
;
}
button1_
->
SetViewId
(
BUTTON1_ID
);
...
...
@@ -187,7 +187,7 @@ void UIDialog::SetButton(DialogButtonType buttonType, const char* text, UIView::
if
(
button2_
==
nullptr
)
{
button2_
=
new
UIDialogLabelButton
(
this
);
if
(
button2_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UIDialogLabelButton fail"
);
GRAPHIC_LOGE
(
"new UIDialogLabelButton fail"
);
return
;
}
button2_
->
SetViewId
(
BUTTON2_ID
);
...
...
@@ -201,7 +201,7 @@ void UIDialog::SetButton(DialogButtonType buttonType, const char* text, UIView::
if
(
button3_
==
nullptr
)
{
button3_
=
new
UIDialogLabelButton
(
this
);
if
(
button3_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UIDialogLabelButton fail"
);
GRAPHIC_LOGE
(
"new UIDialogLabelButton fail"
);
return
;
}
AddButton
(
buttonType
,
button3_
,
text
,
listener
);
...
...
@@ -257,7 +257,7 @@ void UIDialog::SetTitleLabel()
if
(
title_
==
nullptr
)
{
title_
=
new
UILabel
();
if
(
title_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UILabel fail"
);
GRAPHIC_LOGE
(
"new UILabel fail"
);
return
;
}
title_
->
SetViewId
(
TITLE_ID
);
...
...
@@ -278,7 +278,7 @@ void UIDialog::SetTextLabel()
if
(
text_
==
nullptr
)
{
text_
=
new
UILabel
();
if
(
text_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UILabel fail"
);
GRAPHIC_LOGE
(
"new UILabel fail"
);
return
;
}
text_
->
SetFont
(
DEFAULT_VECTOR_FONT_FILENAME
,
TEXT_FONT_SIZE
);
...
...
@@ -294,7 +294,7 @@ void UIDialog::InitDialog()
if
(
dialogLayer_
==
nullptr
)
{
dialogLayer_
=
new
UIViewGroup
();
if
(
dialogLayer_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UIViewGroup fail"
);
GRAPHIC_LOGE
(
"new UIViewGroup fail"
);
return
;
}
dialogLayer_
->
SetStyle
(
STYLE_BACKGROUND_COLOR
,
Color
::
White
().
full
);
...
...
@@ -309,7 +309,7 @@ void UIDialog::InitDialog()
if
(
dialogClickListener_
==
nullptr
)
{
dialogClickListener_
=
new
UIDialogClickListener
(
this
);
if
(
dialogClickListener_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UIDialogClickListener fail"
);
GRAPHIC_LOGE
(
"new UIDialogClickListener fail"
);
return
;
}
windowRootView_
->
SetOnClickListener
(
dialogClickListener_
);
...
...
@@ -336,7 +336,7 @@ void UIDialog::AddComponents()
if
(
buttonNum_
>
1
)
{
line1_
=
new
UIView
();
if
(
line1_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UIView fail"
);
GRAPHIC_LOGE
(
"new UIView fail"
);
return
;
}
line1_
->
SetHeight
(
LINE_HEIGHT
);
...
...
@@ -348,7 +348,7 @@ void UIDialog::AddComponents()
if
(
buttonNum_
==
3
)
{
// 3: three buttons
line2_
=
new
UIView
();
if
(
line2_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UIView fail"
);
GRAPHIC_LOGE
(
"new UIView fail"
);
return
;
}
line2_
->
SetHeight
(
LINE_HEIGHT
);
...
...
@@ -565,7 +565,7 @@ void UIDialog::CreateDialogWindow()
if
(
window_
!=
nullptr
)
{
window_
->
BindRootView
(
windowRootView_
);
}
else
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"Create window false!"
);
GRAPHIC_LOGE
(
"Create window false!"
);
}
}
...
...
frameworks/components/ui_digital_clock.cpp
浏览文件 @
9f199e77
...
...
@@ -40,7 +40,7 @@ void UIDigitalClock::InitTimeLabels()
if
(
timeLabels_
[
i
]
==
nullptr
)
{
timeLabels_
[
i
]
=
new
UILabel
;
if
(
timeLabels_
[
i
]
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UILabel fail"
);
GRAPHIC_LOGE
(
"new UILabel fail"
);
return
;
}
timeLabels_
[
i
]
->
SetLineBreakMode
(
UILabel
::
LINE_BREAK_ADAPT
);
...
...
frameworks/components/ui_image_view.cpp
浏览文件 @
9f199e77
...
...
@@ -20,7 +20,6 @@
#include "draw/draw_label.h"
#include "engines/gfx/gfx_engine_manager.h"
#include "gfx_utils/file.h"
#include "gfx_utils/graphic_log.h"
#include "gfx_utils/image_info.h"
#include "gfx_utils/mem_api.h"
#include "imgdecode/cache_manager.h"
...
...
@@ -342,7 +341,7 @@ void UIImageView::SetSrc(const char* src)
if
(
gifImageAnimator_
==
nullptr
)
{
gifImageAnimator_
=
new
GifImageAnimator
(
this
,
src
);
if
(
gifImageAnimator_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new GifImageAnimator fail"
);
GRAPHIC_LOGE
(
"new GifImageAnimator fail"
);
return
;
}
}
...
...
frameworks/components/ui_label.cpp
浏览文件 @
9f199e77
...
...
@@ -339,7 +339,7 @@ void UILabel::RemeasureForMarquee(int16_t textWidth)
}
else
{
LabelAnimator
*
animator
=
new
LabelAnimator
(
textWidth
,
rectWidth
,
offsetX_
,
this
);
if
(
animator
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new LabelAnimator fail"
);
GRAPHIC_LOGE
(
"new LabelAnimator fail"
);
return
;
}
animator
->
SetAnimatorSpeed
(
animator_
.
speed
);
...
...
frameworks/components/ui_label_button.cpp
浏览文件 @
9f199e77
...
...
@@ -17,7 +17,6 @@
#include "common/typed_text.h"
#include "draw/draw_label.h"
#include "font/ui_font.h"
#include "gfx_utils/graphic_log.h"
namespace
OHOS
{
UILabelButton
::
UILabelButton
()
:
labelButtonText_
(
nullptr
),
offset_
({
0
,
0
})
...
...
@@ -40,18 +39,6 @@ void UILabelButton::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea
labelStyle_
,
ellipsisIndex
,
opa
);
}
void
UILabelButton
::
InitLabelButtonText
()
{
if
(
labelButtonText_
==
nullptr
)
{
labelButtonText_
=
new
Text
();
if
(
labelButtonText_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Text fail"
);
return
;
}
labelButtonText_
->
SetAlign
(
TEXT_ALIGNMENT_CENTER
,
TEXT_ALIGNMENT_CENTER
);
}
}
UILabelButton
::~
UILabelButton
()
{
if
(
labelButtonText_
!=
nullptr
)
{
...
...
frameworks/components/ui_list.cpp
浏览文件 @
9f199e77
...
...
@@ -656,7 +656,7 @@ void UIList::MoveChildByOffset(int16_t xOffset, int16_t yOffset)
#if ENABLE_VIBRATOR
VibratorFunc
vibratorFunc
=
VibratorManager
::
GetInstance
()
->
GetVibratorFunc
();
if
(
needVibration_
&&
vibratorFunc
!=
nullptr
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"UIList::MoveChildByOffset Call vibrator function"
);
GRAPHIC_LOGI
(
"UIList::MoveChildByOffset Call vibrator function"
);
vibratorFunc
(
VibratorType
::
VIBRATOR_TYPE_TWO
);
}
#endif
...
...
@@ -675,7 +675,7 @@ void UIList::MoveChildByOffset(int16_t xOffset, int16_t yOffset)
#if ENABLE_VIBRATOR
VibratorFunc
vibratorFunc
=
VibratorManager
::
GetInstance
()
->
GetVibratorFunc
();
if
(
needVibration_
&&
vibratorFunc
!=
nullptr
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"UIList::MoveChildByOffset Call vibrator function"
);
GRAPHIC_LOGI
(
"UIList::MoveChildByOffset Call vibrator function"
);
vibratorFunc
(
VibratorType
::
VIBRATOR_TYPE_TWO
);
}
#endif
...
...
frameworks/components/ui_picker.cpp
浏览文件 @
9f199e77
...
...
@@ -17,7 +17,6 @@
#include "dock/vibrator_manager.h"
#include "draw/draw_line.h"
#include "draw/draw_rect.h"
#include "gfx_utils/graphic_log.h"
#include "themes/theme_manager.h"
namespace
{
...
...
@@ -246,17 +245,6 @@ void UIPicker::Refresh()
}
}
void
UIPicker
::
InitTextAdapter
()
{
if
(
textAdapter_
==
nullptr
)
{
textAdapter_
=
new
TextAdapter
();
if
(
textAdapter_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new TextAdapter fail"
);
return
;
}
}
}
bool
UIPicker
::
RefreshValues
(
int16_t
start
,
int16_t
end
)
{
if
(
!
isWidthSet_
||
!
isHeightSet_
||
!
itemsHeight_
||
((
start
==
0
)
&&
(
end
==
0
)))
{
...
...
frameworks/components/ui_qrcode.cpp
浏览文件 @
9f199e77
...
...
@@ -43,13 +43,12 @@ UIQrcode::~UIQrcode()
void
UIQrcode
::
SetQrcodeInfo
(
const
char
*
val
,
ColorType
backgroundColor
,
ColorType
qrColor
)
{
if
(
val
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIQrcode::SetQrcodeInfo val is null!
\n
"
);
GRAPHIC_LOGE
(
"UIQrcode::SetQrcodeInfo val is null!
\n
"
);
return
;
}
uint32_t
length
=
static_cast
<
uint32_t
>
(
strlen
(
val
));
if
((
length
>
QRCODE_VAL_MAX
)
||
(
length
==
0
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIQrcode::SetQrcodeInfo val length is equal 0 or greater than QRCODE_VAL_MAX!
\n
"
);
GRAPHIC_LOGE
(
"UIQrcode::SetQrcodeInfo val length is equal 0 or greater than QRCODE_VAL_MAX!
\n
"
);
return
;
}
backgroundColor_
=
backgroundColor
;
...
...
@@ -89,7 +88,7 @@ void UIQrcode::ReMeasure()
}
needDraw_
=
false
;
if
(
qrcodeVal_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIQrcode::ReMeasure qrcodeVal_ is null!
\n
"
);
GRAPHIC_LOGE
(
"UIQrcode::ReMeasure qrcodeVal_ is null!
\n
"
);
return
;
}
QrCode
qr
=
QrCode
::
encodeText
(
qrcodeVal_
,
QrCode
::
Ecc
::
LOW
);
...
...
@@ -120,7 +119,7 @@ void UIQrcode::SetImageInfo(qrcodegen::QrCode& qrcode)
int16_t
height
=
GetHeight
();
width_
=
(
width
>=
height
)
?
height
:
width
;
if
(
width_
<
qrcode
.
getSize
())
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIQrcode::SetImageInfo width is less than the minimum qrcode width!
\n
"
);
GRAPHIC_LOGE
(
"UIQrcode::SetImageInfo width is less than the minimum qrcode width!
\n
"
);
return
;
}
imageInfo_
.
header
.
width
=
width
;
...
...
@@ -133,7 +132,7 @@ void UIQrcode::SetImageInfo(qrcodegen::QrCode& qrcode)
}
imageInfo_
.
data
=
reinterpret_cast
<
uint8_t
*>
(
ImageCacheMalloc
(
imageInfo_
));
if
(
imageInfo_
.
data
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIQrcode::SetImageInfo imageInfo_.data is null!
\n
"
);
GRAPHIC_LOGE
(
"UIQrcode::SetImageInfo imageInfo_.data is null!
\n
"
);
return
;
}
GenerateQrCode
(
qrcode
);
...
...
@@ -150,7 +149,7 @@ void UIQrcode::FillQrCodeColor(qrcodegen::QrCode& qrcode)
{
int32_t
qrWidth
=
qrcode
.
getSize
();
if
(
qrWidth
<=
0
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIQrcode::FillQrCodeColor generated qrcode size is less or equal 0!
\n
"
);
GRAPHIC_LOGE
(
"UIQrcode::FillQrCodeColor generated qrcode size is less or equal 0!
\n
"
);
return
;
}
int16_t
width
=
imageInfo_
.
header
.
width
;
...
...
@@ -185,7 +184,7 @@ void UIQrcode::FillQrCodeBackgroundColor()
for
(
int16_t
col
=
1
;
col
<
imageInfo_
.
header
.
width
;
++
col
)
{
initColorData
+=
QRCODE_FACTOR_NUM
;
if
(
memcpy_s
(
initColorData
,
QRCODE_FACTOR_NUM
,
tempColorData
,
QRCODE_FACTOR_NUM
)
!=
EOK
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIQrcode::FillQrCodeBackgroundColor memcpy_s failed!
\n
"
);
GRAPHIC_LOGE
(
"UIQrcode::FillQrCodeBackgroundColor memcpy_s failed!
\n
"
);
return
;
}
}
...
...
@@ -194,7 +193,7 @@ void UIQrcode::FillQrCodeBackgroundColor()
for
(
int16_t
row
=
1
;
row
<
imageInfo_
.
header
.
height
;
++
row
)
{
initColorData
+=
deltaWidth
;
if
(
memcpy_s
(
initColorData
,
deltaWidth
,
tempColorData
,
deltaWidth
)
!=
EOK
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIQrcode::FillQrCodeBackgroundColor memcpy_s failed!
\n
"
);
GRAPHIC_LOGE
(
"UIQrcode::FillQrCodeBackgroundColor memcpy_s failed!
\n
"
);
return
;
}
}
...
...
frameworks/components/ui_scroll_view.cpp
浏览文件 @
9f199e77
...
...
@@ -131,7 +131,7 @@ bool UIScrollView::OnRotateEvent(const RotateEvent& event)
if
(
rotateLen
>
DEFAULT_VIBRATOR_LEN
)
{
uint16_t
vibrationCnt
=
rotateLen
/
DEFAULT_VIBRATOR_LEN
;
for
(
uint16_t
i
=
0
;
i
<
vibrationCnt
;
i
++
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"UIScrollView::OnRotateEvent Call vibrator function"
);
GRAPHIC_LOGI
(
"UIScrollView::OnRotateEvent Call vibrator function"
);
vibratorFunc
(
VibratorType
::
VIBRATOR_TYPE_ONE
);
}
lastVibratorRotateLen_
=
totalRotateLen_
;
...
...
frameworks/components/ui_slider.cpp
浏览文件 @
9f199e77
...
...
@@ -71,7 +71,7 @@ void UISlider::SetKnobStyle(const Style& style)
if
(
!
knobStyleAllocFlag_
)
{
knobStyle_
=
new
Style
;
if
(
knobStyle_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Style fail"
);
GRAPHIC_LOGE
(
"new Style fail"
);
return
;
}
knobStyleAllocFlag_
=
true
;
...
...
@@ -84,7 +84,7 @@ void UISlider::SetKnobStyle(uint8_t key, int64_t value)
if
(
!
knobStyleAllocFlag_
)
{
knobStyle_
=
new
Style
(
*
knobStyle_
);
if
(
knobStyle_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Style fail"
);
GRAPHIC_LOGE
(
"new Style fail"
);
return
;
}
knobStyleAllocFlag_
=
true
;
...
...
@@ -149,7 +149,7 @@ void UISlider::DrawKnob(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea, c
break
;
}
default:
{
HILOG_WARN
(
HILOG_MODULE_GRAPHIC
,
"UISlider::DrawKnob Direction error!
\n
"
);
GRAPHIC_LOGW
(
"UISlider::DrawKnob Direction error!
\n
"
);
}
}
DrawValidRect
(
gfxDstBuffer
,
knobImage_
,
knobBar
,
invalidatedArea
,
*
knobStyle_
,
0
);
...
...
@@ -163,7 +163,7 @@ bool UISlider::InitImage()
if
(
knobImage_
==
nullptr
)
{
knobImage_
=
new
Image
();
if
(
knobImage_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Image fail"
);
GRAPHIC_LOGE
(
"new Image fail"
);
return
false
;
}
}
...
...
@@ -245,7 +245,7 @@ void UISlider::DrawForeground(BufferInfo& gfxDstBuffer, const Rect& invalidatedA
break
;
}
default:
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UISlider: DrawForeground direction Err!
\n
"
);
GRAPHIC_LOGE
(
"UISlider: DrawForeground direction Err!
\n
"
);
return
;
}
}
...
...
@@ -323,7 +323,7 @@ int32_t UISlider::UpdateCurrentValue(const Point& knobPosition)
}
break
;
default:
HILOG_WARN
(
HILOG_MODULE_GRAPHIC
,
"UISlider::UpdateCurrentValue Direction error!
\n
"
);
GRAPHIC_LOGW
(
"UISlider::UpdateCurrentValue Direction error!
\n
"
);
}
SetValue
(
value
);
return
value
;
...
...
@@ -376,7 +376,7 @@ bool UISlider::OnRotateEvent(const RotateEvent& event)
#if ENABLE_VIBRATOR
VibratorFunc
vibratorFunc
=
VibratorManager
::
GetInstance
()
->
GetVibratorFunc
();
if
(
vibratorFunc
!=
nullptr
&&
lastValue
!=
curValue_
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"UISlider::OnRotateEvent Call vibrator function"
);
GRAPHIC_LOGI
(
"UISlider::OnRotateEvent Call vibrator function"
);
vibratorFunc
(
VibratorType
::
VIBRATOR_TYPE_TWO
);
}
#endif
...
...
frameworks/components/ui_surface_view.cpp
浏览文件 @
9f199e77
...
...
@@ -27,7 +27,7 @@ UISurfaceView::UISurfaceView()
{
surface_
=
Surface
::
CreateSurface
();
if
(
surface_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UISurfaceView::UISurfaceView surface create failed
\n
"
);
GRAPHIC_LOGE
(
"UISurfaceView::UISurfaceView surface create failed
\n
"
);
return
;
}
surface_
->
SetWidthAndHeight
(
GetWidth
(),
GetHeight
());
...
...
@@ -47,7 +47,7 @@ void UISurfaceView::SetPosition(int16_t x, int16_t y)
{
UIView
::
SetPosition
(
x
,
y
);
if
(
surface_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UISurfaceView::SetPosition surface is null
\n
"
);
GRAPHIC_LOGE
(
"UISurfaceView::SetPosition surface is null
\n
"
);
return
;
}
x
=
GetRect
().
GetLeft
();
...
...
@@ -60,7 +60,7 @@ void UISurfaceView::SetPosition(int16_t x, int16_t y, int16_t width, int16_t hei
{
UIView
::
SetPosition
(
x
,
y
,
width
,
height
);
if
(
surface_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UISurfaceView::SetPosition surface is null
\n
"
);
GRAPHIC_LOGE
(
"UISurfaceView::SetPosition surface is null
\n
"
);
return
;
}
x
=
GetRect
().
GetLeft
();
...
...
@@ -75,7 +75,7 @@ void UISurfaceView::Resize(int16_t width, int16_t height)
{
UIView
::
Resize
(
width
,
height
);
if
(
surface_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UISurfaceView::Resize surface is null
\n
"
);
GRAPHIC_LOGE
(
"UISurfaceView::Resize surface is null
\n
"
);
return
;
}
surface_
->
SetUserData
(
REGION_WIDTH
,
std
::
to_string
(
width
));
...
...
@@ -86,7 +86,7 @@ void UISurfaceView::SetWidth(int16_t width)
{
UIView
::
SetWidth
(
width
);
if
(
surface_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UISurfaceView::SetWidth surface is null
\n
"
);
GRAPHIC_LOGE
(
"UISurfaceView::SetWidth surface is null
\n
"
);
return
;
}
surface_
->
SetUserData
(
REGION_WIDTH
,
std
::
to_string
(
width
));
...
...
@@ -96,7 +96,7 @@ void UISurfaceView::SetHeight(int16_t height)
{
UIView
::
SetHeight
(
height
);
if
(
surface_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UISurfaceView::SetHeight surface is null
\n
"
);
GRAPHIC_LOGE
(
"UISurfaceView::SetHeight surface is null
\n
"
);
return
;
}
surface_
->
SetUserData
(
REGION_HEIGHT
,
std
::
to_string
(
height
));
...
...
@@ -106,7 +106,7 @@ void UISurfaceView::SetX(int16_t x)
{
UIView
::
SetX
(
x
);
if
(
surface_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UISurfaceView::SetX surface is null
\n
"
);
GRAPHIC_LOGE
(
"UISurfaceView::SetX surface is null
\n
"
);
return
;
}
x
=
GetRect
().
GetLeft
();
...
...
@@ -117,7 +117,7 @@ void UISurfaceView::SetY(int16_t y)
{
UIView
::
SetY
(
y
);
if
(
surface_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UISurfaceView::SetY surface is null
\n
"
);
GRAPHIC_LOGE
(
"UISurfaceView::SetY surface is null
\n
"
);
return
;
}
y
=
GetRect
().
GetTop
();
...
...
@@ -144,8 +144,7 @@ void UISurfaceView::Draw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea)
{
SurfaceBuffer
*
acquireBuffer
=
(
surface_
!=
nullptr
)
?
surface_
->
AcquireBuffer
()
:
nullptr
;
if
(
acquireBuffer
!=
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UISurfaceView::Draw acquireBufferVirAddr=%p "
,
acquireBuffer
->
GetVirAddr
());
GRAPHIC_LOGE
(
"UISurfaceView::Draw acquireBufferVirAddr=%p
\n
"
,
acquireBuffer
->
GetVirAddr
());
// fill with buffer
DrawUtils
::
GetInstance
()
->
DrawWithBuffer
(
gfxDstBuffer
,
GetRect
(),
invalidatedArea
,
reinterpret_cast
<
const
ColorType
*>
(
acquireBuffer
->
GetVirAddr
()));
...
...
frameworks/components/ui_swipe_view.cpp
浏览文件 @
9f199e77
...
...
@@ -396,7 +396,7 @@ void UISwipeView::RefreshCurrentViewInner(int16_t distance,
#if ENABLE_VIBRATOR
VibratorFunc
vibratorFunc
=
VibratorManager
::
GetInstance
()
->
GetVibratorFunc
();
if
(
vibratorFunc
!=
nullptr
&&
needVibration_
&&
curIndex_
!=
lastIndex_
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"UISwipeView::RefreshCurrentViewInner Call vibrator function"
);
GRAPHIC_LOGI
(
"UISwipeView::RefreshCurrentViewInner Call vibrator function"
);
vibratorFunc
(
VibratorType
::
VIBRATOR_TYPE_ONE
);
lastIndex_
=
curIndex_
;
}
...
...
frameworks/components/ui_time_picker.cpp
浏览文件 @
9f199e77
...
...
@@ -129,7 +129,7 @@ void UITimePicker::InitPicker(UIPicker*& picker, int16_t start, int16_t end)
{
picker
=
new
UIPicker
();
if
(
picker
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UIPicker fail"
);
GRAPHIC_LOGE
(
"new UIPicker fail"
);
return
;
}
picker
->
SetPosition
(
xPos_
,
0
,
pickerWidth_
,
GetHeight
());
...
...
frameworks/components/ui_video.cpp
浏览文件 @
9f199e77
...
...
@@ -14,7 +14,6 @@
*/
#include "components/ui_video.h"
#include "gfx_utils/graphic_log.h"
#include "securec.h"
#ifndef VERSION_LITE
...
...
@@ -331,7 +330,7 @@ void UIVideo::InitVideo()
if
(
surfaceView_
==
nullptr
)
{
surfaceView_
=
new
UISurfaceView
();
if
(
surfaceView_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UISurfaceView fail"
);
GRAPHIC_LOGE
(
"new UISurfaceView fail"
);
return
;
}
surfaceView_
->
SetPosition
(
0
,
0
);
...
...
@@ -342,7 +341,7 @@ void UIVideo::InitVideo()
if
(
controllerGroup_
==
nullptr
)
{
controllerGroup_
=
new
UIViewGroup
();
if
(
controllerGroup_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UIViewGroup fail"
);
GRAPHIC_LOGE
(
"new UIViewGroup fail"
);
return
;
}
controllerGroup_
->
SetPosition
(
0
,
0
,
DEFAULT_VIEW_WIDTH
,
DEFAULT_VIEW_HEIGHT
);
...
...
@@ -359,7 +358,7 @@ void UIVideo::InitVideo()
if
(
sliderAnimatorCallback_
==
nullptr
)
{
sliderAnimatorCallback_
=
new
SliderAnimatorCallback
(
this
,
playSlider_
,
currentTimeLabel_
);
if
(
sliderAnimatorCallback_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new SliderAnimatorCallback fail"
);
GRAPHIC_LOGE
(
"new SliderAnimatorCallback fail"
);
return
;
}
sliderAnimatorCallback_
->
SetPlayButton
(
playButton_
);
...
...
@@ -367,7 +366,7 @@ void UIVideo::InitVideo()
if
(
sliderAnimator_
==
nullptr
)
{
sliderAnimator_
=
new
Animator
(
sliderAnimatorCallback_
,
this
,
0
,
true
);
if
(
sliderAnimator_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Animator fail"
);
GRAPHIC_LOGE
(
"new Animator fail"
);
return
;
}
sliderAnimatorCallback_
->
SetSliderAnimator
(
sliderAnimator_
);
...
...
@@ -379,7 +378,7 @@ void UIVideo::InitControllerLabel()
if
(
titleLabel_
==
nullptr
)
{
titleLabel_
=
new
UILabel
();
if
(
titleLabel_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UILabel fail"
);
GRAPHIC_LOGE
(
"new UILabel fail"
);
return
;
}
titleLabel_
->
SetPosition
(
322
,
28
,
316
,
29
);
// 322:pos x, 28:pos y, 316:width, 29:height
...
...
@@ -393,7 +392,7 @@ void UIVideo::InitControllerLabel()
if
(
totalTimeLabel_
==
nullptr
)
{
totalTimeLabel_
=
new
UILabel
();
if
(
totalTimeLabel_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UILabel fail"
);
GRAPHIC_LOGE
(
"new UILabel fail"
);
return
;
}
// 580:pos x, 56:pos y offset
...
...
@@ -408,7 +407,7 @@ void UIVideo::InitControllerLabel()
if
(
currentTimeLabel_
==
nullptr
)
{
currentTimeLabel_
=
new
UILabel
();
if
(
currentTimeLabel_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UILabel fail"
);
GRAPHIC_LOGE
(
"new UILabel fail"
);
return
;
}
// 80:pos x, 56:pos y offset
...
...
@@ -427,7 +426,7 @@ void UIVideo::InitControllerButton()
if
(
playButton_
==
nullptr
)
{
playButton_
=
new
UIToggleButton
();
if
(
playButton_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UIToggleButton fail"
);
GRAPHIC_LOGE
(
"new UIToggleButton fail"
);
return
;
}
// 24:pox x, 88:pos y offset
...
...
@@ -440,7 +439,7 @@ void UIVideo::InitControllerButton()
if
(
pauseButton_
==
nullptr
)
{
pauseButton_
=
new
UIToggleButton
();
if
(
pauseButton_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UIToggleButton fail"
);
GRAPHIC_LOGE
(
"new UIToggleButton fail"
);
return
;
}
// 448:pox x, 208:pos y 2:double width 2:double height
...
...
@@ -453,7 +452,7 @@ void UIVideo::InitControllerButton()
if
(
volumeButton_
==
nullptr
)
{
volumeButton_
=
new
UIToggleButton
();
if
(
volumeButton_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UIToggleButton fail"
);
GRAPHIC_LOGE
(
"new UIToggleButton fail"
);
return
;
}
// 56:pox x offset, 88:pos y offset
...
...
@@ -494,7 +493,7 @@ void UIVideo::InitControllerSlider()
if
(
playSlider_
==
nullptr
)
{
playSlider_
=
new
UISlider
();
if
(
playSlider_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new UISlider fail"
);
GRAPHIC_LOGE
(
"new UISlider fail"
);
return
;
}
// 80:pos x, 74:width offset, 5:multiply, 6:divide, 4:height
...
...
frameworks/components/ui_view.cpp
浏览文件 @
9f199e77
...
...
@@ -66,8 +66,7 @@ UIView::UIView()
UIView
::~
UIView
()
{
if
(
parent_
!=
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIView::~UIView failed, parent is not nullptr! Need to remove from parent component first"
);
GRAPHIC_LOGE
(
"UIView::~UIView failed, parent is not nullptr! Need to remove from parent component first"
);
}
if
(
transMap_
!=
nullptr
)
{
delete
transMap_
;
...
...
@@ -200,7 +199,7 @@ void UIView::SetStyle(uint8_t key, int64_t value)
if
(
!
styleAllocFlag_
)
{
style_
=
new
Style
(
*
style_
);
if
(
style_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Style fail"
);
GRAPHIC_LOGE
(
"new Style fail"
);
return
;
}
styleAllocFlag_
=
true
;
...
...
@@ -235,7 +234,7 @@ void UIView::Rotate(int16_t angle, const Vector2<float>& pivot)
ReMeasure
();
transMap_
=
new
TransformMap
();
if
(
transMap_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new TransformMap fail"
);
GRAPHIC_LOGE
(
"new TransformMap fail"
);
return
;
}
}
...
...
@@ -253,7 +252,7 @@ void UIView::Scale(const Vector2<float>& scale, const Vector2<float>& pivot)
ReMeasure
();
transMap_
=
new
TransformMap
();
if
(
transMap_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new TransformMap fail"
);
GRAPHIC_LOGE
(
"new TransformMap fail"
);
return
;
}
}
...
...
@@ -276,7 +275,7 @@ void UIView::Translate(const Vector2<int16_t>& trans)
ReMeasure
();
transMap_
=
new
TransformMap
(
GetOrigRect
());
if
(
transMap_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new TransformMap fail"
);
GRAPHIC_LOGE
(
"new TransformMap fail"
);
return
;
}
}
...
...
@@ -548,20 +547,6 @@ Rect UIView::GetContentRect()
return
contentRect
;
}
void
UIView
::
ResizeVisibleArea
(
int16_t
x
,
int16_t
y
,
int16_t
width
,
int16_t
height
)
{
if
(
visibleRect_
==
nullptr
)
{
visibleRect_
=
new
Rect
();
if
(
visibleRect_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"new Rect fail"
);
return
;
}
}
visibleRect_
->
SetWidth
(
width
);
visibleRect_
->
SetHeight
(
height
);
visibleRect_
->
SetPosition
(
x
,
y
);
}
Rect
UIView
::
GetOrigRect
()
const
{
int16_t
x
=
rect_
.
GetX
();
...
...
frameworks/components/ui_view_group.cpp
浏览文件 @
9f199e77
...
...
@@ -40,11 +40,11 @@ UIViewGroup::~UIViewGroup() {}
void
UIViewGroup
::
Add
(
UIView
*
view
)
{
if
((
view
==
this
)
||
(
view
==
nullptr
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"view can not be nullptr and added to self"
);
GRAPHIC_LOGE
(
"view can not be nullptr and added to self"
);
return
;
}
if
(
view
->
GetParent
()
!=
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"can not add view multi times"
);
GRAPHIC_LOGE
(
"can not add view multi times"
);
return
;
}
...
...
@@ -69,12 +69,12 @@ void UIViewGroup::Add(UIView* view)
void
UIViewGroup
::
Insert
(
UIView
*
prevView
,
UIView
*
insertView
)
{
if
((
insertView
==
nullptr
)
||
(
insertView
==
this
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"insertView can not be nullptr and insert to self"
);
GRAPHIC_LOGE
(
"insertView can not be nullptr and insert to self"
);
return
;
}
if
(
insertView
->
GetParent
()
!=
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"can not insert view multi times"
);
GRAPHIC_LOGE
(
"can not insert view multi times"
);
return
;
}
...
...
frameworks/core/task_manager.cpp
浏览文件 @
9f199e77
...
...
@@ -33,7 +33,7 @@ void TaskManager::Add(Task* task)
ListNode
<
Task
*>*
pos
=
list_
.
Begin
();
while
(
pos
!=
list_
.
End
())
{
if
(
pos
->
data_
==
task
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"do not add task multi times"
);
GRAPHIC_LOGI
(
"do not add task multi times"
);
return
;
}
pos
=
pos
->
next_
;
...
...
frameworks/dfx/event_injector.cpp
浏览文件 @
9f199e77
...
...
@@ -48,8 +48,7 @@ bool EventInjector::RegisterEventInjector(EventDataType type)
if
(
pointEventInjector_
==
nullptr
)
{
pointEventInjector_
=
new
PointEventInjector
();
if
(
pointEventInjector_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"EventInjector::RegisterEventInjector register pointEventInjector failed Err!"
);
GRAPHIC_LOGE
(
"EventInjector::RegisterEventInjector register pointEventInjector failed Err!
\n
"
);
return
false
;
}
InputDeviceManager
::
GetInstance
()
->
Add
(
pointEventInjector_
);
...
...
@@ -59,8 +58,7 @@ bool EventInjector::RegisterEventInjector(EventDataType type)
if
(
keyEventInjector_
==
nullptr
)
{
keyEventInjector_
=
new
KeyEventInjector
();
if
(
keyEventInjector_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"EventInjector::RegisterEventInjector register keyEventInjector failed Err!"
);
GRAPHIC_LOGE
(
"EventInjector::RegisterEventInjector register keyEventInjector failed Err!
\n
"
);
return
false
;
}
InputDeviceManager
::
GetInstance
()
->
Add
(
keyEventInjector_
);
...
...
@@ -149,7 +147,7 @@ bool EventInjector::SetClickEvent(const Point& clickPoint)
{
uint16_t
clickArrayLen
=
2
;
/* 2:click event point */
if
(
clickArrayLen
>
pointEventInjector_
->
GetLeftSize
())
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"front points need to be read.(left size in pointer queue is not enough)"
);
GRAPHIC_LOGE
(
"front points need to be read.(left size in pointer queue is not enough)"
);
return
false
;
}
bool
setResult
=
true
;
...
...
@@ -172,7 +170,7 @@ bool EventInjector::SetLongPressEvent(const Point& longPressPoint)
{
uint16_t
pointCount
=
INDEV_LONG_PRESS_TIME
/
INDEV_READ_PERIOD
+
1
;
if
(
pointCount
>
pointEventInjector_
->
GetLeftSize
())
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"front points need to be read.(left size in pointer queue is not enough)"
);
GRAPHIC_LOGE
(
"front points need to be read.(left size in pointer queue is not enough)"
);
return
false
;
}
bool
setResult
=
true
;
...
...
@@ -197,12 +195,11 @@ bool EventInjector::SetDragEvent(const Point& startPoint, const Point& endPoint,
uint16_t
pointCount
=
(
dragTime
/
INDEV_READ_PERIOD
)
+
1
;
/* 3: at least 3 points in drag event */
if
(
pointCount
<
3
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"dragTime is too short.(drag event needs at least 3 points)"
);
GRAPHIC_LOGE
(
"dragTime is too short.(drag event needs at least 3 points)"
);
return
false
;
}
if
(
pointCount
>
pointEventInjector_
->
GetLeftSize
())
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"dragTime is too long or front points need to be read.(left size in pointer queue is not enough)"
);
GRAPHIC_LOGE
(
"dragTime is too long or front points need to be read.(left size in pointer queue is not enough)"
);
return
false
;
}
bool
setResult
=
true
;
...
...
@@ -247,8 +244,7 @@ bool EventInjector::SetKeyEvent(uint16_t keyId, uint16_t state)
{
uint16_t
kevArrayLen
=
1
;
if
(
kevArrayLen
>
keyEventInjector_
->
GetLeftSize
())
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"front key event need to be read.(left size in key event queue is not enough)"
);
GRAPHIC_LOGE
(
"front key event need to be read.(left size in key event queue is not enough)"
);
return
false
;
}
bool
setResult
=
true
;
...
...
frameworks/dfx/key_event_injector.cpp
浏览文件 @
9f199e77
...
...
@@ -59,13 +59,13 @@ bool KeyEventInjector::Read(DeviceData& data)
bool
KeyEventInjector
::
SetKey
(
const
DeviceData
&
data
)
{
if
(
dataList_
.
Size
()
>=
MAX_LIST_SIZE
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"PointEventInjector::SetPointEvent data list is full."
);
GRAPHIC_LOGI
(
"PointEventInjector::SetPointEvent data list is full."
);
return
false
;
}
DeviceData
*
tmpData
=
new
DeviceData
;
if
(
tmpData
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"PointEventInjector::SetPointEvent memory allocation failed Err!"
);
GRAPHIC_LOGE
(
"PointEventInjector::SetPointEvent memory allocation failed Err!"
);
return
false
;
}
tmpData
->
keyId
=
data
.
keyId
;
...
...
frameworks/dfx/point_event_injector.cpp
浏览文件 @
9f199e77
...
...
@@ -38,13 +38,13 @@ PointEventInjector::~PointEventInjector()
bool
PointEventInjector
::
SetPointEvent
(
const
DeviceData
&
data
)
{
if
(
dataList_
.
Size
()
>=
MAX_LIST_SIZE
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"PointEventInjector::SetPointEvent data list is full."
);
GRAPHIC_LOGI
(
"PointEventInjector::SetPointEvent data list is full."
);
return
false
;
}
DeviceData
*
tmpData
=
new
DeviceData
;
if
(
tmpData
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"PointEventInjector::SetPointEvent memory allocation failed Err!"
);
GRAPHIC_LOGE
(
"PointEventInjector::SetPointEvent memory allocation failed Err!"
);
return
false
;
}
tmpData
->
point
=
data
.
point
;
...
...
frameworks/dfx/ui_dump_dom_tree.cpp
浏览文件 @
9f199e77
...
...
@@ -261,7 +261,7 @@ void UIDumpDomTree::OutputDomNode(UIView* view)
/* Output current view's info into cJSON structure. */
cJSON
*
dumpUsr
=
cJSON_CreateObject
();
if
(
dumpUsr
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIDumpDomTree::OutputDomNode cJSON create object failed Err!
\n
"
);
GRAPHIC_LOGE
(
"UIDumpDomTree::OutputDomNode cJSON create object failed Err!
\n
"
);
return
;
}
...
...
@@ -278,7 +278,7 @@ bool UIDumpDomTree::WriteDumpFile() const
unlink
(
path_
);
int32_t
fd
=
open
(
path_
,
O_CREAT
|
O_RDWR
,
DEFAULT_FILE_PERMISSION
);
if
(
fd
<
0
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIDumpDomTree::WriteDumpFile open file failed Err!
\n
"
);
GRAPHIC_LOGE
(
"UIDumpDomTree::WriteDumpFile open file failed Err!
\n
"
);
return
false
;
}
...
...
@@ -289,7 +289,7 @@ bool UIDumpDomTree::WriteDumpFile() const
uint32_t
length
=
strlen
(
pJson_
);
if
(
static_cast
<
uint32_t
>
(
write
(
fd
,
pJson_
,
length
))
!=
length
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIDumpDomTree::WriteDumpFile write file failed Err!
\n
"
);
GRAPHIC_LOGE
(
"UIDumpDomTree::WriteDumpFile write file failed Err!
\n
"
);
close
(
fd
);
return
false
;
}
...
...
@@ -311,7 +311,7 @@ void UIDumpDomTree::OutputDomTree(UIView* view, cJSON* usr)
dumpUsr
=
cJSON_CreateObject
();
if
(
dumpUsr
==
nullptr
)
{
allocErrorFlag_
=
true
;
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIDumpDomTree::OutputDomTree cJSON create object failed Err!
\n
"
);
GRAPHIC_LOGE
(
"UIDumpDomTree::OutputDomTree cJSON create object failed Err!
\n
"
);
return
;
}
/* usr must be a array. */
...
...
@@ -326,7 +326,7 @@ void UIDumpDomTree::OutputDomTree(UIView* view, cJSON* usr)
cJSON
*
arrayJson
=
cJSON_CreateArray
();
if
(
arrayJson
==
nullptr
)
{
allocErrorFlag_
=
true
;
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIDumpDomTree::OutputDomTree cJSON create object failed Err!
\n
"
);
GRAPHIC_LOGE
(
"UIDumpDomTree::OutputDomTree cJSON create object failed Err!
\n
"
);
return
;
}
...
...
@@ -402,7 +402,7 @@ bool UIDumpDomTree::DumpDomTree(const char* id, const char* path)
UIView
*
currView
=
static_cast
<
UIView
*>
(
rootView
);
rootJson_
=
cJSON_CreateObject
();
if
(
rootJson_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIDumpDomTree::DumpDomTree cJSON create object failed Err!
\n
"
);
GRAPHIC_LOGE
(
"UIDumpDomTree::DumpDomTree cJSON create object failed Err!
\n
"
);
return
false
;
}
...
...
@@ -413,7 +413,7 @@ bool UIDumpDomTree::DumpDomTree(const char* id, const char* path)
if
(
!
searchFlag_
)
{
cJSON_Delete
(
rootJson_
);
rootJson_
=
nullptr
;
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"UIDumpDomTree::DumpDomTree can not find the node
\n
"
);
GRAPHIC_LOGI
(
"UIDumpDomTree::DumpDomTree can not find the node
\n
"
);
return
false
;
}
/* Reset the search flag. */
...
...
@@ -424,14 +424,14 @@ bool UIDumpDomTree::DumpDomTree(const char* id, const char* path)
cJSON_Delete
(
rootJson_
);
rootJson_
=
nullptr
;
if
(
pJson_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIDumpDomTree::DumpDomTree convert cJSON object to string failed Err!
\n
"
);
GRAPHIC_LOGE
(
"UIDumpDomTree::DumpDomTree convert cJSON object to string failed Err!
\n
"
);
return
false
;
}
if
(
!
WriteDumpFile
())
{
cJSON_free
(
pJson_
);
pJson_
=
nullptr
;
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIDumpDomTree::DumpDomTree file operation failed Err!
\n
"
);
GRAPHIC_LOGE
(
"UIDumpDomTree::DumpDomTree file operation failed Err!
\n
"
);
return
false
;
}
...
...
frameworks/dfx/ui_screenshot.cpp
浏览文件 @
9f199e77
...
...
@@ -55,14 +55,12 @@ public:
UIFree
(
reinterpret_cast
<
void
*>
(
filePath_
));
filePath_
=
nullptr
;
if
(
fd
<
0
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIScreenshotListener::OnScreenshotEnd open file failed Err!"
);
GRAPHIC_LOGE
(
"UIScreenshotListener::OnScreenshotEnd open file failed Err!
\n
"
);
return
;
}
if
(
write
(
fd
,
&
header
,
sizeof
(
ImageHeader
))
!=
sizeof
(
ImageHeader
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIScreenshotListener::OnScreenshotEnd write image header failed Err!"
);
GRAPHIC_LOGE
(
"UIScreenshotListener::OnScreenshotEnd write image header failed Err!
\n
"
);
close
(
fd
);
return
;
}
...
...
@@ -72,8 +70,7 @@ public:
uint32_t
size
=
row
*
width
*
sizeof
(
uint32_t
);
uint32_t
*
argb8888Addr
=
static_cast
<
uint32_t
*>
(
UIMalloc
(
size
));
if
(
argb8888Addr
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIScreenshotListener::OnScreenshotEnd memory allocation failed Err!"
);
GRAPHIC_LOGE
(
"UIScreenshotListener::OnScreenshotEnd memory allocation failed Err!"
);
close
(
fd
);
return
;
}
...
...
@@ -114,7 +111,7 @@ private:
}
}
else
if
(
format
==
IMAGE_PIXEL_FORMAT_ARGB8888
)
{
if
(
memcpy_s
(
buffer
,
width
*
DEFAULT_COLOR_SIZE
,
startAddr
,
width
*
DEFAULT_COLOR_SIZE
)
!=
EOK
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"memcpy_s error!"
);
GRAPHIC_LOGE
(
"memcpy_s error!"
);
}
}
startAddr
+=
stride
;
...
...
@@ -123,8 +120,7 @@ private:
uint32_t
blockSize
=
row
*
width
*
sizeof
(
uint32_t
);
if
(
static_cast
<
uint32_t
>
(
write
(
fd
,
argb8888Addr
,
blockSize
))
!=
blockSize
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIScreenshotListener::WriteBlockToFile wrong amount of written data Err!"
);
GRAPHIC_LOGE
(
"UIScreenshotListener::WriteBlockToFile wrong amount of written data Err!"
);
return
false
;
}
return
true
;
...
...
@@ -150,8 +146,7 @@ bool UIScreenshot::ScreenshotToFile(const char* path)
if
(
screenshotListener_
==
nullptr
)
{
screenshotListener_
=
new
UIScreenshotListener
();
if
(
screenshotListener_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIScreenshot::ScreenshotToFile register screenshot listener failed Err!"
);
GRAPHIC_LOGE
(
"UIScreenshot::ScreenshotToFile register screenshot listener failed Err!
\n
"
);
return
false
;
}
IWindowsManager
::
GetInstance
()
->
SetScreenshotListener
(
screenshotListener_
);
...
...
frameworks/dock/pointer_input_device.cpp
浏览文件 @
9f199e77
...
...
@@ -76,7 +76,7 @@ void PointerInputDevice::DispatchPressEvent(UIViewGroup* rootView)
if
(
!
pressState_
)
{
rootView
->
GetTargetView
(
curPos_
,
&
touchableView_
,
&
targetView_
);
if
(
touchableView_
==
nullptr
)
{
HILOG_DEBUG
(
HILOG_MODULE_GRAPHIC
,
"PointerInputDevice::DispatchPressEvent cannot find target view!
\n
"
);
GRAPHIC_LOGD
(
"PointerInputDevice::DispatchPressEvent cannot find target view!
\n
"
);
return
;
}
draggableView_
=
GetDraggableView
(
touchableView_
);
...
...
frameworks/dock/screen_device_proxy.cpp
浏览文件 @
9f199e77
...
...
@@ -71,14 +71,14 @@ void ScreenDeviceProxy::SetAnimatorRect(const Rect& rect)
SetAnimatorbufferWidth
(
bufferWidth
);
if
(
memset_s
(
reinterpret_cast
<
void
*>
(
const_cast
<
uint8_t
*>
(
animatorImageInfo_
.
data
)),
animatorImageInfo_
.
dataSize
,
0
,
animatorImageInfo_
.
dataSize
)
!=
EOK
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"animator buffer memset failed."
);
GRAPHIC_LOGE
(
"animator buffer memset failed."
);
}
}
void
ScreenDeviceProxy
::
SetScreenSize
(
uint16_t
width
,
uint16_t
height
)
{
if
((
width
==
0
)
||
(
height
==
0
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"screen size can not be zero."
);
GRAPHIC_LOGE
(
"screen size can not be zero."
);
return
;
}
width_
=
width
;
...
...
@@ -93,13 +93,13 @@ uint8_t* ScreenDeviceProxy::GetBuffer()
flush_
.
Wait
();
if
(
useAnimatorBuff_
)
{
if
(
animatorBufferAddr_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"Invalid param animatorBufferAddr_."
);
GRAPHIC_LOGE
(
"Invalid param animatorBufferAddr_."
);
return
nullptr
;
}
return
animatorBufferAddr_
;
}
if
(
frameBufferAddr_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"Invalid param frameBufferAddr_."
);
GRAPHIC_LOGE
(
"Invalid param frameBufferAddr_."
);
return
nullptr
;
}
return
frameBufferAddr_
;
...
...
frameworks/draw/clip_utils.cpp
浏览文件 @
9f199e77
...
...
@@ -332,7 +332,7 @@ void ClipImageBlitter::DrawPixel(int16_t x, int16_t y, uint8_t opa)
break
;
}
default:
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"Only images in ARGB8888 format are supported!"
);
GRAPHIC_LOGE
(
"Only images in ARGB8888 format are supported!"
);
break
;
}
}
...
...
frameworks/draw/draw_label.cpp
浏览文件 @
9f199e77
...
...
@@ -70,7 +70,7 @@ void DrawLabel::DrawArcText(BufferInfo& gfxDstBuffer,
OpacityType
opaScale
)
{
if
((
text
==
nullptr
)
||
(
arcTextInfo
.
lineStart
==
arcTextInfo
.
lineEnd
)
||
(
arcTextInfo
.
radius
==
0
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"DrawLabel::DrawArcText invalid parameter
\n
"
);
GRAPHIC_LOGE
(
"DrawLabel::DrawArcText invalid parameter
\n
"
);
return
;
}
OpacityType
opa
=
DrawUtils
::
GetMixOpacity
(
opaScale
,
style
.
textOpa_
);
...
...
frameworks/draw/draw_rect.cpp
浏览文件 @
9f199e77
...
...
@@ -25,7 +25,7 @@ void DrawRect::Draw(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirt
const
Style
&
style
,
OpacityType
opaScale
)
{
if
((
rect
.
GetWidth
()
<=
0
)
||
(
rect
.
GetHeight
()
<=
0
))
{
HILOG_DEBUG
(
HILOG_MODULE_GRAPHIC
,
"DrawRect::Draw width or height is zero
\n
"
);
GRAPHIC_LOGD
(
"DrawRect::Draw width or height is zero
\n
"
);
return
;
}
...
...
frameworks/draw/draw_utils.cpp
浏览文件 @
9f199e77
...
...
@@ -492,7 +492,7 @@ void DrawUtils::FillAreaWithSoftWare(BufferInfo& gfxDstBuffer,
{
DEBUG_PERFORMANCE_TRACE
(
"memcpy"
);
if
(
memcpy_s
(
dest
,
dstMaxSize
,
memStart
,
memSize
)
!=
EOK
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"DrawUtils::FillAreaWithSoftWare memcpy failed!
\n
"
);
GRAPHIC_LOGE
(
"DrawUtils::FillAreaWithSoftWare memcpy failed!
\n
"
);
return
;
}
}
...
...
frameworks/font/glyphs_manager.cpp
浏览文件 @
9f199e77
...
...
@@ -63,7 +63,7 @@ int8_t GlyphsManager::GlyphNodeCacheInit()
int32_t
ret
=
read
(
fp_
,
indexCache_
,
size
);
if
(
ret
!=
static_cast
<
int32_t
>
(
size
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GlyphNodeCacheInit read failed"
);
GRAPHIC_LOGE
(
"GlyphsManager::GlyphNodeCacheInit read failed"
);
return
INVALID_RET_VALUE
;
}
...
...
@@ -139,7 +139,7 @@ GlyphNode* GlyphsManager::GetNodeFromFile(uint32_t unicode)
offset
+=
key
*
sizeof
(
uint16_t
);
idx
=
*
(
reinterpret_cast
<
uint16_t
*>
(
curIndexCache_
+
offset
));
if
(
idx
==
0
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetNodeFromFile unicode not found"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetNodeFromFile unicode not found"
);
return
nullptr
;
}
}
...
...
@@ -147,13 +147,13 @@ GlyphNode* GlyphsManager::GetNodeFromFile(uint32_t unicode)
offset
=
curGlyphNodeSectionStart_
+
(
idx
-
1
)
*
sizeof
(
GlyphNode
);
int32_t
ret
=
lseek
(
fp_
,
offset
,
SEEK_SET
);
if
(
ret
!=
static_cast
<
int32_t
>
(
offset
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetNodeFromFile lseek failed"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetNodeFromFile lseek failed"
);
return
nullptr
;
}
GlyphNode
*
node
=
GetNodeCacheSpace
(
unicode
);
ret
=
read
(
fp_
,
node
,
sizeof
(
GlyphNode
));
if
(
ret
<
0
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetNodeFromFile read failed"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetNodeFromFile read failed"
);
return
nullptr
;
}
...
...
@@ -169,7 +169,7 @@ void GlyphsManager::SetRamBuffer(uintptr_t ramAddr)
int8_t
GlyphsManager
::
SetFile
(
int32_t
fp
,
uint32_t
start
)
{
if
(
!
isRamSet_
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::SetFile Ram not set"
);
GRAPHIC_LOGE
(
"GlyphsManager::SetFile Ram not set"
);
return
INVALID_RET_VALUE
;
}
...
...
@@ -177,19 +177,19 @@ int8_t GlyphsManager::SetFile(int32_t fp, uint32_t start)
start_
=
start
;
int32_t
ret
=
lseek
(
fp_
,
start_
,
SEEK_SET
);
if
(
ret
<
0
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::SetFile lseek failed"
);
GRAPHIC_LOGE
(
"GlyphsManager::SetFile lseek failed"
);
return
INVALID_RET_VALUE
;
}
ret
=
read
(
fp_
,
&
binHeader_
,
sizeof
(
binHeader_
));
if
(
ret
!=
sizeof
(
binHeader_
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::SetFile read failed"
);
GRAPHIC_LOGE
(
"GlyphsManager::SetFile read failed"
);
return
INVALID_RET_VALUE
;
}
if
(
strncmp
(
binHeader_
.
fontMagic
,
FONT_MAGIC_NUMBER
,
FONT_MAGIC_NUM_LEN
)
!=
0
)
{
return
INVALID_RET_VALUE
;
}
if
(
binHeader_
.
fontNum
>
UIFontBuilder
::
GetInstance
()
->
GetBitmapFontIdMax
())
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::SetFile data error, fontNum need less than max fontId"
);
GRAPHIC_LOGE
(
"GlyphsManager::SetFile data error, fontNum need less than max fontId"
);
return
INVALID_RET_VALUE
;
}
...
...
@@ -204,7 +204,7 @@ int8_t GlyphsManager::SetFile(int32_t fp, uint32_t start)
ret
=
read
(
fp_
,
fontHeaderCache_
,
size
);
if
(
ret
!=
size
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::SetFile read failed"
);
GRAPHIC_LOGE
(
"GlyphsManager::SetFile read failed"
);
return
INVALID_RET_VALUE
;
}
...
...
@@ -219,7 +219,7 @@ int8_t GlyphsManager::SetFile(int32_t fp, uint32_t start)
bitMapSectionStart_
=
glyphNodeSectionStart_
+
size
;
ret
=
GlyphNodeCacheInit
();
if
(
ret
==
RET_VALUE_OK
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::SetFile GlyphNodeCacheInit failed"
);
GRAPHIC_LOGE
(
"GlyphsManager::SetFile GlyphNodeCacheInit failed"
);
isFileSet_
=
true
;
}
...
...
@@ -231,11 +231,11 @@ int8_t GlyphsManager::SetCurrentFontId(uint8_t fontId)
{
uint16_t
fontIdx
=
0
;
if
(
!
isFileSet_
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::SetCurrentFontId file not set"
);
GRAPHIC_LOGE
(
"GlyphsManager::SetCurrentFontId file not set"
);
return
INVALID_RET_VALUE
;
}
if
(
fontId
>
UIFontBuilder
::
GetInstance
()
->
GetBitmapFontIdMax
())
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::SetCurrentFontId fontId need less than max fontId"
);
GRAPHIC_LOGE
(
"GlyphsManager::SetCurrentFontId fontId need less than max fontId"
);
return
INVALID_RET_VALUE
;
}
if
(
fontId_
==
fontId
)
{
...
...
@@ -262,7 +262,7 @@ int8_t GlyphsManager::SetCurrentFontId(uint8_t fontId)
isFontIdSet_
=
false
;
curFontHeader_
=
nullptr
;
fontId_
=
UIFontBuilder
::
GetInstance
()
->
GetBitmapFontIdMax
();
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::SetCurrentFontId fontId not found"
);
GRAPHIC_LOGE
(
"GlyphsManager::SetCurrentFontId fontId not found"
);
return
INVALID_RET_VALUE
;
}
...
...
@@ -285,7 +285,7 @@ int8_t GlyphsManager::SetCurrentFontId(uint8_t fontId)
int32_t
GlyphsManager
::
GetRamUsedLen
()
const
{
if
(
!
isFileSet_
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetRamUsedLen file not set"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetRamUsedLen file not set"
);
return
INVALID_RET_VALUE
;
}
return
ramUsedLen_
;
...
...
@@ -294,15 +294,15 @@ int32_t GlyphsManager::GetRamUsedLen() const
int8_t
GlyphsManager
::
GetFontVersion
(
char
*
version
,
uint8_t
len
)
const
{
if
(
!
isFileSet_
||
(
version
==
nullptr
)
||
(
len
>
FONT_VERSION_LEN
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetFontVersion invalid parameters"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetFontVersion invalid parameters"
);
return
INVALID_RET_VALUE
;
}
if
(
memset_s
(
version
,
len
,
0
,
len
)
!=
EOK
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetFontVersion memset_s failed"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetFontVersion memset_s failed"
);
return
INVALID_RET_VALUE
;
}
if
(
strcpy_s
(
version
,
len
,
binHeader_
.
fontVersion
)
!=
EOK
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetFontVersion strcpy_s failed"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetFontVersion strcpy_s failed"
);
return
INVALID_RET_VALUE
;
}
return
RET_VALUE_OK
;
...
...
@@ -347,12 +347,12 @@ const GlyphNode* GlyphsManager::GetGlyphNode(uint32_t unicode)
int16_t
GlyphsManager
::
GetFontHeight
()
const
{
if
(
!
isFontIdSet_
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetFontHeight fontId not set"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetFontHeight fontId not set"
);
return
INVALID_RET_VALUE
;
}
if
(
curFontHeader_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetFontHeight curFontHeader is nullptr"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetFontHeight curFontHeader is nullptr"
);
return
INVALID_RET_VALUE
;
}
...
...
@@ -364,12 +364,12 @@ int16_t GlyphsManager::GetFontWidth(uint32_t unicode)
const
GlyphNode
*
node
=
nullptr
;
if
(
!
isFontIdSet_
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetFontWidth fontId not set"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetFontWidth fontId not set"
);
return
INVALID_RET_VALUE
;
}
node
=
GetGlyphNode
(
unicode
);
if
(
node
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetFontWidth node not found"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetFontWidth node not found"
);
return
INVALID_RET_VALUE
;
}
return
node
->
advance
;
...
...
@@ -378,17 +378,17 @@ int16_t GlyphsManager::GetFontWidth(uint32_t unicode)
int8_t
GlyphsManager
::
GetBitmap
(
uint32_t
unicode
,
uint8_t
*
bitmap
)
{
if
(
bitmap
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetBitmap invalid parameter"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetBitmap invalid parameter"
);
return
INVALID_RET_VALUE
;
}
if
(
!
isFontIdSet_
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetBitmap fontId not set"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetBitmap fontId not set"
);
return
INVALID_RET_VALUE
;
}
const
GlyphNode
*
node
=
GetGlyphNode
(
unicode
);
if
(
node
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetBitmap node not found"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetBitmap node not found"
);
return
INVALID_RET_VALUE
;
}
...
...
@@ -396,13 +396,13 @@ int8_t GlyphsManager::GetBitmap(uint32_t unicode, uint8_t* bitmap)
uint32_t
size
=
node
->
kernOff
-
node
->
dataOff
;
int32_t
ret
=
lseek
(
fp_
,
offset
,
SEEK_SET
);
if
(
ret
!=
static_cast
<
int32_t
>
(
offset
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetBitmap lseek failed"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetBitmap lseek failed"
);
return
INVALID_RET_VALUE
;
}
int32_t
readSize
=
read
(
fp_
,
bitmap
,
size
);
if
(
readSize
!=
static_cast
<
int32_t
>
(
size
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::GetBitmap read failed"
);
GRAPHIC_LOGE
(
"GlyphsManager::GetBitmap read failed"
);
return
INVALID_RET_VALUE
;
}
...
...
frameworks/font/ui_font_bitmap.cpp
浏览文件 @
9f199e77
...
...
@@ -69,7 +69,7 @@ uint8_t UIFontBitmap::GetFontWeight(uint8_t fontId)
{
UITextLanguageFontParam
*
fontParam
=
UIFontBuilder
::
GetInstance
()
->
GetTextLangFontsTable
(
fontId
);
if
(
fontParam
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIFontBitmap::GetFontWeigh invalid fontId"
);
GRAPHIC_LOGE
(
"UIFontBitmap::GetFontWeigh invalid fontId"
);
return
0
;
}
return
fontParam
->
fontWeight
;
...
...
@@ -78,22 +78,22 @@ uint8_t UIFontBitmap::GetFontWeight(uint8_t fontId)
int8_t
UIFontBitmap
::
SetFontPath
(
const
char
*
dpath
,
const
char
*
spath
)
{
if
(
dpath
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIFontBitmap::SetFontPath invalid parameter"
);
GRAPHIC_LOGE
(
"UIFontBitmap::SetFontPath invalid parameter"
);
return
INVALID_RET_VALUE
;
}
#ifdef _WIN32
dynamicFontFd_
=
open
(
dpath
,
O_RDONLY
|
O_BINARY
);
#else
#else
dynamicFontFd_
=
open
(
dpath
,
O_RDONLY
);
#endif
if
(
dynamicFontFd_
<
0
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIFontBitmap::SetFontPath file Open failed"
);
GRAPHIC_LOGE
(
"UIFontBitmap::SetFontPath file Open failed"
);
return
INVALID_RET_VALUE
;
}
dynamicFont_
.
SetRamBuffer
(
GetRamAddr
());
int32_t
ret
=
dynamicFont_
.
SetFile
(
dynamicFontFd_
,
offset_
);
if
(
ret
==
INVALID_RET_VALUE
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"GlyphsManager::SetFile failed"
);
GRAPHIC_LOGE
(
"GlyphsManager::SetFile failed"
);
close
(
dynamicFontFd_
);
dynamicFontFd_
=
-
1
;
return
ret
;
...
...
@@ -172,7 +172,7 @@ int8_t UIFontBitmap::GetGlyphNode(uint32_t unicode, GlyphNode& glyphNode)
glyphNode
=
*
node
;
return
RET_VALUE_OK
;
}
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIFontBitmap::GetGlyphNode get glyphNode failed"
);
GRAPHIC_LOGE
(
"UIFontBitmap::GetGlyphNode get glyphNode failed"
);
return
INVALID_RET_VALUE
;
}
...
...
@@ -225,7 +225,7 @@ uint8_t* UIFontBitmap::GetCacheBitmap(uint8_t fontId, uint32_t unicode)
if
(
bitmapCache_
!=
nullptr
)
{
return
bitmapCache_
->
GetBitmap
(
fontId
,
unicode
);
}
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIFontBitmap::GetCacheBitmap invalid bitmapCache"
);
GRAPHIC_LOGE
(
"UIFontBitmap::GetCacheBitmap invalid bitmapCache"
);
return
nullptr
;
}
...
...
@@ -234,7 +234,7 @@ uint8_t* UIFontBitmap::GetCacheSpace(uint8_t fontId, uint32_t unicode, uint32_t
if
(
bitmapCache_
!=
nullptr
)
{
return
bitmapCache_
->
GetSpace
(
fontId
,
unicode
,
size
);
}
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIFontBitmap::GetCacheSpace invalid bitmapCache"
);
GRAPHIC_LOGE
(
"UIFontBitmap::GetCacheSpace invalid bitmapCache"
);
return
nullptr
;
}
...
...
@@ -243,7 +243,7 @@ void UIFontBitmap::PutCacheSpace(uint8_t* addr)
if
(
bitmapCache_
!=
nullptr
)
{
bitmapCache_
->
PutSpace
(
addr
);
}
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIFontBitmap::PutCacheSpace invalid bitmapCache"
);
GRAPHIC_LOGE
(
"UIFontBitmap::PutCacheSpace invalid bitmapCache"
);
}
int8_t
UIFontBitmap
::
SetDynamicFontId
(
uint8_t
fontId
)
...
...
@@ -263,7 +263,7 @@ int16_t UIFontBitmap::GetDynamicFontWidth(uint32_t unicode, uint8_t fontId)
uint8_t
*
UIFontBitmap
::
SearchInFont
(
uint32_t
unicode
,
GlyphNode
&
glyphNode
,
uint8_t
fontId
)
{
if
(
!
UIFontAdaptor
::
IsSameTTFId
(
fontId
,
unicode
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIFontBitmap::GetWidthInFontId fontId and unicode not match"
);
GRAPHIC_LOGE
(
"UIFontBitmap::GetWidthInFontId fontId and unicode not match"
);
return
nullptr
;
}
if
(
fontId
!=
GetBaseFontId
())
{
...
...
@@ -299,7 +299,7 @@ uint8_t* UIFontBitmap::SearchInFont(uint32_t unicode, GlyphNode& glyphNode, uint
int16_t
UIFontBitmap
::
GetWidthInFontId
(
uint32_t
unicode
,
uint8_t
fontId
)
{
if
(
!
UIFontAdaptor
::
IsSameTTFId
(
fontId
,
unicode
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"UIFontBitmap::GetWidthInFontId fontId and unicode not match"
);
GRAPHIC_LOGE
(
"UIFontBitmap::GetWidthInFontId fontId and unicode not match"
);
return
INVALID_RET_VALUE
;
}
if
(
fontId
!=
GetBaseFontId
())
{
...
...
frameworks/imgdecode/cache_manager.cpp
浏览文件 @
9f199e77
...
...
@@ -183,7 +183,7 @@ bool CacheManager::GetImageHeader(const char* path, ImageHeader& header)
Style
useless
;
RetCode
ret
=
Open
(
path
,
useless
,
entry
);
if
(
ret
!=
RetCode
::
OK
)
{
HILOG_WARN
(
HILOG_MODULE_GRAPHIC
,
"CacheManager::GetImageHeader Image get info found unknown src type
\n
"
);
GRAPHIC_LOGW
(
"CacheManager::GetImageHeader Image get info found unknown src type
\n
"
);
return
false
;
}
...
...
frameworks/imgdecode/image_load.cpp
浏览文件 @
9f199e77
...
...
@@ -47,14 +47,14 @@ bool ImageLoad::CreateImage(ImageInfo& imageInfo)
bytePerPixel
=
2
;
// 2 bytes per pixel
break
;
default:
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"CreateImage invalid colorMode."
);
GRAPHIC_LOGE
(
"CreateImage invalid colorMode."
);
return
false
;
}
imageInfo
.
dataSize
=
imageHeader
.
width
*
imageHeader
.
height
*
bytePerPixel
;
imageInfo
.
data
=
static_cast
<
uint8_t
*>
(
ImageCacheMalloc
(
imageInfo
));
if
(
imageInfo
.
data
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"ImageCacheMalloc error."
);
GRAPHIC_LOGE
(
"ImageCacheMalloc error."
);
return
false
;
}
...
...
@@ -64,7 +64,7 @@ bool ImageLoad::CreateImage(ImageInfo& imageInfo)
bool
ImageLoad
::
UncompressImageInZip
(
ImageInfo
&
imageInfo
,
uint8_t
*
buffer
,
uint32_t
size
)
{
if
(
!
CreateImage
(
imageInfo
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"Create image error."
);
GRAPHIC_LOGE
(
"Create image error."
);
return
false
;
}
...
...
@@ -81,7 +81,7 @@ bool ImageLoad::UnzipImage(uint8_t* imageBuffer, uint32_t size, ImageInfo& image
uint32_t
count
=
0
;
if
((
imageBuffer
==
nullptr
)
||
(
size
==
0
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"imageHeader is null."
);
GRAPHIC_LOGE
(
"imageHeader is null."
);
return
false
;
}
...
...
@@ -120,7 +120,7 @@ bool ImageLoad::UnzipImage(uint8_t* imageBuffer, uint32_t size, ImageInfo& image
bool
ImageLoad
::
Unzip24Image
(
uint8_t
*
imageBuffer
,
uint32_t
size
,
ImageInfo
&
imageInfo
)
{
if
((
imageBuffer
==
nullptr
)
||
(
size
==
0
))
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"imageHeader is null."
);
GRAPHIC_LOGE
(
"imageHeader is null."
);
return
false
;
}
...
...
@@ -196,7 +196,7 @@ bool ImageLoad::GetImageInfo(int32_t fd, uint32_t size, ImageInfo& imageInfo)
if
(
read
(
fd
,
buffer
,
size
)
!=
static_cast
<
int32_t
>
(
size
))
{
UIFree
(
buffer
);
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"SeekImageFile error."
);
GRAPHIC_LOGE
(
"SeekImageFile error."
);
return
false
;
}
bool
ret
=
UnZip2ImageInfo
(
imageInfo
,
buffer
,
size
);
...
...
frameworks/window/window_impl.cpp
浏览文件 @
9f199e77
...
...
@@ -25,7 +25,7 @@ WindowImpl::~WindowImpl() {}
bool
WindowImpl
::
Create
(
const
WindowConfig
&
config
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"Create"
);
GRAPHIC_LOGI
(
"Create"
);
if
(
iWindow_
==
nullptr
)
{
config_
=
config
;
LiteWinConfig
liteConfig
;
...
...
@@ -53,13 +53,13 @@ void WindowImpl::Destory()
void
WindowImpl
::
AddToDisplay
()
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"AddToDisplay"
);
GRAPHIC_LOGI
(
"AddToDisplay"
);
RenderManager
::
GetInstance
().
AddToDisplay
(
this
);
}
void
WindowImpl
::
RemoveFromDisplay
()
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"RemoveFromDisplay"
);
GRAPHIC_LOGI
(
"RemoveFromDisplay"
);
RenderManager
::
GetInstance
().
RemoveFromDisplay
(
this
);
}
...
...
@@ -69,14 +69,14 @@ void WindowImpl::BindRootView(RootView* rootView)
return
;
}
UnbindRootView
();
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"BindRootView"
);
GRAPHIC_LOGI
(
"BindRootView"
);
rootView_
=
rootView
;
rootView_
->
boundWindow_
=
this
;
}
void
WindowImpl
::
UnbindRootView
()
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"UnbindRootView"
);
GRAPHIC_LOGI
(
"UnbindRootView"
);
if
(
rootView_
!=
nullptr
)
{
rootView_
->
boundWindow_
=
nullptr
;
rootView_
=
nullptr
;
...
...
@@ -120,7 +120,7 @@ void WindowImpl::Hide()
void
WindowImpl
::
MoveTo
(
int16_t
x
,
int16_t
y
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"MoveTo"
);
GRAPHIC_LOGI
(
"MoveTo"
);
config_
.
rect
.
SetPosition
(
x
,
y
);
if
(
iWindow_
!=
nullptr
)
{
iWindow_
->
MoveTo
(
x
,
y
);
...
...
@@ -129,7 +129,7 @@ void WindowImpl::MoveTo(int16_t x, int16_t y)
void
WindowImpl
::
Resize
(
int16_t
width
,
int16_t
height
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"Resize"
);
GRAPHIC_LOGI
(
"Resize"
);
if
((
width
==
config_
.
rect
.
GetWidth
())
&&
(
height
==
config_
.
rect
.
GetHeight
()))
{
return
;
}
...
...
@@ -147,7 +147,7 @@ void WindowImpl::Resize(int16_t width, int16_t height)
void
WindowImpl
::
RaiseToTop
()
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"RaiseToTop"
);
GRAPHIC_LOGI
(
"RaiseToTop"
);
if
(
iWindow_
!=
nullptr
)
{
iWindow_
->
RaiseToTop
();
}
...
...
@@ -155,7 +155,7 @@ void WindowImpl::RaiseToTop()
void
WindowImpl
::
LowerToBottom
()
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"LowerToBottom"
);
GRAPHIC_LOGI
(
"LowerToBottom"
);
if
(
iWindow_
!=
nullptr
)
{
iWindow_
->
LowerToBottom
();
}
...
...
@@ -165,7 +165,7 @@ void WindowImpl::Render()
{
UpdateHalDisplayBuffer
();
if
(
gfxAlloc_
.
virAddr
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"window buffer is null, windId=%d"
,
GetWindowId
());
GRAPHIC_LOGE
(
"window buffer is null, windId=%d"
,
GetWindowId
());
return
;
}
...
...
@@ -188,14 +188,14 @@ int32_t WindowImpl::GetWindowId()
if
(
iWindow_
!=
nullptr
)
{
return
iWindow_
->
GetWindowId
();
}
else
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"iwindow is null!"
);
GRAPHIC_LOGE
(
"iwindow is null!"
);
return
INVALID_WINDOW_ID
;
}
}
void
WindowImpl
::
Flush
()
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"Flush"
);
GRAPHIC_LOGI
(
"Flush"
);
if
(
iWindow_
==
nullptr
)
{
return
;
}
...
...
interfaces/kits/components/ui_arc_label.h
浏览文件 @
9f199e77
...
...
@@ -361,7 +361,16 @@ public:
protected:
Text
*
arcLabelText_
;
virtual
void
InitArcLabelText
();
virtual
void
InitArcLabelText
()
{
if
(
arcLabelText_
==
nullptr
)
{
arcLabelText_
=
new
Text
();
if
(
arcLabelText_
==
nullptr
)
{
GRAPHIC_LOGE
(
"new Text fail"
);
return
;
}
}
}
void
RefreshArcLabel
();
private:
...
...
interfaces/kits/components/ui_label_button.h
浏览文件 @
9f199e77
...
...
@@ -37,6 +37,7 @@
#include "common/text.h"
#include "components/ui_button.h"
#include "gfx_utils/graphic_log.h"
namespace
OHOS
{
/**
...
...
@@ -289,7 +290,17 @@ public:
}
protected:
virtual
void
InitLabelButtonText
();
virtual
void
InitLabelButtonText
()
{
if
(
labelButtonText_
==
nullptr
)
{
labelButtonText_
=
new
Text
();
if
(
labelButtonText_
==
nullptr
)
{
GRAPHIC_LOGE
(
"new Text fail"
);
return
;
}
labelButtonText_
->
SetAlign
(
TEXT_ALIGNMENT_CENTER
,
TEXT_ALIGNMENT_CENTER
);
}
}
Text
*
labelButtonText_
;
...
...
interfaces/kits/components/ui_picker.h
浏览文件 @
9f199e77
...
...
@@ -381,7 +381,16 @@ protected:
void
RefreshList
();
virtual
void
ClearList
();
virtual
void
Refresh
();
virtual
void
InitTextAdapter
();
virtual
void
InitTextAdapter
()
{
if
(
textAdapter_
==
nullptr
)
{
textAdapter_
=
new
TextAdapter
();
if
(
textAdapter_
==
nullptr
)
{
GRAPHIC_LOGE
(
"new TextAdapter fail"
);
return
;
}
}
}
bool
isWidthSet_
:
1
;
bool
isHeightSet_
:
1
;
...
...
interfaces/kits/components/ui_view.h
浏览文件 @
9f199e77
...
...
@@ -49,6 +49,7 @@
#include "gfx_utils/color.h"
#include "gfx_utils/geometry2d.h"
#include "gfx_utils/graphic_buffer.h"
#include "gfx_utils/graphic_log.h"
#include "gfx_utils/heap_base.h"
#include "gfx_utils/image_info.h"
#include "gfx_utils/style.h"
...
...
@@ -891,7 +892,19 @@ public:
* @since 1.0
* @version 1.0
*/
void
ResizeVisibleArea
(
int16_t
x
,
int16_t
y
,
int16_t
width
,
int16_t
height
);
void
ResizeVisibleArea
(
int16_t
x
,
int16_t
y
,
int16_t
width
,
int16_t
height
)
{
if
(
visibleRect_
==
nullptr
)
{
visibleRect_
=
new
Rect
();
if
(
visibleRect_
==
nullptr
)
{
GRAPHIC_LOGE
(
"new Rect fail"
);
return
;
}
}
visibleRect_
->
SetWidth
(
width
);
visibleRect_
->
SetHeight
(
height
);
visibleRect_
->
SetPosition
(
x
,
y
);
}
/**
* @brief Sets the width for the view.
...
...
test/framework/src/compare_tools.cpp
浏览文件 @
9f199e77
...
...
@@ -119,7 +119,7 @@ bool CompareTools::CompareFile(const char* filePath, size_t length)
bool
flag
=
CompareByBit
(
fd
);
close
(
fd
);
if
(
flag
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"[COMPARE_SUCCESS]:fileName=%s"
,
filePath
);
GRAPHIC_LOGI
(
"[COMPARE_SUCCESS]:fileName=%s"
,
filePath
);
if
(
enableLog_
)
{
char
logInfo
[
DEFAULT_FILE_NAME_MAX_LENGTH
]
=
{
0
};
if
(
sprintf_s
(
logInfo
,
sizeof
(
logInfo
),
"[COMPARE_SUCCESS]:fileName=%s
\n
"
,
filePath
)
<
0
)
{
...
...
@@ -128,7 +128,7 @@ bool CompareTools::CompareFile(const char* filePath, size_t length)
SaveLog
(
logInfo
,
strlen
(
logInfo
));
}
}
else
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"[COMPARE_FAILURE]:fileName=%s"
,
filePath
);
GRAPHIC_LOGI
(
"[COMPARE_FAILURE]:fileName=%s"
,
filePath
);
if
(
enableLog_
)
{
char
logInfo
[
DEFAULT_FILE_NAME_MAX_LENGTH
]
=
{
0
};
if
(
sprintf_s
(
logInfo
,
sizeof
(
logInfo
),
"[COMPARE_FAILURE]:fileName=%s
\n
"
,
filePath
)
<
0
)
{
...
...
@@ -185,7 +185,7 @@ bool CompareTools::SaveFile(const char* filePath, size_t length)
bool
flag
=
SaveByBit
(
fd
);
close
(
fd
);
if
(
flag
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"[SAVE_SUCCESS]:filePath = %s"
,
filePath
);
GRAPHIC_LOGI
(
"[SAVE_SUCCESS]:filePath = %s"
,
filePath
);
if
(
enableLog_
)
{
char
logInfo
[
DEFAULT_FILE_NAME_MAX_LENGTH
]
=
{
0
};
if
(
sprintf_s
(
logInfo
,
sizeof
(
logInfo
),
"[SAVE_SUCCESS]:fileName=%s
\n
"
,
filePath
)
<
0
)
{
...
...
@@ -194,7 +194,7 @@ bool CompareTools::SaveFile(const char* filePath, size_t length)
SaveLog
(
logInfo
,
strlen
(
logInfo
));
}
}
else
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"[SAVE_FAILURE]:filePath = %s"
,
filePath
);
GRAPHIC_LOGI
(
"[SAVE_FAILURE]:filePath = %s"
,
filePath
);
if
(
enableLog_
)
{
char
logInfo
[
DEFAULT_FILE_NAME_MAX_LENGTH
]
=
{
0
};
if
(
sprintf_s
(
logInfo
,
sizeof
(
logInfo
),
"[SAVE_FAILURE]:fileName=%s
\n
"
,
filePath
)
<
0
)
{
...
...
@@ -227,7 +227,7 @@ void CompareTools::SetLogPath(const char* filePath, size_t length)
return
;
}
if
(
memcpy_s
(
logPath_
,
length
,
filePath
,
length
)
!=
EOK
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"memcpy filepath failed"
);
GRAPHIC_LOGE
(
"memcpy filepath failed"
);
return
;
}
enableLog_
=
true
;
...
...
@@ -250,12 +250,12 @@ bool CompareTools::SaveLog(const char* buff, size_t bufSize)
}
uint32_t
logFd
=
open
(
logPath_
,
O_WRONLY
|
O_CREAT
|
O_APPEND
);
if
(
logFd
==
-
1
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"open log failed"
);
GRAPHIC_LOGE
(
"open log failed"
);
return
false
;
}
if
(
write
(
logFd
,
buff
,
bufSize
)
<
0
)
{
close
(
logFd
);
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"write log failed"
);
GRAPHIC_LOGE
(
"write log failed"
);
return
false
;
}
close
(
logFd
);
...
...
test/uitest/test_ui_dump_dom_tree/ui_test_dump_dom.cpp
浏览文件 @
9f199e77
...
...
@@ -138,12 +138,12 @@ public:
{
if
(
UIDumpDomTree
::
GetInstance
()
->
DumpDomTree
(
id_
))
{
if
(
id_
==
nullptr
)
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"dump tree from rootView success
\n
"
);
GRAPHIC_LOGI
(
"dump tree from rootView success
\n
"
);
}
else
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"dump tree from id success
\n
"
);
GRAPHIC_LOGI
(
"dump tree from id success
\n
"
);
}
}
else
{
HILOG_INFO
(
HILOG_MODULE_GRAPHIC
,
"dump tree failed
\n
"
);
GRAPHIC_LOGI
(
"dump tree failed
\n
"
);
}
uiView_
->
Invalidate
();
return
true
;
...
...
test/unittest/dfx/event_injector_unit_test.cpp
浏览文件 @
9f199e77
...
...
@@ -137,7 +137,7 @@ void EventInjectorTest::TestApp()
config
.
rect
.
SetRect
(
0
,
0
,
Screen
::
GetInstance
().
GetWidth
()
-
1
,
Screen
::
GetInstance
().
GetHeight
()
-
1
);
window_
=
Window
::
CreateWindow
(
config
);
if
(
window_
==
nullptr
)
{
HILOG_ERROR
(
HILOG_MODULE_GRAPHIC
,
"Create window false!"
);
GRAPHIC_LOGE
(
"Create window false!"
);
return
;
}
window_
->
BindRootView
(
RootView
::
GetInstance
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录