Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Graphic Ui
提交
5476da58
G
Graphic Ui
项目概览
OpenHarmony
/
Graphic Ui
大约 1 年 前同步成功
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Graphic Ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
5476da58
编写于
1月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!584 修改编译告警
Merge pull request !584 from niulihua/master
上级
479d0d2f
01fa9251
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
66 addition
and
112 deletion
+66
-112
frameworks/common/image.cpp
frameworks/common/image.cpp
+63
-97
frameworks/components/ui_arc_scroll_bar.cpp
frameworks/components/ui_arc_scroll_bar.cpp
+2
-2
frameworks/dock/screen_device_proxy.cpp
frameworks/dock/screen_device_proxy.cpp
+0
-9
frameworks/draw/draw_utils.cpp
frameworks/draw/draw_utils.cpp
+0
-4
interfaces/kits/common/image.h
interfaces/kits/common/image.h
+1
-0
未找到文件。
frameworks/common/image.cpp
浏览文件 @
5476da58
...
@@ -33,16 +33,9 @@ Image::~Image()
...
@@ -33,16 +33,9 @@ Image::~Image()
if
(
srcType_
==
IMG_SRC_FILE
)
{
if
(
srcType_
==
IMG_SRC_FILE
)
{
CacheManager
::
GetInstance
().
Close
(
path_
);
CacheManager
::
GetInstance
().
Close
(
path_
);
}
}
if
(
imageInfo_
!=
nullptr
)
{
if
(
mallocFlag_
)
{
ReInitImageInfo
(
nullptr
,
false
);
if
(
imageInfo_
->
data
!=
nullptr
)
{
UIFree
(
reinterpret_cast
<
void
*>
(
const_cast
<
uint8_t
*>
(
imageInfo_
->
data
)));
}
mallocFlag_
=
false
;
}
UIFree
(
reinterpret_cast
<
void
*>
(
const_cast
<
ImageInfo
*>
(
imageInfo_
)));
imageInfo_
=
nullptr
;
}
if
(
path_
!=
nullptr
)
{
if
(
path_
!=
nullptr
)
{
UIFree
(
reinterpret_cast
<
void
*>
(
const_cast
<
char
*>
(
path_
)));
UIFree
(
reinterpret_cast
<
void
*>
(
const_cast
<
char
*>
(
path_
)));
path_
=
nullptr
;
path_
=
nullptr
;
...
@@ -92,9 +85,10 @@ bool Image::SetStandardSrc(const char* src)
...
@@ -92,9 +85,10 @@ bool Image::SetStandardSrc(const char* src)
if
(
src
==
nullptr
)
{
if
(
src
==
nullptr
)
{
return
false
;
return
false
;
}
}
srcType_
=
IMG_SRC_UNKNOWN
;
const
char
*
ptr
=
strrchr
(
src
,
'.'
);
const
char
*
ptr
=
strrchr
(
src
,
'.'
);
if
(
ptr
==
nullptr
)
{
if
(
ptr
==
nullptr
)
{
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
...
@@ -110,14 +104,12 @@ bool Image::SetStandardSrc(const char* src)
...
@@ -110,14 +104,12 @@ bool Image::SetStandardSrc(const char* src)
size_t
strLen
=
strlen
(
src
)
+
1
;
size_t
strLen
=
strlen
(
src
)
+
1
;
char
*
imagePath
=
static_cast
<
char
*>
(
UIMalloc
(
static_cast
<
uint32_t
>
(
strLen
)));
char
*
imagePath
=
static_cast
<
char
*>
(
UIMalloc
(
static_cast
<
uint32_t
>
(
strLen
)));
if
(
imagePath
==
nullptr
)
{
if
(
imagePath
==
nullptr
)
{
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
if
(
strcpy_s
(
imagePath
,
strLen
,
src
)
!=
EOK
)
{
if
(
strcpy_s
(
imagePath
,
strLen
,
src
)
!=
EOK
)
{
UIFree
(
reinterpret_cast
<
void
*>
(
imagePath
));
UIFree
(
reinterpret_cast
<
void
*>
(
imagePath
));
imagePath
=
nullptr
;
imagePath
=
nullptr
;
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
path_
=
imagePath
;
path_
=
imagePath
;
...
@@ -130,16 +122,16 @@ bool Image::SetLiteSrc(const char* src)
...
@@ -130,16 +122,16 @@ bool Image::SetLiteSrc(const char* src)
if
(
src
==
nullptr
)
{
if
(
src
==
nullptr
)
{
return
false
;
return
false
;
}
}
srcType_
=
IMG_SRC_UNKNOWN
;
const
char
*
ptr
=
strrchr
(
src
,
'.'
);
const
char
*
ptr
=
strrchr
(
src
,
'.'
);
if
(
ptr
==
nullptr
)
{
if
(
ptr
==
nullptr
)
{
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
size_t
strLen
=
strlen
(
src
)
+
1
;
size_t
strLen
=
strlen
(
src
)
+
1
;
char
*
imagePath
=
static_cast
<
char
*>
(
UIMalloc
(
static_cast
<
uint32_t
>
(
strLen
)));
char
*
imagePath
=
static_cast
<
char
*>
(
UIMalloc
(
static_cast
<
uint32_t
>
(
strLen
)));
if
(
imagePath
==
nullptr
)
{
if
(
imagePath
==
nullptr
)
{
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
if
(
IsImgValid
(
ptr
))
{
if
(
IsImgValid
(
ptr
))
{
...
@@ -147,21 +139,18 @@ bool Image::SetLiteSrc(const char* src)
...
@@ -147,21 +139,18 @@ bool Image::SetLiteSrc(const char* src)
if
(
memcpy_s
(
imagePath
,
strLen
,
src
,
strLen
)
!=
EOK
)
{
if
(
memcpy_s
(
imagePath
,
strLen
,
src
,
strLen
)
!=
EOK
)
{
UIFree
(
reinterpret_cast
<
void
*>
(
imagePath
));
UIFree
(
reinterpret_cast
<
void
*>
(
imagePath
));
imagePath
=
nullptr
;
imagePath
=
nullptr
;
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
(
ptr
-
src
+
imagePath
)[
1
]
=
'\0'
;
// remove suffix
(
ptr
-
src
+
imagePath
)[
1
]
=
'\0'
;
// remove suffix
if
(
strcat_s
(
imagePath
,
strLen
,
suffixName
)
!=
EOK
)
{
if
(
strcat_s
(
imagePath
,
strLen
,
suffixName
)
!=
EOK
)
{
UIFree
(
reinterpret_cast
<
void
*>
(
imagePath
));
UIFree
(
reinterpret_cast
<
void
*>
(
imagePath
));
imagePath
=
nullptr
;
imagePath
=
nullptr
;
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
}
else
{
}
else
{
if
(
memcpy_s
(
imagePath
,
strLen
,
src
,
strLen
)
!=
EOK
)
{
if
(
memcpy_s
(
imagePath
,
strLen
,
src
,
strLen
)
!=
EOK
)
{
UIFree
(
reinterpret_cast
<
void
*>
(
imagePath
));
UIFree
(
reinterpret_cast
<
void
*>
(
imagePath
));
imagePath
=
nullptr
;
imagePath
=
nullptr
;
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
}
}
...
@@ -184,43 +173,30 @@ bool Image::SetSrc(const char* src)
...
@@ -184,43 +173,30 @@ bool Image::SetSrc(const char* src)
return
SetStandardSrc
(
src
);
return
SetStandardSrc
(
src
);
}
}
return
SetLiteSrc
(
src
);
return
SetLiteSrc
(
src
);
}
else
{
path_
=
src
;
srcType_
=
IMG_SRC_UNKNOWN
;
}
}
srcType_
=
IMG_SRC_UNKNOWN
;
return
true
;
return
true
;
}
}
bool
Image
::
SetSrc
(
const
ImageInfo
*
src
)
bool
Image
::
SetSrc
(
const
ImageInfo
*
src
)
{
{
if
(
imageInfo_
!=
nullptr
)
{
ReInitImageInfo
(
nullptr
,
false
);
if
(
mallocFlag_
)
{
srcType_
=
IMG_SRC_UNKNOWN
;
if
(
imageInfo_
->
data
!=
nullptr
)
{
imageInfo_
=
nullptr
;
UIFree
(
reinterpret_cast
<
void
*>
(
const_cast
<
uint8_t
*>
(
imageInfo_
->
data
)));
}
mallocFlag_
=
false
;
}
UIFree
(
reinterpret_cast
<
void
*>
(
const_cast
<
ImageInfo
*>
(
imageInfo_
)));
imageInfo_
=
nullptr
;
}
if
(
src
!=
nullptr
)
{
if
(
src
!=
nullptr
)
{
imageInfo_
=
static_cast
<
ImageInfo
*>
(
UIMalloc
(
static_cast
<
uint32_t
>
(
sizeof
(
ImageInfo
))));
imageInfo_
=
static_cast
<
ImageInfo
*>
(
UIMalloc
(
static_cast
<
uint32_t
>
(
sizeof
(
ImageInfo
))));
if
(
imageInfo_
==
nullptr
)
{
if
(
imageInfo_
==
nullptr
)
{
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
if
(
memcpy_s
(
const_cast
<
ImageInfo
*>
(
imageInfo_
),
sizeof
(
ImageInfo
),
src
,
sizeof
(
ImageInfo
))
!=
EOK
)
{
if
(
memcpy_s
(
const_cast
<
ImageInfo
*>
(
imageInfo_
),
sizeof
(
ImageInfo
),
src
,
sizeof
(
ImageInfo
))
!=
EOK
)
{
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
srcType_
=
IMG_SRC_VARIABLE
;
srcType_
=
IMG_SRC_VARIABLE
;
}
else
{
imageInfo_
=
src
;
srcType_
=
IMG_SRC_UNKNOWN
;
}
}
return
true
;
return
true
;
}
}
...
@@ -240,24 +216,50 @@ void Image::DrawImage(BufferInfo& gfxDstBuffer,
...
@@ -240,24 +216,50 @@ void Image::DrawImage(BufferInfo& gfxDstBuffer,
}
}
#if ENABLE_JPEG_AND_PNG
#if ENABLE_JPEG_AND_PNG
static
inline
void
FreePngBytep
(
png_bytep
**
rowPointer
,
uint16_t
size
)
{
png_bytep
*
tmpRowPointer
=
*
rowPointer
;
for
(
uint16_t
i
=
0
;
i
<
size
;
i
++
)
{
UIFree
(
tmpRowPointer
[
i
]);
tmpRowPointer
[
i
]
=
nullptr
;
}
UIFree
(
*
rowPointer
);
*
rowPointer
=
nullptr
;
}
static
inline
png_bytep
*
MallocPngBytep
(
uint16_t
height
,
uint32_t
rowBytes
)
{
png_bytep
*
rowPointer
=
static_cast
<
png_bytep
*>
(
UIMalloc
(
sizeof
(
png_bytep
)
*
height
));
if
(
rowPointer
==
nullptr
)
{
return
nullptr
;
}
for
(
uint16_t
y
=
0
;
y
<
height
;
y
++
)
{
rowPointer
[
y
]
=
static_cast
<
png_byte
*>
(
UIMalloc
(
rowBytes
));
if
(
rowPointer
[
y
]
==
nullptr
)
{
FreePngBytep
(
&
rowPointer
,
y
);
return
nullptr
;
}
}
return
rowPointer
;
}
bool
Image
::
SetPNGSrc
(
const
char
*
src
)
bool
Image
::
SetPNGSrc
(
const
char
*
src
)
{
{
srcType_
=
IMG_SRC_UNKNOWN
;
FILE
*
infile
=
nullptr
;
FILE
*
infile
=
nullptr
;
png_bytep
*
rowPointer
=
nullptr
;
png_bytep
*
rowPointer
=
nullptr
;
png_structp
png
=
png_create_read_struct
(
PNG_LIBPNG_VER_STRING
,
nullptr
,
nullptr
,
nullptr
);
png_structp
png
=
png_create_read_struct
(
PNG_LIBPNG_VER_STRING
,
nullptr
,
nullptr
,
nullptr
);
if
(
png
==
nullptr
)
{
if
(
png
==
nullptr
)
{
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
png_infop
info
=
png_create_info_struct
(
png
);
png_infop
info
=
png_create_info_struct
(
png
);
if
(
info
==
nullptr
)
{
if
(
info
==
nullptr
)
{
srcType_
=
IMG_SRC_UNKNOWN
;
png_destroy_read_struct
(
&
png
,
&
info
,
nullptr
);
png_destroy_read_struct
(
&
png
,
&
info
,
nullptr
);
return
false
;
return
false
;
}
}
if
((
infile
=
fopen
(
src
,
"rb"
))
==
nullptr
)
{
if
((
infile
=
fopen
(
src
,
"rb"
))
==
nullptr
)
{
GRAPHIC_LOGE
(
"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
);
png_destroy_read_struct
(
&
png
,
&
info
,
nullptr
);
return
false
;
return
false
;
}
}
...
@@ -292,49 +294,26 @@ bool Image::SetPNGSrc(const char* src)
...
@@ -292,49 +294,26 @@ bool Image::SetPNGSrc(const char* src)
png_set_interlace_handling
(
png
);
png_set_interlace_handling
(
png
);
png_read_update_info
(
png
,
info
);
png_read_update_info
(
png
,
info
);
rowPointer
=
static_cast
<
png_bytep
*>
(
UIMalloc
(
sizeof
(
png_bytep
)
*
height
));
rowPointer
=
MallocPngBytep
(
height
,
png_get_rowbytes
(
png
,
info
));
if
(
rowPointer
==
nullptr
)
{
if
(
rowPointer
==
nullptr
)
{
srcType_
=
IMG_SRC_UNKNOWN
;
fclose
(
infile
);
fclose
(
infile
);
png_destroy_read_struct
(
&
png
,
&
info
,
nullptr
);
png_destroy_read_struct
(
&
png
,
&
info
,
nullptr
);
return
false
;
return
false
;
}
}
for
(
uint16_t
y
=
0
;
y
<
height
;
y
++
)
{
rowPointer
[
y
]
=
static_cast
<
png_byte
*>
(
UIMalloc
(
png_get_rowbytes
(
png
,
info
)));
if
(
rowPointer
[
y
]
==
nullptr
)
{
for
(
uint16_t
i
=
0
;
i
<
y
;
i
++
)
{
UIFree
(
rowPointer
[
i
]);
rowPointer
[
i
]
=
nullptr
;
}
fclose
(
infile
);
UIFree
(
rowPointer
);
srcType_
=
IMG_SRC_UNKNOWN
;
png_destroy_read_struct
(
&
png
,
&
info
,
nullptr
);
return
false
;
}
}
png_read_image
(
png
,
rowPointer
);
png_read_image
(
png
,
rowPointer
);
fclose
(
infile
);
fclose
(
infile
);
png_destroy_read_struct
(
&
png
,
&
info
,
nullptr
);
png_destroy_read_struct
(
&
png
,
&
info
,
nullptr
);
ImageInfo
*
imgInfo
=
static_cast
<
ImageInfo
*>
(
UIMalloc
(
sizeof
(
ImageInfo
)));
ImageInfo
*
imgInfo
=
static_cast
<
ImageInfo
*>
(
UIMalloc
(
sizeof
(
ImageInfo
)));
if
(
imgInfo
==
nullptr
)
{
if
(
imgInfo
==
nullptr
)
{
for
(
uint16_t
i
=
0
;
i
<
height
;
i
++
)
{
FreePngBytep
(
&
rowPointer
,
height
);
UIFree
(
rowPointer
[
i
]);
rowPointer
[
i
]
=
nullptr
;
}
UIFree
(
rowPointer
);
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
uint8_t
*
srcData
=
static_cast
<
uint8_t
*>
(
UIMalloc
(
dataSize
));
uint8_t
*
srcData
=
static_cast
<
uint8_t
*>
(
UIMalloc
(
dataSize
));
if
(
srcData
==
nullptr
)
{
if
(
srcData
==
nullptr
)
{
for
(
uint16_t
i
=
0
;
i
<
height
;
i
++
)
{
FreePngBytep
(
&
rowPointer
,
height
);
UIFree
(
rowPointer
[
i
]);
rowPointer
[
i
]
=
nullptr
;
}
UIFree
(
rowPointer
);
UIFree
(
imgInfo
);
UIFree
(
imgInfo
);
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
uint32_t
n
=
0
;
uint32_t
n
=
0
;
...
@@ -346,10 +325,8 @@ bool Image::SetPNGSrc(const char* src)
...
@@ -346,10 +325,8 @@ bool Image::SetPNGSrc(const char* src)
srcData
[
n
++
]
=
row
[
x
+
0
];
// 0: R channel
srcData
[
n
++
]
=
row
[
x
+
0
];
// 0: R channel
srcData
[
n
++
]
=
row
[
x
+
3
];
// 3: Alpha channel
srcData
[
n
++
]
=
row
[
x
+
3
];
// 3: Alpha channel
}
}
UIFree
(
row
);
row
=
nullptr
;
}
}
UIFree
(
rowPointer
);
FreePngBytep
(
&
rowPointer
,
height
);
imgInfo
->
header
.
width
=
width
;
imgInfo
->
header
.
width
=
width
;
imgInfo
->
header
.
height
=
height
;
imgInfo
->
header
.
height
=
height
;
...
@@ -357,18 +334,7 @@ bool Image::SetPNGSrc(const char* src)
...
@@ -357,18 +334,7 @@ bool Image::SetPNGSrc(const char* src)
imgInfo
->
dataSize
=
dataSize
;
imgInfo
->
dataSize
=
dataSize
;
imgInfo
->
data
=
srcData
;
imgInfo
->
data
=
srcData
;
if
(
imageInfo_
!=
nullptr
)
{
ReInitImageInfo
(
imgInfo
,
true
);
if
(
mallocFlag_
)
{
if
(
imageInfo_
->
data
!=
nullptr
)
{
UIFree
(
reinterpret_cast
<
void
*>
(
const_cast
<
uint8_t
*>
(
imageInfo_
->
data
)));
}
mallocFlag_
=
false
;
}
UIFree
(
reinterpret_cast
<
void
*>
(
const_cast
<
ImageInfo
*>
(
imageInfo_
)));
imageInfo_
=
nullptr
;
}
imageInfo_
=
imgInfo
;
mallocFlag_
=
true
;
srcType_
=
IMG_SRC_VARIABLE
;
srcType_
=
IMG_SRC_VARIABLE
;
return
true
;
return
true
;
}
}
...
@@ -378,10 +344,10 @@ bool Image::SetJPEGSrc(const char* src)
...
@@ -378,10 +344,10 @@ bool Image::SetJPEGSrc(const char* src)
struct
jpeg_decompress_struct
cinfo
;
struct
jpeg_decompress_struct
cinfo
;
struct
jpeg_error_mgr
jerr
;
struct
jpeg_error_mgr
jerr
;
FILE
*
infile
=
nullptr
;
FILE
*
infile
=
nullptr
;
srcType_
=
IMG_SRC_UNKNOWN
;
if
((
infile
=
fopen
(
src
,
"rb"
))
==
nullptr
)
{
if
((
infile
=
fopen
(
src
,
"rb"
))
==
nullptr
)
{
GRAPHIC_LOGE
(
"can't open %s
\n
"
,
src
);
GRAPHIC_LOGE
(
"can't open %s
\n
"
,
src
);
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
cinfo
.
err
=
jpeg_std_error
(
&
jerr
);
cinfo
.
err
=
jpeg_std_error
(
&
jerr
);
...
@@ -402,7 +368,6 @@ bool Image::SetJPEGSrc(const char* src)
...
@@ -402,7 +368,6 @@ bool Image::SetJPEGSrc(const char* src)
jpeg_finish_decompress
(
&
cinfo
);
jpeg_finish_decompress
(
&
cinfo
);
jpeg_destroy_decompress
(
&
cinfo
);
jpeg_destroy_decompress
(
&
cinfo
);
fclose
(
infile
);
fclose
(
infile
);
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
uint8_t
*
srcData
=
static_cast
<
uint8_t
*>
(
UIMalloc
(
dataSize
));
uint8_t
*
srcData
=
static_cast
<
uint8_t
*>
(
UIMalloc
(
dataSize
));
...
@@ -411,7 +376,6 @@ bool Image::SetJPEGSrc(const char* src)
...
@@ -411,7 +376,6 @@ bool Image::SetJPEGSrc(const char* src)
jpeg_destroy_decompress
(
&
cinfo
);
jpeg_destroy_decompress
(
&
cinfo
);
fclose
(
infile
);
fclose
(
infile
);
UIFree
(
imgInfo
);
UIFree
(
imgInfo
);
srcType_
=
IMG_SRC_UNKNOWN
;
return
false
;
return
false
;
}
}
uint32_t
n
=
0
;
uint32_t
n
=
0
;
...
@@ -434,20 +398,22 @@ bool Image::SetJPEGSrc(const char* src)
...
@@ -434,20 +398,22 @@ bool Image::SetJPEGSrc(const char* src)
imgInfo
->
dataSize
=
dataSize
;
imgInfo
->
dataSize
=
dataSize
;
imgInfo
->
data
=
srcData
;
imgInfo
->
data
=
srcData
;
if
(
imageInfo_
!=
nullptr
)
{
ReInitImageInfo
(
imgInfo
,
true
);
if
(
mallocFlag_
)
{
if
(
imageInfo_
->
data
!=
nullptr
)
{
UIFree
(
reinterpret_cast
<
void
*>
(
const_cast
<
uint8_t
*>
(
imageInfo_
->
data
)));
}
mallocFlag_
=
false
;
}
UIFree
(
reinterpret_cast
<
void
*>
(
const_cast
<
ImageInfo
*>
(
imageInfo_
)));
imageInfo_
=
nullptr
;
}
imageInfo_
=
imgInfo
;
mallocFlag_
=
true
;
srcType_
=
IMG_SRC_VARIABLE
;
srcType_
=
IMG_SRC_VARIABLE
;
return
true
;
return
true
;
}
}
#endif
#endif
void
Image
::
ReInitImageInfo
(
ImageInfo
*
imgInfo
,
bool
mallocFlag
)
{
if
(
mallocFlag_
)
{
if
(
imageInfo_
->
data
!=
nullptr
)
{
UIFree
(
reinterpret_cast
<
void
*>
(
const_cast
<
uint8_t
*>
(
imageInfo_
->
data
)));
}
}
UIFree
(
reinterpret_cast
<
void
*>
(
const_cast
<
ImageInfo
*>
(
imageInfo_
)));
imageInfo_
=
imgInfo
;
mallocFlag_
=
mallocFlag
;
}
}
// namespace OHOS
}
// namespace OHOS
\ No newline at end of file
frameworks/components/ui_arc_scroll_bar.cpp
100644 → 100755
浏览文件 @
5476da58
...
@@ -92,7 +92,7 @@ void UIArcScrollBar::DrawForeground(BufferInfo& gfxDstBuffer, const Rect& invali
...
@@ -92,7 +92,7 @@ void UIArcScrollBar::DrawForeground(BufferInfo& gfxDstBuffer, const Rect& invali
if
((
startAngle
>
endAngle_
)
||
(
endAngle
<
startAngle_
))
{
if
((
startAngle
>
endAngle_
)
||
(
endAngle
<
startAngle_
))
{
return
;
return
;
}
}
ArcInfo
arcInfo
=
{
0
};
ArcInfo
arcInfo
=
{
{
0
,
0
},
{
0
,
0
},
0
,
0
,
0
,
nullptr
};
arcInfo
.
radius
=
(
radius_
>
0
)
?
(
radius_
-
1
)
:
0
;
arcInfo
.
radius
=
(
radius_
>
0
)
?
(
radius_
-
1
)
:
0
;
arcInfo
.
center
=
center_
;
arcInfo
.
center
=
center_
;
arcInfo
.
startAngle
=
MATH_MAX
(
startAngle
,
startAngle_
);
arcInfo
.
startAngle
=
MATH_MAX
(
startAngle
,
startAngle_
);
...
@@ -103,7 +103,7 @@ void UIArcScrollBar::DrawForeground(BufferInfo& gfxDstBuffer, const Rect& invali
...
@@ -103,7 +103,7 @@ void UIArcScrollBar::DrawForeground(BufferInfo& gfxDstBuffer, const Rect& invali
void
UIArcScrollBar
::
DrawBackground
(
BufferInfo
&
gfxDstBuffer
,
const
Rect
&
invalidatedArea
,
uint8_t
backgroundOpa
)
void
UIArcScrollBar
::
DrawBackground
(
BufferInfo
&
gfxDstBuffer
,
const
Rect
&
invalidatedArea
,
uint8_t
backgroundOpa
)
{
{
ArcInfo
arcInfo
=
{
0
};
ArcInfo
arcInfo
=
{
{
0
,
0
},
{
0
,
0
},
0
,
0
,
0
,
nullptr
};
arcInfo
.
radius
=
radius_
;
arcInfo
.
radius
=
radius_
;
arcInfo
.
center
=
center_
;
arcInfo
.
center
=
center_
;
arcInfo
.
startAngle
=
startAngle_
;
arcInfo
.
startAngle
=
startAngle_
;
...
...
frameworks/dock/screen_device_proxy.cpp
浏览文件 @
5476da58
...
@@ -41,15 +41,6 @@ void ScreenDeviceProxy::OnRenderFinish(const Rect& mask)
...
@@ -41,15 +41,6 @@ void ScreenDeviceProxy::OnRenderFinish(const Rect& mask)
void
ScreenDeviceProxy
::
DrawAnimatorBuffer
(
const
Rect
&
invalidatedArea
)
void
ScreenDeviceProxy
::
DrawAnimatorBuffer
(
const
Rect
&
invalidatedArea
)
{
{
Rect
invalidRect
=
curViewRect_
;
transMap_
.
SetTransMapRect
(
curViewRect_
);
invalidRect
.
Join
(
invalidRect
,
transMap_
.
GetBoxRect
());
if
(
invalidRect
.
Intersect
(
invalidRect
,
invalidatedArea
))
{
uint8_t
pxSize
=
DrawUtils
::
GetPxSizeByColorMode
(
animatorImageInfo_
.
header
.
colorMode
);
TransformDataInfo
imageTranDataInfo
=
{
animatorImageInfo_
.
header
,
animatorImageInfo_
.
data
,
pxSize
,
LEVEL0
,
BILINEAR
};
}
}
}
void
ScreenDeviceProxy
::
SetAnimatorRect
(
const
Rect
&
rect
)
void
ScreenDeviceProxy
::
SetAnimatorRect
(
const
Rect
&
rect
)
...
...
frameworks/draw/draw_utils.cpp
浏览文件 @
5476da58
...
@@ -146,10 +146,6 @@ namespace OHOS {
...
@@ -146,10 +146,6 @@ namespace OHOS {
ASSERT(0); \
ASSERT(0); \
}
}
#ifdef VERSION_STANDARD
const
int16_t
HARDWARE_ACC_SIZE_LIMIT
=
50
*
50
;
#endif
namespace
{
namespace
{
static
constexpr
uint8_t
OPACITY_STEP_A1
=
255
;
static
constexpr
uint8_t
OPACITY_STEP_A1
=
255
;
static
constexpr
uint8_t
OPACITY_STEP_A2
=
85
;
static
constexpr
uint8_t
OPACITY_STEP_A2
=
85
;
...
...
interfaces/kits/common/image.h
浏览文件 @
5476da58
...
@@ -169,6 +169,7 @@ private:
...
@@ -169,6 +169,7 @@ private:
!
strcmp
(
suffix
,
".JPG"
)
||
!
strcmp
(
suffix
,
".jpeg"
)
||
!
strcmp
(
suffix
,
".JPEG"
)
||
!
strcmp
(
suffix
,
".JPG"
)
||
!
strcmp
(
suffix
,
".jpeg"
)
||
!
strcmp
(
suffix
,
".JPEG"
)
||
!
strcmp
(
suffix
,
".BMP"
)
||
!
strcmp
(
suffix
,
".bmp"
));
!
strcmp
(
suffix
,
".BMP"
)
||
!
strcmp
(
suffix
,
".bmp"
));
}
}
void
ReInitImageInfo
(
ImageInfo
*
imgInfo
,
bool
mallocFlag
);
};
};
}
// namespace OHOS
}
// namespace OHOS
#endif // GRAPHIC_LITE_IMAGE_H
#endif // GRAPHIC_LITE_IMAGE_H
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录