diff --git a/frameworks/animator/animator_manager.cpp b/frameworks/animator/animator_manager.cpp index 917be2d0d7dd0c62fc1822f5f600a24ab7582bae..fe7832483b5995160aed95a8226effeb739132c1 100644 --- a/frameworks/animator/animator_manager.cpp +++ b/frameworks/animator/animator_manager.cpp @@ -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* 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_; diff --git a/frameworks/common/graphic_startup.cpp b/frameworks/common/graphic_startup.cpp index b468c03f3b07448578719d08247f4804856d628f..933e791a96623aa1cc9e18250dc166d71184147b 100755 --- a/frameworks/common/graphic_startup.cpp +++ b/frameworks/common/graphic_startup.cpp @@ -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(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(strlen(path) + strlen(fileName) + 1); char* lineBreakRuleFile = reinterpret_cast(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(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); diff --git a/frameworks/common/image.cpp b/frameworks/common/image.cpp index 687402a52feee6213e476b95d46cab55da6d25b7..e88e5fc74647008558bf42f6c6a3a8945822ee34 100755 --- a/frameworks/common/image.cpp +++ b/frameworks/common/image.cpp @@ -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; } diff --git a/frameworks/common/input_device_manager.cpp b/frameworks/common/input_device_manager.cpp index 76fb29e45e26f0e80184a0c6100aa9cc761a22e8..5672eb112be91c8d76627109b507a885b6c47f29 100755 --- a/frameworks/common/input_device_manager.cpp +++ b/frameworks/common/input_device_manager.cpp @@ -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); diff --git a/frameworks/common/text.cpp b/frameworks/common/text.cpp index b2327e52ef2a0f2cc67ebda15f8086cbdded714d..31c9d9ac1a23ef7560e723b4fe18927b664afec2 100755 --- a/frameworks/common/text.cpp +++ b/frameworks/common/text.cpp @@ -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); diff --git a/frameworks/common/typed_text.cpp b/frameworks/common/typed_text.cpp index 82ff33bb169c6ff0baa64b7daa9dcdb43ad45a09..a19c2302cea54bda807a45d3b5d6a0afaaeb027e 100755 --- a/frameworks/common/typed_text.cpp +++ b/frameworks/common/typed_text.cpp @@ -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; } } diff --git a/frameworks/components/root_view.cpp b/frameworks/components/root_view.cpp index 6739d7f1852e4ef4d539aa3d40a0af86d0a9360b..4a75da531012baa00080072447747be0d498fab2 100755 --- a/frameworks/components/root_view.cpp +++ b/frameworks/components/root_view.cpp @@ -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."); } } diff --git a/frameworks/components/ui_abstract_progress.cpp b/frameworks/components/ui_abstract_progress.cpp index 89eaff5d3a9415307e711b16c22cb84836ff60f2..023f1abdba6702094bdb2a978c257dbf06701205 100755 --- a/frameworks/components/ui_abstract_progress.cpp +++ b/frameworks/components/ui_abstract_progress.cpp @@ -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; } } diff --git a/frameworks/components/ui_analog_clock.cpp b/frameworks/components/ui_analog_clock.cpp index b1bc0ca69fb541ad11065c43fa9305ea02db6c23..44562ec811512a3d0445f92e46cf433d566b1340 100755 --- a/frameworks/components/ui_analog_clock.cpp +++ b/frameworks/components/ui_analog_clock.cpp @@ -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; } /* diff --git a/frameworks/components/ui_arc_label.cpp b/frameworks/components/ui_arc_label.cpp index 507c85867fc4d346e08c97b43d7697e034813a1e..b87f6366cf0540cf266f429e176b62fcc0989783 100755 --- a/frameworks/components/ui_arc_label.cpp +++ b/frameworks/components/ui_arc_label.cpp @@ -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 diff --git a/frameworks/components/ui_box_progress.cpp b/frameworks/components/ui_box_progress.cpp index 0f76b4d8f46831e35e43d732060f7d71fcec9a06..0efee185e11a332dc9ef766c9c05932d85f45bef 100755 --- a/frameworks/components/ui_box_progress.cpp +++ b/frameworks/components/ui_box_progress.cpp @@ -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; } } diff --git a/frameworks/components/ui_button.cpp b/frameworks/components/ui_button.cpp index a9cb51852839183fa5bddf44fce8ec5715086765..cd7fcf5c393fb041623ee98c77ef5c8dd418055d 100755 --- a/frameworks/components/ui_button.cpp +++ b/frameworks/components/ui_button.cpp @@ -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; } } diff --git a/frameworks/components/ui_canvas.cpp b/frameworks/components/ui_canvas.cpp index 3b769445e8a8670f7d08295600164463af785a3a..ef35024a74d0926f185995a0bfe487cffac9391c 100755 --- a/frameworks/components/ui_canvas.cpp +++ b/frameworks/components/ui_canvas.cpp @@ -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(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(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(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(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_; diff --git a/frameworks/components/ui_dialog.cpp b/frameworks/components/ui_dialog.cpp index 016ab431724b1089d63cf2ac6f89c644f31f7af2..060c4b0f25d3f2523fb4ee274bda6239928d55a7 100755 --- a/frameworks/components/ui_dialog.cpp +++ b/frameworks/components/ui_dialog.cpp @@ -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!"); } } diff --git a/frameworks/components/ui_digital_clock.cpp b/frameworks/components/ui_digital_clock.cpp index ac4837013c679f08d3b875eeca3818fcb7cb80d3..a8fc1249a25f2420892627aaf9a1d9557ca79123 100755 --- a/frameworks/components/ui_digital_clock.cpp +++ b/frameworks/components/ui_digital_clock.cpp @@ -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); diff --git a/frameworks/components/ui_image_view.cpp b/frameworks/components/ui_image_view.cpp index 3be636499ffa3b892bdd09bd436ae9e9f723c45c..565a9e852c6a279e2453bd5002b254b032c1274f 100755 --- a/frameworks/components/ui_image_view.cpp +++ b/frameworks/components/ui_image_view.cpp @@ -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; } } diff --git a/frameworks/components/ui_label.cpp b/frameworks/components/ui_label.cpp index 34734101cf36a1ac64da98f5d06195ec16a08b69..2649cf1cfd2b6832df90e935dbb38110dc6a2e28 100755 --- a/frameworks/components/ui_label.cpp +++ b/frameworks/components/ui_label.cpp @@ -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); diff --git a/frameworks/components/ui_label_button.cpp b/frameworks/components/ui_label_button.cpp index df1717d15a0493d2124cf35453d9754c5d77b524..9cdcbcb45dd9661eab791cb399a73593554f3b07 100755 --- a/frameworks/components/ui_label_button.cpp +++ b/frameworks/components/ui_label_button.cpp @@ -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) { diff --git a/frameworks/components/ui_list.cpp b/frameworks/components/ui_list.cpp index 9da059e8137806f61b1c2c75a499f0b9b856a795..4ca4e3758b970663881b3cdb9314c5b2c1d216e6 100755 --- a/frameworks/components/ui_list.cpp +++ b/frameworks/components/ui_list.cpp @@ -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 diff --git a/frameworks/components/ui_picker.cpp b/frameworks/components/ui_picker.cpp index 76afd6d3fcbebe766361767778329a5bc9dafcfd..b00997bffb2d1dbb0e1588161f2d3ea7100903f0 100755 --- a/frameworks/components/ui_picker.cpp +++ b/frameworks/components/ui_picker.cpp @@ -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))) { diff --git a/frameworks/components/ui_qrcode.cpp b/frameworks/components/ui_qrcode.cpp index 66bc02ae570f094cc5a31c5ad17e0803735d8160..5413564cb2d7239023243fd6735a52336025aa78 100755 --- a/frameworks/components/ui_qrcode.cpp +++ b/frameworks/components/ui_qrcode.cpp @@ -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(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(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; } } diff --git a/frameworks/components/ui_scroll_view.cpp b/frameworks/components/ui_scroll_view.cpp index 6fb81eec438d962f58b75c7b7bf350f35e1c322a..adde27cb2b2b13f61e5197971ad090851cd20109 100755 --- a/frameworks/components/ui_scroll_view.cpp +++ b/frameworks/components/ui_scroll_view.cpp @@ -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_; diff --git a/frameworks/components/ui_slider.cpp b/frameworks/components/ui_slider.cpp index ee04cb1e4688bb578189d8e238bca018603ad022..b5b2b5f432397b01a0c90dd143342e3ccaead158 100755 --- a/frameworks/components/ui_slider.cpp +++ b/frameworks/components/ui_slider.cpp @@ -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 diff --git a/frameworks/components/ui_surface_view.cpp b/frameworks/components/ui_surface_view.cpp index 1621b8e48c453c0fd07fe3245506b1ea9402459e..1bb86d5e1e4d7fdc047f4486b97ab8df5b60fea0 100755 --- a/frameworks/components/ui_surface_view.cpp +++ b/frameworks/components/ui_surface_view.cpp @@ -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(acquireBuffer->GetVirAddr())); diff --git a/frameworks/components/ui_swipe_view.cpp b/frameworks/components/ui_swipe_view.cpp index 5db11f4b7a112d4f09c9df002cf0f97381618e43..816af93d5be4476989c73c7918a24f0e430d1531 100755 --- a/frameworks/components/ui_swipe_view.cpp +++ b/frameworks/components/ui_swipe_view.cpp @@ -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_; } diff --git a/frameworks/components/ui_time_picker.cpp b/frameworks/components/ui_time_picker.cpp index 8be76f9ce4a068f34dfa73ffb4239fa9d26d287e..9420a7c63caaa8115093b6c1d09594f3e335274b 100755 --- a/frameworks/components/ui_time_picker.cpp +++ b/frameworks/components/ui_time_picker.cpp @@ -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()); diff --git a/frameworks/components/ui_video.cpp b/frameworks/components/ui_video.cpp index ee94824a31886766bad508c59da58dda289b1c11..fd54aed6d187ce0a1548c15a7b662d6c874b12dd 100755 --- a/frameworks/components/ui_video.cpp +++ b/frameworks/components/ui_video.cpp @@ -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 diff --git a/frameworks/components/ui_view.cpp b/frameworks/components/ui_view.cpp index 586e51b2175863b91d0e0b6d40cb34c4bb05afba..957741cdd4c53d14e1b66822726379c92a5ae30e 100755 --- a/frameworks/components/ui_view.cpp +++ b/frameworks/components/ui_view.cpp @@ -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& 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& scale, const Vector2& 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& 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(); diff --git a/frameworks/components/ui_view_group.cpp b/frameworks/components/ui_view_group.cpp index 9d108213956ff7ae45423f5aadc5767d5a3c810e..ecc0632e557d9aa7b18dfcab26e10c3fc5777988 100755 --- a/frameworks/components/ui_view_group.cpp +++ b/frameworks/components/ui_view_group.cpp @@ -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; } diff --git a/frameworks/core/task_manager.cpp b/frameworks/core/task_manager.cpp index b980efc51371c7c5e09dfc345ae398fe937ad862..25e435578606fcb544299d84a35745907961ac8c 100755 --- a/frameworks/core/task_manager.cpp +++ b/frameworks/core/task_manager.cpp @@ -33,7 +33,7 @@ void TaskManager::Add(Task* task) ListNode* 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_; diff --git a/frameworks/dfx/event_injector.cpp b/frameworks/dfx/event_injector.cpp index b3583abd1f4567a1d7f2b495728a89d4a8a3811c..4f181b27a131c9346ccb97ca4f10c316f234eeef 100755 --- a/frameworks/dfx/event_injector.cpp +++ b/frameworks/dfx/event_injector.cpp @@ -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; diff --git a/frameworks/dfx/key_event_injector.cpp b/frameworks/dfx/key_event_injector.cpp index abb70f8cd70dab73bca0368aadc6c25ac92867de..095690a5f35ae336d2a8cc75ac65092f7aac46a3 100755 --- a/frameworks/dfx/key_event_injector.cpp +++ b/frameworks/dfx/key_event_injector.cpp @@ -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; diff --git a/frameworks/dfx/point_event_injector.cpp b/frameworks/dfx/point_event_injector.cpp index 704684986dec736706b5f3085c749dbe5d2a780f..0d4bb4b1a72ce81c31763153ca2bb8879e439274 100755 --- a/frameworks/dfx/point_event_injector.cpp +++ b/frameworks/dfx/point_event_injector.cpp @@ -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; diff --git a/frameworks/dfx/ui_dump_dom_tree.cpp b/frameworks/dfx/ui_dump_dom_tree.cpp index 1eb38f88c403abb012d655ed781b7263097c6791..bc5c805b52ff52fb6b06e5f88959654d57e35741 100755 --- a/frameworks/dfx/ui_dump_dom_tree.cpp +++ b/frameworks/dfx/ui_dump_dom_tree.cpp @@ -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(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(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; } diff --git a/frameworks/dfx/ui_screenshot.cpp b/frameworks/dfx/ui_screenshot.cpp index e2f85d89b363a52bc72bd76d8173d9c4558e10ef..13d93fc1416a7b8ada18d199bb3f95a569658729 100755 --- a/frameworks/dfx/ui_screenshot.cpp +++ b/frameworks/dfx/ui_screenshot.cpp @@ -55,14 +55,12 @@ public: UIFree(reinterpret_cast(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(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(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_); diff --git a/frameworks/dock/pointer_input_device.cpp b/frameworks/dock/pointer_input_device.cpp index e43d04935ae72a2fddb2844893ffe3b7cf85d84c..3ebd8e7656562e00af02685c77cca61f86797de4 100755 --- a/frameworks/dock/pointer_input_device.cpp +++ b/frameworks/dock/pointer_input_device.cpp @@ -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_); diff --git a/frameworks/dock/screen_device_proxy.cpp b/frameworks/dock/screen_device_proxy.cpp index f485707e1385fce25b18dccf818f0483f5481500..73fe10e4e0c8e7369592960de69ce09f49a1c551 100755 --- a/frameworks/dock/screen_device_proxy.cpp +++ b/frameworks/dock/screen_device_proxy.cpp @@ -71,14 +71,14 @@ void ScreenDeviceProxy::SetAnimatorRect(const Rect& rect) SetAnimatorbufferWidth(bufferWidth); if (memset_s(reinterpret_cast(const_cast(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_; diff --git a/frameworks/draw/clip_utils.cpp b/frameworks/draw/clip_utils.cpp index 3d220fbc6672680fb3e40e5d023e1998c1931f73..796f17cc00472f4db3c40bffaaf4b2da85b91f45 100644 --- a/frameworks/draw/clip_utils.cpp +++ b/frameworks/draw/clip_utils.cpp @@ -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; } } diff --git a/frameworks/draw/draw_label.cpp b/frameworks/draw/draw_label.cpp index d736b491d6d8d0142c9dc63d59b54079e001deed..784c8f8110a491b18fbffaaff6058f7be204f005 100755 --- a/frameworks/draw/draw_label.cpp +++ b/frameworks/draw/draw_label.cpp @@ -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_); diff --git a/frameworks/draw/draw_rect.cpp b/frameworks/draw/draw_rect.cpp index 974e75336b6d7600feeb2458d8ee04ee19eec869..757246f1bcf5431d294e32c2da560d3c0f369fb8 100755 --- a/frameworks/draw/draw_rect.cpp +++ b/frameworks/draw/draw_rect.cpp @@ -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; } diff --git a/frameworks/draw/draw_utils.cpp b/frameworks/draw/draw_utils.cpp index 5ac40f371ba28390510a5f389bb9d0cc5b4a0c61..92289c3093fbaf4dcfd72f8c23d301af08494a4b 100755 --- a/frameworks/draw/draw_utils.cpp +++ b/frameworks/draw/draw_utils.cpp @@ -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; } } diff --git a/frameworks/font/glyphs_manager.cpp b/frameworks/font/glyphs_manager.cpp index 83fcab60fd392f8599c7653c7a39fcd6eeb6bc9e..056d4616311280cf3a2a4210976d5c8e168ab295 100755 --- a/frameworks/font/glyphs_manager.cpp +++ b/frameworks/font/glyphs_manager.cpp @@ -63,7 +63,7 @@ int8_t GlyphsManager::GlyphNodeCacheInit() int32_t ret = read(fp_, indexCache_, size); if (ret != static_cast(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(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(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(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(size)) { - HILOG_ERROR(HILOG_MODULE_GRAPHIC, "GlyphsManager::GetBitmap read failed"); + GRAPHIC_LOGE("GlyphsManager::GetBitmap read failed"); return INVALID_RET_VALUE; } diff --git a/frameworks/font/ui_font_bitmap.cpp b/frameworks/font/ui_font_bitmap.cpp index 7437196fe8ee9e432340113d6cabea5ee7331919..f2e1921f6639738bb56f1c1a12a64ce97b1e41a5 100644 --- a/frameworks/font/ui_font_bitmap.cpp +++ b/frameworks/font/ui_font_bitmap.cpp @@ -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()) { diff --git a/frameworks/imgdecode/cache_manager.cpp b/frameworks/imgdecode/cache_manager.cpp index 5fddff29a2d486f7dc19be881aa615dfe863d0dc..0cbaff73715c3ad838bb9df3fdeddacd86ff13d5 100755 --- a/frameworks/imgdecode/cache_manager.cpp +++ b/frameworks/imgdecode/cache_manager.cpp @@ -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; } diff --git a/frameworks/imgdecode/image_load.cpp b/frameworks/imgdecode/image_load.cpp index 2288625266796d8a51eba5f2a2251a68ec97b711..000a3dd828afedf8c6a6fb9f589941f0f079e2cf 100755 --- a/frameworks/imgdecode/image_load.cpp +++ b/frameworks/imgdecode/image_load.cpp @@ -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(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(size)) { UIFree(buffer); - HILOG_ERROR(HILOG_MODULE_GRAPHIC, "SeekImageFile error."); + GRAPHIC_LOGE("SeekImageFile error."); return false; } bool ret = UnZip2ImageInfo(imageInfo, buffer, size); diff --git a/frameworks/window/window_impl.cpp b/frameworks/window/window_impl.cpp index b6bb0b18a3a1a1b671cf0b99ea2f83fda4dd34ab..c36ec050b049669a7ae5e320848e42bbf0c374cd 100755 --- a/frameworks/window/window_impl.cpp +++ b/frameworks/window/window_impl.cpp @@ -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; } diff --git a/interfaces/kits/components/ui_arc_label.h b/interfaces/kits/components/ui_arc_label.h index e3bb2569f650bd5ba8b739d400dcd3b8d04355b7..bbd10ceb04e2e5735347a7c78232fbd791061d10 100755 --- a/interfaces/kits/components/ui_arc_label.h +++ b/interfaces/kits/components/ui_arc_label.h @@ -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: diff --git a/interfaces/kits/components/ui_label_button.h b/interfaces/kits/components/ui_label_button.h index 72ff99fa4dd96edd0a73fdae7e6f026e3c16c0e6..174d39ff7e8b5013f6fa9583835ff72e25260854 100755 --- a/interfaces/kits/components/ui_label_button.h +++ b/interfaces/kits/components/ui_label_button.h @@ -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_; diff --git a/interfaces/kits/components/ui_picker.h b/interfaces/kits/components/ui_picker.h index 065c84a988502b957e27e43e20f4a1380ed62494..46338dba76a704b8bea807c187ecf9cea8e409a2 100755 --- a/interfaces/kits/components/ui_picker.h +++ b/interfaces/kits/components/ui_picker.h @@ -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; diff --git a/interfaces/kits/components/ui_view.h b/interfaces/kits/components/ui_view.h index 6a3554a8bd333f57213dfad159324cd72447ec50..dee37609908dc9467e8dd1dcbbdc3f6973bdc21f 100755 --- a/interfaces/kits/components/ui_view.h +++ b/interfaces/kits/components/ui_view.h @@ -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. diff --git a/test/framework/src/compare_tools.cpp b/test/framework/src/compare_tools.cpp index 37948f5a4a1763cabc2899e071401843e9fa2062..92ac5800c1a432258d65295a027db0b8b51e17f3 100644 --- a/test/framework/src/compare_tools.cpp +++ b/test/framework/src/compare_tools.cpp @@ -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); diff --git a/test/uitest/test_ui_dump_dom_tree/ui_test_dump_dom.cpp b/test/uitest/test_ui_dump_dom_tree/ui_test_dump_dom.cpp index 3fe1511da391e4654e0b27d06d2752246abe8daf..f7b68250efc845fbf5f3023ce6095d15a24ed6ab 100755 --- a/test/uitest/test_ui_dump_dom_tree/ui_test_dump_dom.cpp +++ b/test/uitest/test_ui_dump_dom_tree/ui_test_dump_dom.cpp @@ -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; diff --git a/test/unittest/dfx/event_injector_unit_test.cpp b/test/unittest/dfx/event_injector_unit_test.cpp index f221fe9023d68efff8a837edc7c826ae644f4c01..36fdd62a6b2686af80a442f901704185635f98af 100755 --- a/test/unittest/dfx/event_injector_unit_test.cpp +++ b/test/unittest/dfx/event_injector_unit_test.cpp @@ -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());