未验证 提交 63489a40 编写于 作者: O openharmony_ci 提交者: Gitee

!800 修复警告#5

Merge pull request !800 from youbing54/cherry-pick-1666339944
......@@ -82,7 +82,7 @@ uint16_t DrawLabel::DrawTextOneLine(BufferInfo& gfxDstBuffer, const LabelLineInf
labelLine.style.lineSpace_,
havebackgroundColor,
backgroundColor};
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
glyphNode.textStyle = letterInfo.textStyle;
#endif
glyphNode.advance = 0;
......
......@@ -91,12 +91,12 @@ namespace OHOS {
(r1) = static_cast<uint8_t>((Alpha2 * (r2) + (1 - Alpha2) * Alpha1 * (r1)) / Alpha3); \
(g1) = static_cast<uint8_t>((Alpha2 * (g2) + (1 - Alpha2) * Alpha1 * (g1)) / Alpha3); \
(b1) = static_cast<uint8_t>((Alpha2 * (b2) + (1 - Alpha2) * Alpha1 * (b1)) / Alpha3); \
(a1) = static_cast<uint8_t>(Alpha3 * OPA_OPAQUE);
(a1) = static_cast<uint8_t>(Alpha3 * OPA_OPAQUE)
#define COLOR_BLEND_RGB(r1, g1, b1, r2, g2, b2, a2) \
(r1) = (((r2) * (a2)) / OPA_OPAQUE) + (((r1) * (OPA_OPAQUE - (a2))) / OPA_OPAQUE); \
(g1) = (((g2) * (a2)) / OPA_OPAQUE) + (((g1) * (OPA_OPAQUE - (a2))) / OPA_OPAQUE); \
(b1) = (((b2) * (a2)) / OPA_OPAQUE) + (((b1) * (OPA_OPAQUE - (a2))) / OPA_OPAQUE);
(b1) = (((b2) * (a2)) / OPA_OPAQUE) + (((b1) * (OPA_OPAQUE - (a2))) / OPA_OPAQUE)
// 565
#define COLOR_FILL_BLEND(d, dm, s, sm, a) \
......
......@@ -23,10 +23,10 @@
#include "gfx_utils/file.h"
#include "gfx_utils/graphic_log.h"
#include "graphic_config.h"
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
#include "font/ui_multi_font_manager.h"
#endif
#if ENABLE_SHAPING
#if defined(ENABLE_SHAPING) && ENABLE_SHAPING
#include "font/ui_text_shaping.h"
#endif
......@@ -60,9 +60,10 @@ bool UIFontBitmap::IsVectorFont() const
return false;
}
uint8_t UIFontBitmap::GetShapingFontId(char* text, uint8_t& ttfId, uint32_t& script, uint16_t fontId, uint8_t size) const
uint8_t UIFontBitmap::GetShapingFontId(char* text, uint8_t& ttfId, uint32_t& script,
uint16_t fontId, uint8_t size) const
{
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
return UIMultiFontManager::GetInstance()->GetShapingFontId(text, fontId, ttfId, script);
#else
UITextLanguageFontParam* fontParam = UIFontBuilder::GetInstance()->GetTextLangFontsTable(fontId);
......@@ -157,7 +158,7 @@ int8_t UIFontBitmap::GetFontHeader(FontHeader& fontHeader, uint16_t fontId, uint
return INVALID_RET_VALUE;
}
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
int8_t UIFontBitmap::GetMultiGlyphNode(uint32_t unicode, GlyphNode& glyphNode, uint16_t fontId)
{
int8_t ret = GetGlyphNode(unicode, glyphNode, fontId);
......
......@@ -28,7 +28,7 @@
#include "gfx_utils/graphic_log.h"
#include "graphic_config.h"
#include "securec.h"
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
#include "font/ui_multi_font_manager.h"
#endif
......@@ -115,7 +115,7 @@ uint8_t UIFontVector::RegisterFontInfo(const char* ttfName, uint8_t shaping)
} else {
fontInfo_[j].fontWeight = BPP_BIT_8;
}
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
UIMultiFontManager::GetInstance()->UpdateScript(fontInfo_[j]);
#endif
return j;
......@@ -496,9 +496,10 @@ uint16_t UIFontVector::GetHeight(uint16_t fontId, uint8_t fontSize)
return static_cast<uint16_t>(faceInfo.face->size->metrics.height / FONT_PIXEL_IN_POINT);
}
uint8_t UIFontVector::GetShapingFontId(char* text, uint8_t& ttfId, uint32_t& script, uint16_t fontId, uint8_t size) const
uint8_t UIFontVector::GetShapingFontId(char* text, uint8_t& ttfId, uint32_t& script,
uint16_t fontId, uint8_t size) const
{
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
const UITextLanguageFontParam* fontParam1 = GetFontInfo(fontId);
if (fontParam1 == nullptr) {
return 0;
......@@ -523,7 +524,7 @@ uint8_t UIFontVector::GetShapingFontId(char* text, uint8_t& ttfId, uint32_t& scr
}
ttfId = fontParam1->ttfId;
#if ENABLE_SHAPING
#if defined(ENABLE_SHAPING) && ENABLE_SHAPING
script = UIMultiFontManager::GetInstance()->GetScriptByTtfId(ttfId);
#endif
return fontParam1->shaping;
......@@ -536,6 +537,7 @@ uint8_t UIFontVector::GetShapingFontId(char* text, uint8_t& ttfId, uint32_t& scr
return fontInfo->shaping;
#endif
}
uint16_t UIFontVector::GetFontId(const char* ttfName, uint8_t fontSize) const
{
if (ttfName != nullptr) {
......@@ -713,6 +715,7 @@ void UIFontVector::SetItaly(FT_GlyphSlot slot)
FT_Outline outline = slot->outline;
FT_Outline_Transform(&outline, &matrix);
}
void UIFontVector::SetBold(uint16_t fontId)
{
int32_t error;
......
......@@ -339,7 +339,7 @@ public:
*/
virtual void OnPickerStoped(UIPicker& picker) {}
/**
* @brief Called when an item is selected during sliding. This function is implemented by applications.
* @brief Called when an item is selected during sliding. This function is implemented by applications.
*
* @param picker Indicates the picker instance.
* @since 1.0
......
......@@ -576,7 +576,7 @@ private:
bool touchable_;
};
#if DEFAULT_ANIMATION
#if defined(DEFAULT_ANIMATION) && DEFAULT_ANIMATION
class TestBtnAnimationListener : public UIView::OnClickListener {
public:
TestBtnAnimationListener(UIView* uiView, bool enableAnimation) : uiView_(uiView), enableAnimation_(enableAnimation)
......@@ -708,8 +708,9 @@ void UITestBUTTON::UIKitButtonTest002(UIScrollView* container, UIButton* button)
container->Add(button14);
container->Add(button15);
#if DEFAULT_ANIMATION
UILabelButton* button16 = GetTestUIButton("开启动效", 340, 1040, button); // 340: x-coordinate, 1040: y-coordinate
#if defined(DEFAULT_ANIMATION) && DEFAULT_ANIMATION
// 340: x-coordinate, 1040: y-coordinate
UILabelButton* button16 = GetTestUIButton("开启动效", 340, 1040, button);
if (enableAnimationListener_ == nullptr) {
enableAnimationListener_ =
static_cast<UIView::OnClickListener*>(
......@@ -717,7 +718,8 @@ void UITestBUTTON::UIKitButtonTest002(UIScrollView* container, UIButton* button)
}
button16->SetOnClickListener(enableAnimationListener_);
UILabelButton* button17 = GetTestUIButton("关闭动效", 340, 1090, button); // 340: x-coordinate, 1090: y-coordinate
// 340: x-coordinate, 1090: y-coordinate
UILabelButton* button17 = GetTestUIButton("关闭动效", 340, 1090, button);
if (disableAnimationListener_ == nullptr) {
disableAnimationListener_ = static_cast<UIView::OnClickListener*>(
new TestBtnAnimationListener(reinterpret_cast<UIView*>(button), false));
......
......@@ -267,7 +267,6 @@ void UITestClip::UIKitClipTest004()
CreateTitleLabel("贝塞尔曲线裁剪 ");
ClipPath path;
// {50, 50}, {100, 50}, {100, 100}, {50, 100}: path points; {60, 110}, {80, 10}: control points of curve
path.MoveTo({50, 50}).CurveTo({60, 110}, {80, 10}, {100, 50}).LineTo({100, 100}).LineTo({50, 100});
UIImageView* imageView = CreateImageView();
......@@ -282,7 +281,6 @@ void UITestClip::UIKitClipTest005()
CreateTitleLabel("多边形裁剪 ");
ClipPath path;
// {20, 70}, {50, 60}, {110, 80}, {110, 130}, {50, 100}, {20, 120}: path points
path.MoveTo({20, 70}).LineTo({50, 60}).LineTo({110, 80}).LineTo({110, 130}).LineTo({50, 100}).LineTo({20, 120});
UIImageView* imageView = CreateImageView();
......
......@@ -17,7 +17,7 @@
#define UI_TEST_SCREENSHOT_H
#include "graphic_config.h"
#if ENABLE_DEBUG
#if defined(ENABLE_DEBUG) && ENABLE_DEBUG
#include "components/ui_scroll_view.h"
#include "components/ui_label.h"
#include "components/ui_label_button.h"
......
......@@ -27,7 +27,7 @@ namespace {
const uint8_t INIT_HOUR = 24;
const uint8_t INIT_MINUTE = 60;
const uint8_t INIT_SECOND = 60;
const bool clockInit = 1;
const bool CLOCK_INT = 1;
}
class UIAbstractClockUnitTest : public testing::Test {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册