diff --git a/frameworks/animator/animator_manager.cpp b/frameworks/animator/animator_manager.cpp index 917be2d0d7dd0c62fc1822f5f600a24ab7582bae..96da6704afa8c4047ee853bb5e5ca8a5d2531bd5 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 { 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_image_view.cpp b/frameworks/components/ui_image_view.cpp index 3be636499ffa3b892bdd09bd436ae9e9f723c45c..dc64ee64b11c97c8ea356c0837665c13d195de48 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" 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_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_video.cpp b/frameworks/components/ui_video.cpp index ee94824a31886766bad508c59da58dda289b1c11..b871b3234ff72535d96f347bf5a9b64692891f7b 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 diff --git a/frameworks/components/ui_view.cpp b/frameworks/components/ui_view.cpp index 586e51b2175863b91d0e0b6d40cb34c4bb05afba..748bae271c10b636bd3f1a6096d847b1b4ca5806 100755 --- a/frameworks/components/ui_view.cpp +++ b/frameworks/components/ui_view.cpp @@ -548,20 +548,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/interfaces/kits/components/ui_arc_label.h b/interfaces/kits/components/ui_arc_label.h index e3bb2569f650bd5ba8b739d400dcd3b8d04355b7..c176c082cf63f78bee50638c8eccb7ab0531fb57 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) { + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "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..411456115dc7556fab1955f3e97d86e788d12977 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) { + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "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..5546b39c4386b544556cfd08afaa4697c972043a 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) { + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "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..cfec5ef64a22273c0e346c33468548f91b7c1160 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) { + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "new Rect fail"); + return; + } + } + visibleRect_->SetWidth(width); + visibleRect_->SetHeight(height); + visibleRect_->SetPosition(x, y); + } /** * @brief Sets the width for the view.