提交 0e6e4b9f 编写于 作者: Y youbing

Description: Code alarm processing

IssueNo: https://gitee.com/openharmony/graphic_ui/issues/I5UCNU
Feature or Bugfix: Bugfix
Binary Source:No
Signed-off-by: youbing54<youbing3@huawei.com>
上级 de999faf
......@@ -236,7 +236,7 @@ bool Image::PreParse(const char *src)
}
path_ = path;
bool isSucess = true;
#if ENABLE_JPEG_AND_PNG
#if defined(ENABLE_JPEG_AND_PNG) && ENABLE_JPEG_AND_PNG
ImageType imageType = CheckImgType(src);
if (imageType == IMG_PNG) {
isSucess = SetPNGSrc(src);
......
......@@ -17,7 +17,7 @@
#include "gfx_utils/graphic_log.h"
#include "securec.h"
namespace OHOS {
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
SpannableString::~SpannableString()
{
if (text_ != nullptr) {
......
......@@ -40,7 +40,7 @@ Text::Text()
horizontalAlign_(TEXT_ALIGNMENT_LEFT),
verticalAlign_(TEXT_ALIGNMENT_TOP)
{
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
textStyles_ = nullptr;
#endif
SetFont(DEFAULT_VECTOR_FONT_FILENAME, DEFAULT_VECTOR_FONT_SIZE);
......@@ -52,7 +52,7 @@ Text::~Text()
UIFree(text_);
text_ = nullptr;
}
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
if (textStyles_ != nullptr) {
UIFree(textStyles_);
textStyles_ = nullptr;
......@@ -73,7 +73,7 @@ Text::~Text()
}
}
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
void Text::SetSpannableString(const SpannableString* spannableString)
{
SetText(spannableString->text_);
......@@ -130,7 +130,7 @@ void Text::SetText(const char* text)
text_ = nullptr;
return;
}
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
if (textStyles_ != nullptr) {
UIFree(textStyles_);
textStyles_ = nullptr;
......@@ -328,7 +328,7 @@ void Text::Draw(BufferInfo& gfxDstBuffer,
0, opa, style, &text_[lineBegin], textLine_[i].lineBytes,
lineBegin, fontId_, fontSize_, 0, static_cast<UITextLanguageDirect>(direct_),
nullptr, baseLine_,
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
textStyles_,
#endif
&backgroundColor_, &foregroundColor_, &linebackgroundColor_, sizeSpans_, 0};
......@@ -524,7 +524,7 @@ uint16_t Text::GetLetterIndexByPosition(const Rect& textRect, const Style& style
void Text::SetAbsoluteSizeSpan(uint16_t start, uint16_t end, uint8_t size)
{
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
if (fontId_ == FONT_ID_MAX) {
return;
}
......@@ -534,7 +534,7 @@ void Text::SetAbsoluteSizeSpan(uint16_t start, uint16_t end, uint8_t size)
}
#endif
uint8_t fontId = GetSpanFontIdBySize(size);
#if !ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && !ENABLE_VECTOR_FONT
if (fontId == fontId_) {
return;
}
......@@ -561,7 +561,7 @@ void Text::SetAbsoluteSizeSpan(uint16_t start, uint16_t end, uint8_t size)
void Text::SetRelativeSizeSpan(uint16_t start, uint16_t end, float size)
{
uint8_t absoluteSize = 0;
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
absoluteSize = static_cast<uint8_t>(size * fontSize_);
#else
UITextLanguageFontParam* fontParam = UIFontBuilder::GetInstance()->GetTextLangFontsTable(fontId_);
......@@ -576,7 +576,7 @@ void Text::SetRelativeSizeSpan(uint16_t start, uint16_t end, float size)
uint8_t Text::GetSpanFontIdBySize(uint8_t size)
{
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
return fontId_;
#else
UITextLanguageFontParam* fontParam = UIFontBuilder::GetInstance()->GetTextLangFontsTable(fontId_);
......
......@@ -19,7 +19,7 @@
#include "gfx_utils/graphic_log.h"
#include "gfx_utils/mem_api.h"
#include "gfx_utils/transform.h"
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
#include "font/ui_multi_font_manager.h"
#endif
......@@ -516,7 +516,7 @@ bool TypedText::IsEmojiBase(uint32_t codePoint)
bool TypedText::IsColourWord(uint32_t codePoint, uint8_t fontId, uint8_t fontSize)
{
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
return ((codePoint >= 0xF000) && (codePoint <= 0xF8FF)) || IsEmoji(codePoint) || IsEmojiModifier(codePoint) ||
IsEmojiBase(codePoint);
#else
......@@ -525,7 +525,7 @@ bool TypedText::IsColourWord(uint32_t codePoint, uint8_t fontId, uint8_t fontSiz
if (weight >= 16) { // 16: rgb565->16 rgba8888->32 font with rgba
hasColor = true;
} else {
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
uint8_t* searchLists = nullptr;
int8_t listSize = UIMultiFontManager::GetInstance()->GetSearchFontList(fontId, &searchLists);
if ((listSize > 0) && (searchLists != nullptr)) {
......
......@@ -516,7 +516,7 @@ void RootView::Render()
#if defined __linux__ || defined __LITEOS__ || defined __APPLE__
pthread_mutex_lock(&lock_);
#endif
#if !LOCAL_RENDER
#if defined(LOCAL_RENDER) && (!LOCAL_RENDER)
OptimizeInvalidateRects();
#endif
......@@ -529,7 +529,7 @@ void RootView::Render()
if (invalidateRects_.Size() > 0) {
/* Fully draw whole reacts. If there are two buffers or more to display, buffers could be
independent between each other, so buffers need to be FULLY_RENDER. */
#if (FULLY_RENDER != 1)
#if defined(FULLY_RENDER) && (FULLY_RENDER != 1)
flushRect = invalidateRects_.Begin()->data_;
// only draw invalid rects. in this case, buffers (if there are two buffers or more to display) should keep
// same with each others, because only delta changes write to the buffer between each frames, so it fits one
......
......@@ -133,10 +133,10 @@ UIAbstractScroll::UIAbstractScroll()
scrollBarCenter_({0, 0}),
scrollBarCenterSetFlag_(false)
{
#if ENABLE_FOCUS_MANAGER
#if defined(ENABLE_FOCUS_MANAGER) && ENABLE_FOCUS_MANAGER
focusable_ = true;
#endif
#if ENABLE_ROTATE_INPUT
#if defined(ENABLE_ROTATE_INPUT) && ENABLE_ROTATE_INPUT
rotateFactor_ = DEFAULT_SCROLL_VIEW_ROTATE_FACTOR;
rotateThrowthreshold_ = ABSTRACT_ROTATE_THROW_THRESHOLD;
rotateAccCoefficient_ = ABSTRACT_ROTATE_DISTANCE_COEFF;
......@@ -150,7 +150,7 @@ UIAbstractScroll::UIAbstractScroll()
UIAbstractScroll::~UIAbstractScroll()
{
#if DEFAULT_ANIMATION
#if defined(DEFAULT_ANIMATION) && DEFAULT_ANIMATION
if (barEaseInOutAnimator_ != nullptr) {
delete barEaseInOutAnimator_;
barEaseInOutAnimator_ = nullptr;
......
......@@ -335,7 +335,7 @@ void UICanvas::ClearRect(const Point& startPoint, int16_t height, int16_t width)
void UICanvas::DrawCircle(const Point& center, uint16_t radius, const Paint& paint)
{
if (paint.GetChangeFlag()) {
#if GRAPHIC_ENABLE_BEZIER_ARC_FLAG
#if defined(GRAPHIC_ENABLE_BEZIER_ARC_FLAG) && GRAPHIC_ENABLE_BEZIER_ARC_FLAG
if (vertices_ == nullptr) {
vertices_ = new UICanvasVertices();
}
......@@ -465,7 +465,7 @@ void UICanvas::DrawLabel(const Point& startPoint,
Invalidate();
}
}
#if GRAPHIC_ENABLE_DRAW_IMAGE_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_IMAGE_FLAG) && GRAPHIC_ENABLE_DRAW_IMAGE_FLAG
void UICanvas::DrawImage(const Point &startPoint, const char* image, const Paint& paint)
{
if (image == nullptr) {
......@@ -547,7 +547,7 @@ void UICanvas::DrawPath(const Paint& paint)
pathParam->vertices = vertices_;
pathParam->isStroke = true;
#if GRAPHIC_ENABLE_PATTERN_FILL_FLAG
#if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
if (paint.GetStyle() == Paint::PATTERN) {
ImageParam* imageParam = new ImageParam;
if (imageParam == nullptr) {
......@@ -595,7 +595,7 @@ void UICanvas::FillPath(const Paint& paint)
pathParam->vertices = vertices_;
pathParam->isStroke = false;
#if GRAPHIC_ENABLE_PATTERN_FILL_FLAG
#if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
if (paint.GetStyle() == Paint::PATTERN) {
ImageParam* imageParam = new ImageParam;
if (imageParam == nullptr) {
......@@ -669,7 +669,7 @@ void OnBlendDrawPattern(ListNode<UICanvas::DrawCmd>* curDraw,
TransAffine& transform,
PathParam* pathParamBlend)
{
#if GRAPHIC_ENABLE_PATTERN_FILL_FLAG
#if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
if (curDraw->data_.paint.GetStyle() == Paint::PATTERN) {
if (curDraw->data_.param == nullptr) {
return;
......@@ -696,7 +696,7 @@ void OnBlendDrawGradient(ListNode<UICanvas::DrawCmd>* curDraw,
TransAffine& transform,
PathParam* pathParamBlend)
{
#if GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
#if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
if (curDraw->data_.paint.GetStyle() == Paint::GRADIENT) {
TransAffine gradientMatrix;
FillInterpolator interpolatorType(gradientMatrix);
......@@ -766,7 +766,7 @@ void UICanvas::OnBlendDraw(BufferInfo& gfxDstBuffer, const Rect& trunc)
continue;
}
PathParam* pathParam = static_cast<PathParam*>(curDraw->data_.param);
#if GRAPHIC_ENABLE_BLUR_EFFECT_FLAG
#if defined(GRAPHIC_ENABLE_BLUR_EFFECT_FLAG) && GRAPHIC_ENABLE_BLUR_EFFECT_FLAG
if (curDraw->data_.paint.HaveShadow()) {
DrawCanvas::DoDrawShadow(gfxDstBuffer, curDraw->data_.param, curDraw->data_.paint, rect, trunc, *style_,
pathParam->isStroke);
......@@ -997,7 +997,7 @@ void UICanvas::DoDrawArc(BufferInfo& gfxDstBuffer,
BaseGfxEngine::GetInstance()->DrawArc(gfxDstBuffer, arcInfo, invalidatedArea, drawStyle, OPA_OPAQUE,
CapType::CAP_NONE);
}
#if GRAPHIC_ENABLE_DRAW_IMAGE_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_IMAGE_FLAG) && GRAPHIC_ENABLE_DRAW_IMAGE_FLAG
void UICanvas::DoDrawImage(BufferInfo& gfxDstBuffer,
void* param,
const Paint& paint,
......@@ -1084,7 +1084,7 @@ void UICanvas::DoFillPath(BufferInfo& gfxDstBuffer,
BaseGfxEngine::GetInstance()->FillPath(gfxDstBuffer, param, paint, rect, invalidatedArea, style);
}
#if GRAPHIC_ENABLE_DRAW_TEXT_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_TEXT_FLAG) && GRAPHIC_ENABLE_DRAW_TEXT_FLAG
void UICanvas::StrokeText(const char* text, const Point& point, const FontStyle& fontStyle, const Paint& paint)
{
if (text == nullptr) {
......@@ -1151,7 +1151,7 @@ void UICanvas::BlitMapBuffer(BufferInfo &gfxDstBuffer, BufferInfo& gfxMapBuffer,
}
}
#if GRAPHIC_ENABLE_DRAW_TEXT_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_TEXT_FLAG) && GRAPHIC_ENABLE_DRAW_TEXT_FLAG
void UICanvas::DoDrawText(BufferInfo& gfxDstBuffer,
void* param,
const Paint& paint,
......@@ -1286,7 +1286,7 @@ void UICanvas::BlendRaster(const Paint& paint,
BlendScanLine(paint.GetGlobalCompositeOperation(), blendRasterizer, rasterizer,
scanline1, scanline2, renBase, allocator1, spanBlendSoildColor, spanGen);
}
#if GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
#if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
FillInterpolator interpolatorTypeBlend(gradientMatrixBlend);
FillGradientLut gradientColorModeBlend;
if (paint.GetStyle() == Paint::GRADIENT) {
......@@ -1313,7 +1313,7 @@ void UICanvas::BlendRaster(const Paint& paint,
}
}
#endif
#if GRAPHIC_ENABLE_PATTERN_FILL_FLAG
#if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
if (paint.GetStyle() == Paint::PATTERN) {
if (param == nullptr) {
return;
......
......@@ -18,7 +18,7 @@ namespace OHOS {
void UIExtendImageView::SetSrc(const char* src)
{
UIImageView::SetSrc(src);
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
if (GetGifImageAnimator() != nullptr && this->canvas_ &&
this->canvas_->GetViewType() == UI_CANVAS) {
this->canvas_->Invalidate();
......@@ -29,7 +29,7 @@ void UIExtendImageView::SetSrc(const char* src)
void UIExtendImageView::SetSrc(const ImageInfo* src)
{
UIImageView::SetSrc(src);
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
if (GetGifImageAnimator() != nullptr && this->canvas_ &&
this->canvas_->GetViewType() == UI_CANVAS) {
this->canvas_->Invalidate();
......
......@@ -23,12 +23,12 @@
#include "gfx_utils/image_info.h"
#include "gfx_utils/mem_api.h"
#include "imgdecode/cache_manager.h"
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
#include "gif_lib.h"
#endif
namespace OHOS {
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
class GifImageAnimator : public Animator, public AnimatorCallback {
public:
GifImageAnimator(UIView* view, const char* src)
......@@ -231,7 +231,7 @@ UIImageView::UIImageView()
reserve_(0)
{
style_ = &(StyleDefault::GetBackgroundTransparentStyle());
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
gifImageAnimator_ = nullptr;
gifFrameFlag_ = false;
#endif
......@@ -239,7 +239,7 @@ UIImageView::UIImageView()
UIImageView::~UIImageView()
{
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
RemoveAndStopGifAnimator();
#endif
if (drawTransMap_ != nullptr) {
......@@ -479,7 +479,7 @@ void UIImageView::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea)
void UIImageView::SetSrc(const char* src)
{
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
if (src == nullptr) {
return;
}
......@@ -547,7 +547,7 @@ void UIImageView::ReMeasure()
void UIImageView::SetSrc(const ImageInfo* src)
{
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
if (!gifFrameFlag_ && (gifImageAnimator_ != nullptr)) {
RemoveAndStopGifAnimator();
}
......@@ -564,7 +564,7 @@ void UIImageView::SetSrc(const ImageInfo* src)
Invalidate();
}
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
void UIImageView::AddAndStartGifAnimator()
{
if (gifImageAnimator_ != nullptr) {
......
......@@ -183,7 +183,7 @@ void UILabel::SetText(const char* text)
}
}
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
void UILabel::SetText(const SpannableString* text)
{
InitLabelText();
......
......@@ -85,7 +85,7 @@ ClipPath& ClipPath::Circle(const PointF& center, float radius)
return *this;
}
vertices_->RemoveAll();
#if GRAPHIC_ENABLE_BEZIER_ARC_FLAG
#if defined(GRAPHIC_ENABLE_BEZIER_ARC_FLAG) && GRAPHIC_ENABLE_BEZIER_ARC_FLAG
BezierArc arc(center.x, center.y, radius, radius, 0, TWO_TIMES * PI);
vertices_->ConcatPath(arc, 0);
#endif
......
......@@ -43,7 +43,7 @@ void DrawCanvas::DoRender(BufferInfo& gfxDstBuffer,
if (param == nullptr) {
return;
}
#if GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG
#if defined(GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG) && GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG
if (paint.HaveShadow()) {
DrawCanvas::DoDrawShadow(gfxDstBuffer, param, paint, rect, invalidatedArea, style, isStroke);
}
......@@ -72,19 +72,19 @@ void DrawCanvas::DoRender(BufferInfo& gfxDstBuffer,
RenderSolid(paint, rasterizer, renBase, isStroke);
}
#if GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
#if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
if (paint.GetStyle() == Paint::GRADIENT) {
RenderGradient(paint, rasterizer, transform, renBase, renderBuffer, allocator, invalidatedArea);
}
#endif
#if GRAPHIC_ENABLE_PATTERN_FILL_FLAG
#if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
if (paint.GetStyle() == Paint::PATTERN) {
RenderPattern(paint, pathParam->imageParam, rasterizer, renBase, allocator, rect);
}
#endif
}
#if GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG
#if defined(GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG) && GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG
void DrawCanvas::DoDrawShadow(BufferInfo& gfxDstBuffer,
void* param,
const Paint& paint,
......@@ -165,7 +165,7 @@ void DrawCanvas::SetRasterizer(UICanvasVertices& vertices,
{
DepictCurve canvasPath(vertices);
if (isStroke) {
#if GRAPHIC_ENABLE_DASH_GENERATE_FLAG
#if defined(GRAPHIC_ENABLE_DASH_GENERATE_FLAG) && GRAPHIC_ENABLE_DASH_GENERATE_FLAG
if (paint.IsLineDash()) {
using DashStyle = DepictDash;
using StrokeDashStyle = DepictStroke<DashStyle>;
......@@ -194,7 +194,7 @@ void DrawCanvas::SetRasterizer(UICanvasVertices& vertices,
}
}
#if GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
#if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
void DrawCanvas::RenderGradient(const Paint& paint,
RasterizerScanlineAntialias& rasterizer,
TransAffine& transform,
......@@ -266,7 +266,7 @@ void DrawCanvas::BuildRadialGradientMatrix(const Paint& paint,
}
#endif // GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
#if GRAPHIC_ENABLE_PATTERN_FILL_FLAG
#if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
void DrawCanvas::RenderPattern(const Paint& paint,
void* param,
RasterizerScanlineAntialias& rasterizer,
......
......@@ -57,7 +57,7 @@ uint16_t DrawLabel::DrawTextOneLine(BufferInfo& gfxDstBuffer, const LabelLineInf
ColorType foregroundColor = labelLine.style.textColor_;
GetForegroundColor(letterIndex, labelLine.foregroundColor, foregroundColor);
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
TextStyle textStyle = TEXT_STYLE_NORMAL;
if (labelLine.textStyles) {
textStyle = labelLine.textStyles[letterIndex];
......@@ -74,7 +74,7 @@ uint16_t DrawLabel::DrawTextOneLine(BufferInfo& gfxDstBuffer, const LabelLineInf
fontId,
0,
fontSize,
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
textStyle,
#endif
labelLine.baseLine,
......@@ -217,7 +217,7 @@ void DrawLabel::DrawLetterWithRotate(BufferInfo& gfxDstBuffer,
UIFont* fontEngine = UIFont::GetInstance();
FontHeader head;
GlyphNode node;
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
node.textStyle = TEXT_STYLE_NORMAL;
#endif
if (fontEngine->GetFontHeader(head, fontId, fontSize) != 0) {
......
......@@ -1190,7 +1190,7 @@ static void DrawTriangleTrueColorBilinear8888Inner(const TriangleScanInfo& in,
}
#endif
#if ENABLE_FIXED_POINT
#if defined(ENABLE_FIXED_POINT) && ENABLE_FIXED_POINT
static void DrawFixedTriangleTrueColorBilinear8888Inner(const TriangleScanInfo& in,
uint8_t* screenBuffer,
int16_t len,
......
......@@ -16,14 +16,14 @@
#include "font/ui_font.h"
#include "common/text.h"
#include "font/ui_font_cache.h"
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
#include "font/ui_font_vector.h"
#endif
#if ENABLE_BITMAP_FONT
#if defined(ENABLE_BITMAP_FONT) && ENABLE_BITMAP_FONT
#include "font/ui_font_bitmap.h"
#endif
#include "graphic_config.h"
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
#include "font/ui_multi_font_manager.h"
#endif
......@@ -36,14 +36,14 @@ UIFont::~UIFont(){}
UIFont* UIFont::GetInstance()
{
static UIFont instance;
#if ENABLE_BITMAP_FONT
#if defined(ENABLE_BITMAP_FONT) && ENABLE_BITMAP_FONT
if (instance.instance_ == nullptr) {
instance.defaultInstance_ = new UIFontBitmap();
instance.instance_ = instance.defaultInstance_;
setFontAllocFlag_ = true;
}
#endif
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
if (instance.instance_ == nullptr) {
instance.defaultInstance_ = new UIFontVector();
instance.instance_ = instance.defaultInstance_;
......@@ -166,7 +166,7 @@ int8_t UIFont::GetGlyphNode(uint32_t unicode, GlyphNode& glyphNode, uint8_t font
return result;
}
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
uint8_t* searchLists = nullptr;
int8_t listSize = UIMultiFontManager::GetInstance()->GetSearchFontList(fontId, &searchLists);
if ((searchLists == nullptr) || (listSize == 0)) {
......
......@@ -336,7 +336,7 @@ uint16_t UIFontBitmap::GetOffsetPosY(const char* text,
uint8_t maxFontSie = fontSize;
while (i < lineLength) {
uint32_t unicode = TypedText::GetUTF8Next(text, i, i);
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
uint8_t ret = GetMultiGlyphNode(unicode, glyphNode, fontId);
#else
uint8_t ret = GetGlyphNode(unicode, glyphNode, fontId, fontSize);
......
......@@ -15,7 +15,7 @@
#include "font/ui_font_cache.h"
#include <cstddef>
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
#include "gfx_utils/style.h"
#endif
......@@ -73,7 +73,7 @@ uint8_t* UIFontCache::GetSpace(uint8_t fontId, uint32_t unicode, uint32_t size,
bitmap->fontId = fontId;
bitmap->unicode = unicode;
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
bitmap->textStyle = textStyle;
#endif
......@@ -101,7 +101,7 @@ uint8_t* UIFontCache::GetBitmap(uint8_t fontId, uint32_t unicode, TextStyle text
bitmap = reinterpret_cast<struct Bitmap*>(reinterpret_cast<uint8_t*>(node) -
offsetof(struct Bitmap, hashHead));
if ((bitmap->fontId == fontId) &&
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
(bitmap->textStyle == textStyle) &&
#endif
(bitmap->unicode == unicode)) {
......
......@@ -185,7 +185,7 @@ uint8_t UIFontVector::RegisterTtcFontInfo(const char* ttcName, TtfInfo* ttfInfo,
if (IsColorEmojiFont(ftFaces_[i])) {
SetupColorFont(ftFaces_[i]);
}
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
UIMultiFontManager::GetInstance()->UpdateScript(fontInfo_[j]);
#endif
}
......@@ -499,7 +499,7 @@ int8_t UIFontVector::GetGlyphNode(uint32_t unicode, GlyphNode& glyphNode, uint8_
glyphNode.advance = f->advance;
return RET_VALUE_OK;
}
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
int8_t error = LoadGlyphIntoFace(fontId, unicode, faceInfo.face, glyphNode.textStyle);
#else
int8_t error = LoadGlyphIntoFace(fontId, unicode, faceInfo.face);
......@@ -531,7 +531,7 @@ uint8_t* UIFontVector::GetBitmap(uint32_t unicode, GlyphNode& glyphNode, uint8_t
if (ret != RET_VALUE_OK) {
return nullptr;
}
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
uint8_t* bitmap = bitmapCache_->GetBitmap(faceInfo.key, unicode, glyphNode.textStyle);
#else
uint8_t* bitmap = bitmapCache_->GetBitmap(faceInfo.key, unicode);
......@@ -539,7 +539,7 @@ uint8_t* UIFontVector::GetBitmap(uint32_t unicode, GlyphNode& glyphNode, uint8_t
if (bitmap != nullptr) {
return bitmap + sizeof(Metric);
}
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
SetFace(faceInfo, unicode, glyphNode.textStyle);
#else
SetFace(faceInfo, unicode);
......@@ -552,7 +552,7 @@ bool UIFontVector::IsEmojiFont(uint8_t fontId)
return IsColorEmojiFont(ftFaces_[fontId]);
}
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
void UIFontVector::SetItaly(FT_GlyphSlot slot)
{
if (slot->format != FT_GLYPH_FORMAT_OUTLINE) {
......@@ -626,7 +626,7 @@ int8_t UIFontVector::LoadGlyphIntoFace(uint8_t& fontId, uint32_t unicode, FT_Fac
return RET_VALUE_OK;
}
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
int8_t UIFontVector::LoadGlyphIntoFace(uint8_t& fontId, uint32_t unicode, FT_Face face, TextStyle textStyle)
{
int32_t error;
......@@ -687,7 +687,7 @@ uint8_t UIFontVector::IsGlyphFont(uint32_t unicode)
void UIFontVector::SetFace(FaceInfo& faceInfo, uint32_t unicode) const
{
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
SetFace(faceInfo, unicode, TEXT_STYLE_NORMAL);
#else
Metric f;
......@@ -714,7 +714,7 @@ void UIFontVector::SetFace(FaceInfo& faceInfo, uint32_t unicode) const
#endif
}
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
void UIFontVector::SetFace(FaceInfo& faceInfo, uint32_t unicode, TextStyle textStyle) const
{
Metric f;
......@@ -766,7 +766,7 @@ uint16_t UIFontVector::GetOffsetPosY(const char* text,
uint32_t unicode = TypedText::GetUTF8Next(text, i, i);
uint8_t ret = GetGlyphNode(unicode, glyphNode, fontId, fontSize);
if (ret == RET_VALUE_OK) {
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
if (TypedText::IsColourWord(unicode, fontId, fontSize)) {
#else
uint8_t weight = GetFontWeight(glyphNode.fontId);
......
......@@ -323,7 +323,7 @@ void UITestCanvas::UIKitCanvasTestDrawImage001()
}
CreateTitleLabel("绘制图片");
// {200, 50}: start point coordinates
#if GRAPHIC_ENABLE_DRAW_IMAGE_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_IMAGE_FLAG) && GRAPHIC_ENABLE_DRAW_IMAGE_FLAG
UICanvas* canvas = CreateCanvas();
Paint paint;
......@@ -343,7 +343,7 @@ void UITestCanvas::UIKitCanvasTestDrawImage002()
}
CreateTitleLabel("绘制图片");
// {200, 50}: start point coordinates
#if GRAPHIC_ENABLE_DRAW_IMAGE_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_IMAGE_FLAG) && GRAPHIC_ENABLE_DRAW_IMAGE_FLAG
UICanvas* canvas = CreateCanvas();
const float scale = 1.5f;
const int16_t trx = 50;
......@@ -353,7 +353,7 @@ void UITestCanvas::UIKitCanvasTestDrawImage002()
paint.Translate(trx, 0);
paint.SetOpacity(OPARCITY_127); // 127: opacity
canvas->DrawImage({ 200, 50 }, GREEN_IMAGE_PATH, paint);
#if GRAPHIC_ENABLE_DRAW_TEXT_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_TEXT_FLAG) && GRAPHIC_ENABLE_DRAW_TEXT_FLAG
UICanvas::FontStyle fontStyle;
fontStyle.align = TEXT_ALIGNMENT_CENTER;
fontStyle.direct = TEXT_DIRECT_LTR;
......@@ -1013,7 +1013,7 @@ void UITestCanvas::RM009LineCapDrawPath()
Paint paint;
paint.SetStrokeWidth(STROKE_WIDTH12);
paint.SetStrokeColor(Color::Green());
#if GRAPHIC_ENABLE_LINECAP_FLAG
#if defined(GRAPHIC_ENABLE_LINECAP_FLAG) && GRAPHIC_ENABLE_LINECAP_FLAG
paint.SetLineCap(LineCap::BUTT_CAP);
#endif
canvas->BeginPath();
......@@ -1029,7 +1029,7 @@ void UITestCanvas::RM009LineCapDrawPath()
canvas->LineTo({LINE18_X, LINE1_Y});
canvas->DrawPath(paint);
paint.SetStrokeColor(Color::Red());
#if GRAPHIC_ENABLE_LINECAP_FLAG
#if defined(GRAPHIC_ENABLE_LINECAP_FLAG) && GRAPHIC_ENABLE_LINECAP_FLAG
paint.SetLineCap(LineCap::SQUARE_CAP);
#endif
canvas->BeginPath();
......@@ -1045,7 +1045,7 @@ void UITestCanvas::RM009LineCapDrawPath()
canvas->LineTo({LINE21_X, LINE1_Y});
canvas->DrawPath(paint);
paint.SetStrokeColor(Color::Blue());
#if GRAPHIC_ENABLE_LINECAP_FLAG
#if defined(GRAPHIC_ENABLE_LINECAP_FLAG) && GRAPHIC_ENABLE_LINECAP_FLAG
paint.SetLineCap(LineCap::ROUND_CAP);
#endif
canvas->BeginPath();
......@@ -1072,7 +1072,7 @@ void UITestCanvas::RM009LineJoinDrawPath()
Paint paint;
paint.SetStrokeWidth(STROKE_WIDTH10);
paint.SetStrokeColor(Color::Green());
#if GRAPHIC_ENABLE_LINEJOIN_FLAG
#if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
paint.SetLineJoin(LineJoin::ROUND_JOIN);
#endif
canvas->BeginPath();
......@@ -1081,7 +1081,7 @@ void UITestCanvas::RM009LineJoinDrawPath()
canvas->LineTo({LINE25_X, LINE25_X});
canvas->LineTo({LINE22_X, LINE11_Y});
canvas->DrawPath(paint);
#if GRAPHIC_ENABLE_LINEJOIN_FLAG
#if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
paint.SetLineJoin(LineJoin::BEVEL_JOIN);
#endif
canvas->BeginPath();
......@@ -1090,7 +1090,7 @@ void UITestCanvas::RM009LineJoinDrawPath()
canvas->LineTo({LINE26_X, LINE25_Y});
canvas->LineTo({LINE27_X, LINE11_Y});
canvas->DrawPath(paint);
#if GRAPHIC_ENABLE_LINEJOIN_FLAG
#if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
paint.SetLineJoin(LineJoin::MITER_JOIN);
#endif
canvas->BeginPath();
......@@ -1099,7 +1099,7 @@ void UITestCanvas::RM009LineJoinDrawPath()
canvas->LineTo({LINE28_X, LINE25_Y});
canvas->LineTo({LINE29_X, LINE11_Y});
canvas->DrawPath(paint);
#if GRAPHIC_ENABLE_LINEJOIN_FLAG
#if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
// 当斜接角度超过MiterLimit时应该转化为平角
paint.SetLineJoin(LineJoin::MITER_JOIN);
paint.SetMiterLimit(MITERLIMIT4);
......@@ -1114,7 +1114,7 @@ void UITestCanvas::RM009LineJoinDrawPath()
}
void UITestCanvas::RM009LineDashDrawPath()
{
#if GRAPHIC_ENABLE_DASH_GENERATE_FLAG
#if defined(GRAPHIC_ENABLE_DASH_GENERATE_FLAG) && GRAPHIC_ENABLE_DASH_GENERATE_FLAG
if (container_ == nullptr) {
return;
}
......@@ -1225,7 +1225,7 @@ void UITestCanvas::RM008UIKitCanvasTest002()
canvas->ClosePath();
canvas->FillPath(paint);
// 放射渐变
#if GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
#if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
paint.createRadialGradient(RADIAL_GRADIENT300, RADIAL_GRADIENT140, RADIAL_GRADIENT5,
RADIAL_GRADIENT270, RADIAL_GRADIENT100, RADIAL_GRADIENT80);
#endif
......@@ -1254,7 +1254,7 @@ void UITestCanvas::RM008UIKitCanvasTest003()
paint.SetStyle(Paint::GRADIENT);
paint.SetStrokeWidth(STROKE_WIDTH8);
// 线性渐变
#if GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
#if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
paint.createLinearGradient(LINEARGRADIENT50, LINEARGRADIENT50, LINEARGRADIENT150, LINEARGRADIENT150);
paint.addColorStop(0, Color::Yellow());
paint.addColorStop(COLOR_STOP3, Color::White());
......@@ -1273,7 +1273,7 @@ void UITestCanvas::RM008UIKitCanvasTest003()
canvas->ClosePath();
canvas->DrawPath(paint);
// 放射渐变
#if GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
#if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
paint.createRadialGradient(LINEARGRADIENT300, LINEARGRADIENT140, LINEARGRADIENT5,
LINEARGRADIENT270, LINEARGRADIENT100, LINEARGRADIENT80);
#endif
......@@ -1300,7 +1300,7 @@ void UITestCanvas::RM008UIKitCanvasTest004()
Paint paint;
paint.SetStyle(Paint::PATTERN);
paint.SetStrokeWidth(STROKEWIDTH8);
#if GRAPHIC_ENABLE_PATTERN_FILL_FLAG
#if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
paint.CreatePattern(RED_IMAGE_PATH, REPEAT);
#endif
canvas->BeginPath();
......@@ -1337,7 +1337,7 @@ void UITestCanvas::RM008UIKitCanvasTest005()
Paint paint;
paint.SetStyle(Paint::PATTERN);
paint.SetStrokeWidth(STROKEWIDTH8);
#if GRAPHIC_ENABLE_PATTERN_FILL_FLAG
#if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
paint.CreatePattern(RED_IMAGE_PATH, REPEAT_X);
#endif
canvas->BeginPath();
......@@ -1375,7 +1375,7 @@ void UITestCanvas::RM008UIKitCanvasTest006()
Paint paint;
paint.SetStyle(Paint::PATTERN);
paint.SetStrokeWidth(STROKEWIDTH8);
#if GRAPHIC_ENABLE_PATTERN_FILL_FLAG
#if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
paint.CreatePattern(RED_IMAGE_PATH, REPEAT_Y);
#endif
canvas->BeginPath();
......@@ -1404,7 +1404,7 @@ void UITestCanvas::RM008UIKitCanvasTest007()
Paint paint;
paint.SetStyle(Paint::PATTERN);
paint.SetStrokeWidth(STROKEWIDTH8);
#if GRAPHIC_ENABLE_PATTERN_FILL_FLAG
#if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
paint.CreatePattern(RED_IMAGE_PATH, NO_REPEAT);
#endif
canvas->BeginPath();
......@@ -1426,7 +1426,7 @@ void UITestCanvas::RM008UIKitCanvasTest007()
void UITestCanvas::RM008UIKitCanvasShadowTest008()
{
#if GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG
#if defined(GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG) && GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG
if (container_ == nullptr) {
return;
}
......@@ -1502,7 +1502,7 @@ void UITestCanvas::RM011StrokeText001()
{
CreateTitleLabel("RM011_StrokeText_多国文字加旋转放大");
#if GRAPHIC_ENABLE_DRAW_TEXT_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_TEXT_FLAG) && GRAPHIC_ENABLE_DRAW_TEXT_FLAG
UICanvas* canvas = CreateCanvas();
UICanvas::FontStyle fontStyle;
fontStyle.align = TEXT_ALIGNMENT_CENTER;
......
......@@ -114,7 +114,7 @@ void UITestFont::UIKitFontTestDisplay001()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT);
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -134,7 +134,7 @@ void UITestFont::UIKitFontTestDisplay002()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT * 2); // 2 : double
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -155,7 +155,7 @@ void UITestFont::UIKitFontTestDisplay003()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT);
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -176,7 +176,7 @@ void UITestFont::UIKitFontTestDisplay004()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT * 2); // 2 : double
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -197,7 +197,7 @@ void UITestFont::UIKitFontTestDisplay005()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT);
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -217,7 +217,7 @@ void UITestFont::UIKitFontTestDisplay006()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT * 2); // 2 : double
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -238,7 +238,7 @@ void UITestFont::UIKitFontTestDisplay007()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT);
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -259,7 +259,7 @@ void UITestFont::UIKitFontTestDisplay008()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT * 2); // 2 : double
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -282,7 +282,7 @@ void UITestFont::UIKitFontTestDisplay009()
label->SetPosition(positionX_ + 100, positionY_); // 100 : offset x
label->Resize(LABEL_WIDTH, LABEL_HEIGHT);
label->SetLineBreakMode(UILabel::LineBreakMode::LINE_BREAK_ADAPT);
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -305,7 +305,7 @@ void UITestFont::UIKitFontTestDisplay010()
label->SetPosition(positionX_ + 100, positionY_); // 100 : offset x
label->Resize(LABEL_WIDTH / 2, LABEL_HEIGHT); // 2 : half
label->SetLineBreakMode(UILabel::LineBreakMode::LINE_BREAK_MARQUEE);
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -523,7 +523,7 @@ void UITestFont::UIKitFontTestBackgroundColor()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT);
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -545,7 +545,7 @@ void UITestFont::UIKitFontTestForegroundColor()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT * 2); // 2 : double
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -567,7 +567,7 @@ void UITestFont::UIKitFontTestLineBackgroundSpan()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT * 2); // 2 : double
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -589,7 +589,7 @@ void UITestFont::UIKitFontTestAbsoluteSizeSpan()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT * 2); // 2 : double
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -613,7 +613,7 @@ void UITestFont::UIKitFontTestRelativeSizeSpan()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
label->Resize(LABEL_WIDTH, LABEL_HEIGHT * 2); // 2 : double
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
label->SetFont(SOURCE_HAN_SANS_SC_REGULAR, FONT_SIZE);
#else
......@@ -635,7 +635,7 @@ void UITestFont::UIKitFontTestDisplayEmoji001()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
label->Resize(LABEL_WIDTH * 2, LABEL_HEIGHT * 3); // 2 : double; 3 : triple
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
UIFont::GetInstance()->RegisterFontInfo(DEFAULT_EMOJI_FILENAME);
......@@ -646,7 +646,7 @@ void UITestFont::UIKitFontTestDisplayEmoji001()
#else
label->Resize(LABEL_WIDTH, LABEL_HEIGHT * 2);
label->SetFontId(F_SOURCEHANSANSSC_REGULAR_30_4);
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
uint8_t findPath[] = {F_HWEMOJI_REGULAR_30_32};
UIMultiFontManager::GetInstance()->SetSearchFontList(F_SOURCEHANSANSSC_REGULAR_30_4, findPath, sizeof(findPath));
#endif
......@@ -666,7 +666,7 @@ void UITestFont::UIKitFontTestDisplayEmoji002()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
label->Resize(LABEL_WIDTH * 2, LABEL_HEIGHT * 6); // 2 : double; 6 : six times
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
UIFont::GetInstance()->RegisterFontInfo(DEFAULT_EMOJI_FILENAME);
......@@ -677,7 +677,7 @@ void UITestFont::UIKitFontTestDisplayEmoji002()
#else
label->Resize(LABEL_WIDTH, LABEL_HEIGHT * 3); // 3 : triple
label->SetFontId(F_SOURCEHANSANSSC_REGULAR_30_4);
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
uint8_t findPath[] = {F_HWEMOJI_REGULAR_30_32};
UIMultiFontManager::GetInstance()->SetSearchFontList(F_SOURCEHANSANSSC_REGULAR_30_4, findPath, sizeof(findPath));
#endif
......@@ -696,7 +696,7 @@ void UITestFont::UIKitFontTestDisplayEmoji003()
UILabel* label = new UILabel();
label->SetPosition(positionX_, positionY_);
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
label->Resize(LABEL_WIDTH * 2, LABEL_HEIGHT * 12); // 2 : double; 12 : twelve times
UIFont::GetInstance()->RegisterFontInfo(SOURCE_HAN_SANS_SC_REGULAR);
UIFont::GetInstance()->RegisterFontInfo(DEFAULT_EMOJI_FILENAME);
......@@ -707,7 +707,7 @@ void UITestFont::UIKitFontTestDisplayEmoji003()
#else
label->Resize(380, LABEL_HEIGHT * 3); // 3 : triple
label->SetFontId(F_SOURCEHANSANSSC_REGULAR_30_4);
#if ENABLE_MULTI_FONT
#if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
uint8_t findPath[] = {F_HWEMOJI_REGULAR_30_32};
UIMultiFontManager::GetInstance()->SetSearchFontList(F_SOURCEHANSANSSC_REGULAR_30_4, findPath, sizeof(findPath));
#endif
......
......@@ -42,7 +42,7 @@ void UITestImage::TearDown()
{
DeleteChildren(container_);
container_ = nullptr;
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
gifImageView_ = nullptr;
gifToGif_ = nullptr;
gifToJpeg_ = nullptr;
......@@ -69,7 +69,7 @@ const UIView* UITestImage::GetTestView()
UIKit_UIImage_Test_SetImage_012();
UIKit_UIImage_Test_SetImage_013();
UIKit_UIImage_Test_SetImage_014();
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
UIKit_UIImage_Test_SetImage_015();
UIKit_UIImage_Test_SetImage_016();
#endif
......@@ -382,7 +382,7 @@ void UITestImage::UIKit_UIImage_Test_SetImage_014()
}
}
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
void UITestImage::UIKit_UIImage_Test_SetImage_015()
{
if (container_ != nullptr) {
......
......@@ -18,7 +18,7 @@
#include "components/ui_checkbox.h"
#include "components/ui_label.h"
#include "font/ui_font.h"
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
#include "common/spannable_string.h"
#endif
namespace OHOS {
......
......@@ -19,7 +19,7 @@
#include <locale>
#include <string>
#include "common/text.h"
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
#include "common/spannable_string.h"
#else
#include "common/ui_text_language.h"
......@@ -166,7 +166,7 @@ HWTEST_F(TextTest, TextSetLineBackgroundSpan_001, TestSize.Level1)
HWTEST_F(TextTest, TextSetAbsoluteSizeSpan_001, TestSize.Level1)
{
Text* text = new Text();
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
#else
text->SetFontId(16);
#endif
......@@ -184,7 +184,8 @@ HWTEST_F(TextTest, TextSetRelativeSpan_001, TestSize.Level1)
delete text;
text = nullptr;
}
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
HWTEST_F(TextTest, TextSetStyleSpan_001, TestSize.Level1)
{
SpannableString spannableString("图形子系统测试正常粗体斜体粗斜体");
......@@ -195,7 +196,7 @@ HWTEST_F(TextTest, TextSetStyleSpan_001, TestSize.Level1)
}
#endif
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
HWTEST_F(TextTest, TextSetText_002, TestSize.Level0)
{
if (text_ == nullptr) {
......@@ -220,7 +221,7 @@ HWTEST_F(TextTest, TextSetText_002, TestSize.Level0)
}
#endif
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
HWTEST_F(TextTest, TextSetText_003, TestSize.Level0)
{
if (text_ == nullptr) {
......@@ -245,7 +246,7 @@ HWTEST_F(TextTest, TextSetText_003, TestSize.Level0)
}
#endif
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
HWTEST_F(TextTest, TextSetText_004, TestSize.Level1)
{
if (text_ == nullptr) {
......@@ -271,7 +272,7 @@ HWTEST_F(TextTest, TextSetText_004, TestSize.Level1)
#endif
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
HWTEST_F(TextTest, TextSetText_005, TestSize.Level1)
{
if (text_ == nullptr) {
......@@ -296,7 +297,7 @@ HWTEST_F(TextTest, TextSetText_005, TestSize.Level1)
}
#endif
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
HWTEST_F(TextTest, TextSetText_006, TestSize.Level1)
{
if (text_ == nullptr) {
......
......@@ -399,7 +399,7 @@ HWTEST_F(UICanvasTest, UICanvasLineTo_002, TestSize.Level1)
EXPECT_EQ(end.y, LINE2_Y);
}
#if GRAPHIC_ENABLE_ARC_FLAG
#if defined(GRAPHIC_ENABLE_ARC_FLAG) && GRAPHIC_ENABLE_ARC_FLAG
/**
* @tc.name: UICanvasArcTo_001
* @tc.desc: Verify ArcTo function, equal.
......@@ -606,7 +606,7 @@ HWTEST_F(UICanvasTest, UICanvasClosePath_002, TestSize.Level1)
EXPECT_EQ(end.y, 0);
}
#if GRAPHIC_ENABLE_LINECAP_FLAG
#if defined(GRAPHIC_ENABLE_LINECAP_FLAG) && GRAPHIC_ENABLE_LINECAP_FLAG
/**
* @tc.name: UICanvasSetLineCap_001
* @tc.desc: Verify SetLineCap function, equal.
......@@ -651,7 +651,7 @@ HWTEST_F(UICanvasTest, UICanvasSetLineCap_002, TestSize.Level0)
}
#endif
#if GRAPHIC_ENABLE_LINEJOIN_FLAG
#if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
/**
* @tc.name: UICanvasSetLineJoin_001
* @tc.desc: Verify SetLineJoin function, equal.
......@@ -695,7 +695,7 @@ HWTEST_F(UICanvasTest, UICanvasSetLineJoin_002, TestSize.Level0)
}
#endif
#if GRAPHIC_ENABLE_DASH_GENERATE_FLAG
#if defined(GRAPHIC_ENABLE_DASH_GENERATE_FLAG) && GRAPHIC_ENABLE_DASH_GENERATE_FLAG
/**
* @tc.name: UICanvasSetLineDashOffset_001
* @tc.desc: Verify SetLineDashOffset function, equal.
......@@ -739,7 +739,7 @@ HWTEST_F(UICanvasTest, UICanvasSetLineDashOffset_002, TestSize.Level0)
}
#endif
#if GRAPHIC_ENABLE_LINEJOIN_FLAG
#if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
/**
* @tc.name: UICanvasMiterLimit_001
* @tc.desc: Verify MiterLimit function, equal.
......@@ -936,7 +936,7 @@ HWTEST_F(UICanvasTest, UICanvasCleanRect_001, TestSize.Level1)
EXPECT_EQ(canvas_->GetStartPos().y, RECT_Y - 10);
viewGroup->Remove(canvas_);
}
#if GRAPHIC_ENABLE_DRAW_IMAGE_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_IMAGE_FLAG) && GRAPHIC_ENABLE_DRAW_IMAGE_FLAG
/**
* @tc.name: UICanvasDrawImage_001
* @tc.desc: Verify DrawImage function, equal.
......@@ -1092,7 +1092,7 @@ HWTEST_F(UICanvasTest, UICanvasDrawImage_003, TestSize.Level1)
}
#endif
#if GRAPHIC_ENABLE_DRAW_TEXT_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_TEXT_FLAG) && GRAPHIC_ENABLE_DRAW_TEXT_FLAG
/**
* @tc.name: UICanvasStrokeText_001
* @tc.desc: Verify StrokeText function, equal.
......@@ -1282,7 +1282,7 @@ HWTEST_F(UICanvasTest, UICanvasSetScale_002, TestSize.Level1)
fontStyle.letterSpace = LETTER_SPACE;
paint_->Scale(SCALE_X, SCALE_Y);
#if GRAPHIC_ENABLE_DRAW_TEXT_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_TEXT_FLAG) && GRAPHIC_ENABLE_DRAW_TEXT_FLAG
canvas_->StrokeText("hello world", {POS_X, POS_Y}, fontStyle, *paint_);
#endif
......@@ -1355,7 +1355,7 @@ HWTEST_F(UICanvasTest, UICanvasSetTranslate_002, TestSize.Level1)
fontStyle.letterSpace = LETTER_SPACE;
paint_->Translate(TRANSLATE_X, TRANSLATE_Y);
#if GRAPHIC_ENABLE_DRAW_TEXT_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_TEXT_FLAG) && GRAPHIC_ENABLE_DRAW_TEXT_FLAG
canvas_->StrokeText("hello world", {POS_X, POS_Y}, fontStyle, *paint_);
#endif
......@@ -1430,7 +1430,7 @@ HWTEST_F(UICanvasTest, UICanvasTransform_002, TestSize.Level1)
fontStyle.letterSpace = LETTER_SPACE;
paint_->Transform(SCALE_X, SHEAR_X, SHEAR_Y, SCALE_Y, TRANSLATE_X, TRANSLATE_Y);
#if GRAPHIC_ENABLE_DRAW_TEXT_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_TEXT_FLAG) && GRAPHIC_ENABLE_DRAW_TEXT_FLAG
canvas_->StrokeText("hello world", {POS_X, POS_Y}, fontStyle, *paint_);
#endif
......@@ -1507,7 +1507,7 @@ HWTEST_F(UICanvasTest, UICanvasSetTransform_002, TestSize.Level1)
fontStyle.letterSpace = LETTER_SPACE;
paint_->SetTransform(SCALE_X, SHEAR_X, SHEAR_Y, SCALE_Y, TRANSLATE_X, TRANSLATE_Y);
#if GRAPHIC_ENABLE_DRAW_TEXT_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_TEXT_FLAG) && GRAPHIC_ENABLE_DRAW_TEXT_FLAG
canvas_->StrokeText("hello world", {POS_X, POS_Y}, fontStyle, *paint_);
#endif
......@@ -1840,7 +1840,7 @@ HWTEST_F(UICanvasTest, UICanvasRestore_002, TestSize.Level1)
EXPECT_EQ(paint_->GetFillColor().full, color.full);
}
#if GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG
#if defined(GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG) && GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG
HWTEST_F(UICanvasTest, UICanvasShadowColor_001, TestSize.Level1)
{
if (paint_ == nullptr) {
......@@ -1864,7 +1864,7 @@ HWTEST_F(UICanvasTest, UICanvasShadowColor_002, TestSize.Level0)
}
#endif
#if GRAPHIC_ENABLE_BLUR_EFFECT_FLAG
#if defined(GRAPHIC_ENABLE_BLUR_EFFECT_FLAG) && GRAPHIC_ENABLE_BLUR_EFFECT_FLAG
HWTEST_F(UICanvasTest, UICanvasShadowBlur_001, TestSize.Level1)
{
if (paint_ == nullptr) {
......@@ -1928,7 +1928,7 @@ HWTEST_F(UICanvasTest, UICanvasShadowOffsetY_002, TestSize.Level0)
}
#endif
#if GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
#if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
HWTEST_F(UICanvasTest, UICanvasCreateLinearGradient_001, TestSize.Level1)
{
if (paint_ == nullptr) {
......@@ -1991,7 +1991,7 @@ HWTEST_F(UICanvasTest, UICanvasCreateRadialGradient_002, TestSize.Level0)
}
#endif
#if GRAPHIC_ENABLE_PATTERN_FILL_FLAG
#if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
HWTEST_F(UICanvasTest, UICanvasCreatePattern_001, TestSize.Level1)
{
if (paint_ == nullptr) {
......@@ -2015,7 +2015,7 @@ HWTEST_F(UICanvasTest, UICanvasCreatePattern_002, TestSize.Level0)
}
#endif
#if GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
#if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
HWTEST_F(UICanvasTest, UICanvasAddColorStop_001, TestSize.Level1)
{
if (paint_ == nullptr) {
......@@ -2131,7 +2131,7 @@ HWTEST_F(UICanvasTest, UICanvasSetRotate_002, TestSize.Level1)
fontStyle.letterSpace = LETTER_SPACE;
paint_->Rotate(ROTATE);
#if GRAPHIC_ENABLE_DRAW_TEXT_FLAG
#if defined(GRAPHIC_ENABLE_DRAW_TEXT_FLAG) && GRAPHIC_ENABLE_DRAW_TEXT_FLAG
canvas_->StrokeText("hello world", {POS_X, POS_Y}, fontStyle, *paint_);
#endif
......@@ -2160,7 +2160,7 @@ HWTEST_F(UICanvasTest, UICanvasInitDash_001, TestSize.Level0)
EXPECT_EQ(1, 0);
return;
}
#if GRAPHIC_ENABLE_DASH_GENERATE_FLAG
#if defined(GRAPHIC_ENABLE_DASH_GENERATE_FLAG) && GRAPHIC_ENABLE_DASH_GENERATE_FLAG
Paint* paint3 = new Paint();
paint_->InitDash(*paint3);
EXPECT_EQ(paint_->GetLineDash(), nullptr);
......
......@@ -98,7 +98,7 @@ HWTEST_F(UIImageViewTest, UIImageViewSetPosition_001, TestSize.Level0)
EXPECT_EQ(imageView_->GetHeight(), 0);
}
#if (ENABLE_GIF == 1)
#if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
/**
* @tc.name: UIImageViewSetSrc_001
* @tc.desc: Verify SetSrc function, correct gif path, equal.
......
......@@ -263,7 +263,7 @@ HWTEST_F(UILabelTest, UILabelOnPreDraw_001, TestSize.Level1)
invalidatedArea = nullptr;
}
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
/**
* @tc.name: UILabelSetText_002
* @tc.desc: Verify SetText function.
......
......@@ -250,7 +250,7 @@ HWTEST_F(ScrollViewTest, UIAbstractScrollSetDragFunc_001, TestSize.Level1)
EXPECT_EQ(scrollView_->GetDragFunc(), func);
}
#if ENABLE_ROTATE_INPUT
#if defined(ENABLE_ROTATE_INPUT) && ENABLE_ROTATE_INPUT
/**
* @tc.name: UIAbstractClockSetRotateACCLevel_001
* @tc.desc: Verify SetRotateACCLevel function.
......
......@@ -21,7 +21,7 @@
#include "draw/draw_utils.h"
#include "font/ui_font.h"
#include "font/ui_font_header.h"
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
#include "font/ui_font_vector.h"
#else
#include "common/ui_text_language.h"
......@@ -47,17 +47,17 @@ Monitor* Monitor::GetInstance()
void Monitor::InitHal()
{
#if USE_MOUSE
#if defined(USE_MOUSE) && USE_MOUSE
MouseInput* mouse = MouseInput::GetInstance();
InputDeviceManager::GetInstance()->Add(mouse);
#endif
#if USE_MOUSEWHEEL && ENABLE_ROTATE_INPUT
#if defined(USE_MOUSEWHEEL) && defined(ENABLE_ROTATE_INPUT) && USE_MOUSEWHEEL && ENABLE_ROTATE_INPUT
MousewheelInput* mousewheel = MousewheelInput::GetInstance();
InputDeviceManager::GetInstance()->Add(mousewheel);
#endif
#if USE_KEY
#if defined(USE_KEY) && USE_KEY
KeyInput* key = KeyInput::GetInstance();
InputDeviceManager::GetInstance()->Add(key);
#endif
......@@ -87,13 +87,13 @@ void Monitor::Flush(const Rect &rect)
// assuming below are the memory pool
static uint8_t g_fontMemBaseAddr[OHOS::MIN_FONT_PSRAM_LENGTH];
#if ENABLE_ICU
#if define(ENABLE_ICU) && ENABLE_ICU
static uint8_t g_icuMemBaseAddr[OHOS::SHAPING_WORD_DICT_LENGTH];
#endif
void Monitor::InitFontEngine()
{
#if ENABLE_VECTOR_FONT
#if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
GraphicStartUp::InitFontEngine(reinterpret_cast<uintptr_t>(g_fontMemBaseAddr), MIN_FONT_PSRAM_LENGTH,
VECTOR_FONT_DIR, DEFAULT_VECTOR_FONT_FILENAME);
#else
......@@ -106,7 +106,7 @@ void Monitor::InitFontEngine()
dPath.c_str(), nullptr);
#endif
#if ENABLE_ICU
#if defined(ENABLE_ICU) && ENABLE_ICU
GraphicStartUp::InitLineBreakEngine(reinterpret_cast<uintptr_t>(g_icuMemBaseAddr), SHAPING_WORD_DICT_LENGTH,
VECTOR_FONT_DIR, DEFAULT_LINE_BREAK_RULE_FILENAME);
#endif
......
......@@ -21,7 +21,7 @@
#include "events/key_event.h"
namespace OHOS {
#if USE_KEY
#if defined(USE_KEY) && USE_KEY
namespace {
static uint16_t g_lastKeyId = 0;
static uint16_t g_lastKeyState = INVALID_KEY_STATE;
......
......@@ -18,7 +18,7 @@
#include <QtCore/qvariant.h>
namespace OHOS {
#if USE_MOUSE
#if defined(USE_MOUSE) && USE_MOUSE
MouseInput* MouseInput::GetInstance()
{
static MouseInput mouseInput;
......
......@@ -20,7 +20,7 @@
static int16_t g_rotate = 0;
namespace OHOS {
#if USE_MOUSEWHEEL
#if defined(USE_MOUSEWHEEL) && USE_MOUSEWHEEL
#if ENABLE_ROTATE_INPUT
MousewheelInput* MousewheelInput::GetInstance()
{
......
......@@ -20,7 +20,7 @@
#include "dock/rotate_input_device.h"
namespace OHOS {
#if USE_MOUSEWHEEL
#if defined(USE_MOUSEWHEEL) && USE_MOUSEWHEEL
#if ENABLE_ROTATE_INPUT
class MousewheelInput : public RotateInputDevice {
public:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册